LPT Properties And Methods
Previous  Top 

General theory and scheme on LPT ports handling are not provided in this manual because it's assumed that a user is already familiar with LPT port architecture, functionality and pin descriptions. This information is available from a variety books and manuals as well as on the Internet. I can recommend the following excellent book: Jan Axelson "Parallel Port Complete", available for purchase at www.amazon.com or at the author's website: www.lvr.com/parport.htm
The website www.lvr.com/parport.htm itself is an excellent source of information on the subject as well.

TVicHW32 includes a set of the functions to handle LPT ports at a hardware level. At the same time TVicHW32 does not offer any procedures to provide some exchange protocols for LPT. If necessary these procedures can be implemented by a user with a help of basic functions provided with TVicHW32. Soon we are planning to release a new product TVicLPT which will be fully devoted to LPT ports handling.


Here I give some short description only. For more information please follow the links.

GetLPTNumPorts  - returns a number of LPT ports detected on the system  
GetLPTNumber    - returns a number of current LPT  
SetLPTNumber    - allows to change current LPT port number  
GetLPTBasePort  - returns base address of current LPT port number(data register address)  
AddNewLPT       - allows to enter an address of a user "non-standard" port.  
SetLPTReadMode  - switches mode of current LPT port to "read" because normally data register is "read only"  
SetLPTWriteMode - switches mode of current LPT port back to "write"  
ForceIrqLPT     - allows to switch on and off receiving hardware interrupts by a system due to electric level change at ACK line (pin 10)  
AcquireLPT      - acquire current LPT port  
ReleaseLPT      - release acquired LPT port  
IsLPTAcquired   - check if LPT port is acquired.  
 

TVicHW32 allows to read/write operations for different pins of the D25 LPT connector. Pin numbers start from 1. For writing an electrical level to the selected pin of current LPT port use the function SetPin, and for reading use GetPin. It's also possible to control these pins by direct port access or LPT bit access, so these functions added to TVicHW32 for convenience.
Remember that not all the pins are available to read/write. See LPTTest example provided with deliverable TVicHW32 for more information. Pins 2-8 (data register) are available for reading only after the port was switched to read mode with the function SetLPTReadMode.

Here you can find a list of the functions to work with Centronix interface signal. Like in the above mentioned situation it's possible to work with Centronix over LPT port or by controlling pins directly. Basically this is what's called operations with LPT connector pins but they have a different names. Besides most of Centronix signals are inverted at reading. You can get detailed information by clicking on the function name.

GetLPTAckwl    
GetLPTBusy  
GetLPTPaperEnd  
GetLPTSlct  
GetLPTError  
LPTInit  
LPTSlctIn  
LPTAutofd  
LPTStrobe