Re: mscomm32 / parallelport?



Hi,

Well, are you using the parallel port or the serial port? If serial, then
you don't want pin 2. Which pin you use depends on whether you are using a
9pin or 25pin connector. Assuing 9pin, the in would make sense to use pin 6
(DSR). Then you could use the DSRHolding property of MSComm to read the pin
state.

If you are using the parallel port, then a control like IOocx from my
homepage will make this easy. It is free. To read pin 2 (data bit 0), you
would read the Data Latch register. However, some parallel port are output
only on the data lines, so it is more reasonable to use the status input
lines, such as Pin 11 (/Busy). This appears in the Printer Status register.
For example, yusing IOocx, you would set the ReadAddress = &H379, then read
the register and look only at Bit7 of that data to determine switch status.

--
Richard Grier, MVP
Hard & Software
Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
Edition,
ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
2006.
See www.hardandsoftware.net for details and contact information.


.


Loading