Gx3348GetDigitalOutputs

Purpose

Reads back the eight digital output lines output enables and values.

Syntax

Gx3348GetDigitalOutputs (nHandle, pdwOutputsEnabled, pdwData, pnStatus)

Parameters

Name
Type
Description
nHandle
SHORT
Handle to a GX3348 board.
pdwOutputsEnabled
PDWORD
Bits 0-7 represent the 8 digital outputs lines inputs. Bit zero corresponds to digital I/O line 0.
Bit high will enable the specified digital output.
Bit low will disable the specified digital output (default after reset).
pdwData
PDWORD
Bits 0-7 represent the 8 digital inputs. Bit zero corresponds to digital I/O line 0.
Bit high will output logic high.
Bit low will output a logic low (default after reset).
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);

Gx3348GetDigitalInputs (nHandle, &dwDigitalInputs, &nStatus);

 

See Also

Gx3348SetDigitalOutputs, Gx3348GetDigitalInputs, GxPdoGetErrorString