Parallel port input

Hello fellow QNX users,

We are using the AppBuilder to create a simple GUI application. We have
a text field and a button. The button just terminates the application.
The computer’s parallel port is connected to some device (actually a simple
circuit) that sends input if a button on the device is pressed. Now, we
want every time we press the device’s button to print a string on the
text field. Altough we have managed somethings, these aren’t exactly what
we are looking for. For example, we can detect the input only if a certain
key is pressed, or the mouse moves, etc. Now, we have to questions:

  1. Should we use the timer widget to get the required result and how
    should we use this widget.

  2. Is there any other approach to solve this problem?

Thank’s a lot for you help in advance!

Apostolos Syropoulos
apostolo@ocean1.ee.duth.gr

Parallel port input is not handled by photon you have to work with the
par1 device in /dev/.


Bye Sascha( sascha@bitctrl.de )

Sascha Morgenstern
BitCtrl Systems GmbH
Weißenfelser Straße 67
Germany - 04229 Leipzig
Phon. +49 341 490 670
FAX. +49 341 490 67 15
eMail: sascha@bitctrl.de
WWW: http://www.bitctrl.de


“Apostolos Syropoulos” <apostolo@cs.chalmers.se> schrieb im Newsbeitrag
news:9e9a8d$7fu$1@nyheter.chalmers.se

Hello fellow QNX users,

We are using the AppBuilder to create a simple GUI application. We have
a text field and a button. The button just terminates the application.
The computer’s parallel port is connected to some device (actually a
simple
circuit) that sends input if a button on the device is pressed. Now, we
want every time we press the device’s button to print a string on the
text field. Altough we have managed somethings, these aren’t exactly what
we are looking for. For example, we can detect the input only if a certain
key is pressed, or the mouse moves, etc. Now, we have to questions:

  1. Should we use the timer widget to get the required result and how
    should we use this widget.

  2. Is there any other approach to solve this problem?

Thank’s a lot for you help in advance!

Apostolos Syropoulos
apostolo@ocean1.ee.duth.gr

The computer’s parallel port is connected to some device (actually a
simple
circuit) that sends input if a button on the device is pressed. Now, we
want every time we press the device’s button to print a string on the
text field. Altough we have managed somethings, these aren’t exactly what
we are looking for. For example, we can detect the input only if a certain
key is pressed, or the mouse moves, etc. Now, we have to questions:

  1. Should we use the timer widget to get the required result and how
    should we use this widget.

This is a quite reasonable solution.

  1. Is there any other approach to solve this problem?

You could write a separate process that wakes up periodically
and checks the parallel port. When you see a button press,
send a message to the Photon program.

This approach has two advantages. First you are isolating
your hardware from your application, you are in effect writing
a driver. Second, you can control the priority of your
driver separately from that of the Photon application.

If you are using QNX v6 rather than QNX 4, you could of course
just create a thread that polls the parallel port.






Mitchell Schoenbrun --------- maschoen@pobox.com

Apostolos Syropoulos <apostolo@cs.chalmers.se> wrote:

Hello fellow QNX users,

We are using the AppBuilder to create a simple GUI application. We have
a text field and a button. The button just terminates the application.
The computer’s parallel port is connected to some device (actually a simple
circuit) that sends input if a button on the device is pressed. Now, we
want every time we press the device’s button to print a string on the
text field. Altough we have managed somethings, these aren’t exactly what
we are looking for. For example, we can detect the input only if a certain
key is pressed, or the mouse moves, etc. Now, we have to questions:

Which version of QNX are you using?

How is the parallel port being handled on the software side? That is,
are you running Dev.par (QNX4) or devc-par (QNX6)? When the device’s
button is pressed, what does it “send” accross the parallel port – does
it actually send something, or just change the state of some of the lines?

Before talking about how to incorporate this into a Photon application,
we need to know how this is being handled at the hardware level.

  1. Should we use the timer widget to get the required result and how
    should we use this widget.

Using a timer implies polling – I don’t like this choice if it can
be avoided.

  1. Is there any other approach to solve this problem?

There are probably other choices – but until we know which OS and
some more details about the situation (see above questions) it is hard
to know what to suggest.

-David

QNX Training Services
dagibbs@qnx.com

Previously, David Gibbs wrote in comp.os.qnx:

Using a timer implies polling – I don’t like this choice if it can
be avoided.

There aren’t a lot of choices with a parallel port. It is possible
use the interrupt if you set things up and toggle the right control
line. If the timing isn’t too critical, polling for a control line
is a reasonable solution.


Mitchell Schoenbrun --------- maschoen@pobox.com