M
Marven Lee
Hello all,
I've been writing a slot car lap counter in C# and currently
use the inpout32.dll to read the parallel port status pins
that are connected to lane sensors.
I wondered if there was a way of doing it without inpout32.dll
and found that I could get the status of some pins using
DeviceIOControl() and IOCTL_PAR_QUERY_INFORMATION
control code.
I've been connecting the status pins to ground
or letting them float high (don't have a 5v power source)
and watched what happened.
Pin 12 (Paper-Out) sets PARALLEL_PAPER_EMPTY
Pin 13 (Select) sets PARALLEL_SELECTED
Both of the aboce work but:
Pin 11 (Busy) doesn't seem to return anything, not even
PARALLEL_BUSY. Is there any way to read this pin?
Pin 10 (Ack) doesn't have a corresponding code, so I guess
that is unreadable.
Pin 15 (Error) - This doesn't normally float high on the PC I
am using so tried getting 5v from one of the data output pins.
When this is high it appears to set PARALLEL_POWER_OFF,
is this correct?
I copied the values from Ntddpar.h, are these likely to remain
the same for user applications?
I could continue using inpout32.dll but would like to support
USB to Parallel adapters as well so thought using
DeviceIOControl() would be a better choice.
I've been writing a slot car lap counter in C# and currently
use the inpout32.dll to read the parallel port status pins
that are connected to lane sensors.
I wondered if there was a way of doing it without inpout32.dll
and found that I could get the status of some pins using
DeviceIOControl() and IOCTL_PAR_QUERY_INFORMATION
control code.
I've been connecting the status pins to ground
or letting them float high (don't have a 5v power source)
and watched what happened.
Pin 12 (Paper-Out) sets PARALLEL_PAPER_EMPTY
Pin 13 (Select) sets PARALLEL_SELECTED
Both of the aboce work but:
Pin 11 (Busy) doesn't seem to return anything, not even
PARALLEL_BUSY. Is there any way to read this pin?
Pin 10 (Ack) doesn't have a corresponding code, so I guess
that is unreadable.
Pin 15 (Error) - This doesn't normally float high on the PC I
am using so tried getting 5v from one of the data output pins.
When this is high it appears to set PARALLEL_POWER_OFF,
is this correct?
I copied the values from Ntddpar.h, are these likely to remain
the same for user applications?
I could continue using inpout32.dll but would like to support
USB to Parallel adapters as well so thought using
DeviceIOControl() would be a better choice.