imaqIORead

NI-IMAQ I/O C Function

imaqIORead

Format

rval = imaqIORead(IMAQIO_SESSION id, IMAQIOSignalType signalType, unsigned long signalNumber, IMAQIOSignalState* value);

Purpose

Reads general-purpose digital inputs from the static I/O of the NI-IMAQ I/O device.

Parameters

Name Type Direction
id IMAQIO_SESSION input
signalType IMAQIOSignalType input
signalNumber unsigned long input
value IMAQIOSignalState* output

Parameter Discussion

id is the ID of the session to read from.

signalType is the type of signal to read from. The following values are valid for this parameter:

Name Constant Description
IMAQIO_SIGNAL_ISO_IN 2 ISO input signals include pulse trigger inputs, a shutdown input, and a quadrature encoder input.
IMAQIO_SIGNAL_ISO_OUT 3 ISO output signals are general-purpose outputs.
IMAQIO_SIGNAL_TTL_IN 5 TTL input signals are general-purpose inputs and pulse trigger inputs.
IMAQIO_SIGNAL_TTL_OUT 6TTL output signals are general-purpose outputs and pulse generation outputs.

signalNumber is the line number of the signal to read from.

value is a pointer to the signal state read from the NI-IMAQ I/O device. The following values are valid:

IMAQIO_SIGNAL_STATE_HIGH Drives the line high when the signal is TRUE.
IMAQIO_SIGNAL_STATE_LOW Drives the line low when the signal is TRUE.
IMAQIO_SIGNAL_STATE_HI_Z Disables output on the line. This option is valid only for TTL Outs.

Return Value

This function returns 0 on success. On failure, this function returns an error code. For information about the error code, call imaqIOGetErrorText.