Digital input/output, Al_diginput – Measurement Computing ADLIB WIN User Manual

Page 65

Advertising
background image

Chapter 19 Digital Input/Output

18-1

18. DIGITAL INPUT/OUTPUT

The Digital Input/Output functions immediately reads or writes the specified Digital Port. For the Pci5500
and Pci55xx Digital IO Ports 0 & 1 are 8-bit ports and in addition the Pci55xx supports Digital Ports 2 & 3
as 16-bit ports. All of the Digital Input/Output functions read or write the full 8-bit or 16-bit value per call.

18.1 AL_DigInput

Prototype

C\C++

STATUS

AL_API

AL_DigInput(LHLD

lhld, long lChan, long lMaskBits);


Visual Basic for Windows

Function

AL_DigInput(ByVal

lhld As Long, ByVal lChan As Long,

ByVal lMaskBits As Long) As Long

LHLD lhld

handle of the LDSD

double lChan

specifies the input port channel number

long lMaskBits

specifies the input port masking bits


The AL_DigInput function immediately retrieves the input status of a digital input or digial output port.

Parameter

Description

lhld

Identifies the instance of the logical device subsystem.

lChan

Always 0 for the PCI55xx Series, specifies the input port channel otherwise.

lMaskBits

Selects the bits that the function will operate on. All bits set in the mask will

return their current state. Unselected mask bits will be set to zero.


Returns:
On success STATUS contains the current port data, otherwise ERRNUM contains the negative error code
that occurred during the call.

Note:
Digital IO Ports 0 & 1 for all supported hardware are only 8 bit ports. Digital Ports 2 & 3, for all except a
Pci5500 (which don’t have ports 2 & 3), are 16 bit ports. The lChan parameter for all Pci55xx boards
should be set to zero. All four digital ports are hardware programmable as either input or output ports and
can be represented by either DINx or DOTx, but not both. Port direction programming is determined by the
first call to either the AL_DigInput/AL_DigBitsTest functions for an input ports or the AL_DigOuput
function for an output port.

Related Functions:
AL_DigBitsTest

Program References:
Adldio01, Adldio23

Supported Logical Device Subsystems:
Pci5500: DIN0, DIN1, DOT0, DOT1
Pci55xx Series: DIN0, DIN1, DIN2, DIN3, DOT0, DOT1, DOT2, DOT3

Program References:
Adldio01, Adldio23

Advertising