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
OpenPort
Go to RapidDriver Main Page

Opens the selected parallel port if it is installed on PC.  

Language

Description

C/C++
BOOL OpenPort ( HANDLE hLpt, UCHAR PortNumber )
Delphi
function OpenPort ( hLpt: THANDLE; PortNumber: Byte ) : Boolean; stdcall
VB
Function OpenPort ( ByVal hLpt As Long, ByVal PortNumber As Byte ) As Boolean



Parameters:
hLpt - the handle returned by a successful call to OpenRapidLpt
PortNumber - number of the port to be opened.

Return Value :
TRUE, if the call to port was successful, FALSE otherwise.

Comments:

Use this function before doing i/o and interrupt operations with the port. If OpenPort() succeeds, you can get access to current
Parallel port info.
For example, LPT1 is opened in such a way:
OpenPort(hLpt, 1);

See also:
ClosePort