Home    Prev Next    
Contents
Programming For Parallel Port Device
Overview
Programmers Guide
Scenario
I/O Ports control
Single read/write operations
Data array read/write operations
Hardware interrupts handling at user level
Common Issues
LPT Support Routines
Common Procedures
OpenRapidLpt
IsRapidLptOpened
CloseRapidLpt
OpenPort
ClosePort
GetNumLPTs
GetPortNumber
GetReadMode
SetReadMode
LPT specific functions
Parallel port info
GetBasePortAddress
GetBaseSpan
GetEcpAddress
GetEcpSpan
GetInterruptVector
GetInterruptLevel
GetInterruptAffinity
GetInterruptMode
Parallel port registers
GetDataPort
SetDataPort
GetStatusPort
SetStatusPort
GetControlPort
SetControlPort
GetEcrPort
SetEcrPort
GetEPPAddressPort
SetEPPAddressPort
GetEPPDataPort
SetEPPDataPort
Centronix signals
GetLptBusy
GetLptPaperEnd
GetLptSlct
GetLptAutofd
SetLptAutofd
GetLptError
LptInit
LptSelectIn
GetPrinterReady
Parallel port modes
GetCurrentLptMode
SetCurrentLptMode
GetIsPresent
GetIsPS2Present
GetIsEcpPresent
Work with pins
GetPin
SetPin
Work with bits
GetDataPortBit
SetDataPortBit
GetStatusPortBit
SetStatusPortBit
GetControlPortBit
SetControlPortBit
GetCfgaPortBit
SetCfgaPortBit
GetCfgbPortBit
SetCfgbPortBit
GetEcrPortBit
SetEcrPortBit
Direct Port I/O
GetPortByte
GetPortWord
GetPortLong
SetPortByte
SetPortWord
SetPortLong
ReadPortBuffer
WritePortBuffer
Hardware Interrupts
UnmaskLptIrq
MaskLptIrq
GetInterruptCounter
OpenRapidLpt
Go to RapidDriver Main Page

Opens the RapidLpt.sys kernel mode WDM device driver under Windows 2000/XP, providing direct access to the LPT hardware.  

Language

Description

C/C++
HANDLE OpenRapidLpt ( ULONG DeviceInstance )
Delphi
function OpenRapidLpt ( DeviceInstance : Longword) : THandle; stdcall
VB
Function OpenRapidLpt ( ByVal DeviceInstance As Long) As Long


Parameters:
DeviceInstance - LPT device instance.

Return Value:
The RapidLpt handle value or NULL if fails. Keep this handle opened all time when you are working with RapidLpt functions and close by CloseRapidLpt() at end of application.

Comments:

If the driver was successfully opened, the IsRapidLptOpened() returns True; if the function fails, the IsRapidLptOpened() returns False.
With RapidLpt you can support as many LPT devices as you want. To select the device you need change DriverInstance value from 0 up to maximal number of LPT device installed with RapidLpt driver. For the first application use

    hLpt = OpenRapidLpt(0);

For second:

    hLpt = OpenRapidLpt(1);

and so on.

See also: CloseRapidLpt IsRapidLptOpened