Gx3348GetDigitalInputs

Purpose

Reads back the eight digital inputs lines states.

Syntax

Gx3348GetDigitalInputs (nHandle, pdwData, pnStatus)

Parameters

Name
Type
Description
nHandle
SHORT
Handle to a GX3348 board.
pdwData
PDWORD
Bits 0-7 represent the 8 digital inputs. Bit zero corresponds to digital I/O line 0.
pnStatus
PSHORT
Returned status: 0 on success, negative number on failure.

Comments

Each of the 8 Output digital lines is also connected to an input line. If the output line is not enabled, then an external digital input can be monitored using this function. Otherwise if the line output is enabled, the function returns the output line logical state.

Example

The following example sets the lower 4 digital outputs lines to hi and the upper 4 lines to low, all odd lines (1, 3, etc) outputs are then enabled. The digital lines actual states are then read back.

 

SHORT nStatus;

DWORD dwOutputsEnabled, dwData;

DWORD dwDigitalInputs.

Gx3348SetDigitalOutputs (nHandle, 0x55, 0x0F, &nStatus);

Gx3348GetDigitalOutputs (nHandle, &dwOutputsEnabled, &dwData, &nStatus);

 

See Also

Gx3348SetDigitalOutputs, Gx3348GetDigitalOutputs, GxPdoGetErrorString