imgSessionWaitSignal2
Usage
rval imgSessionWaitSignal2(SESSION_ID sid, IMG_SIGNAL_TYPE signalType, uInt32 signalIdentifier, uInt32 state, uInt32 timeout);
Purpose
Waits for a signal to be in a given state. This function returns when either the specified signal is in a given state or the wait times out.
Parameters
Name | Type | Direction |
sid | SESSION_ID | input |
signalType | IMG_SIGNAL_TYPE | input |
signalIdentifier | uInt32 | input |
state | uInt32 | input |
timeout | uInt32 | input |
rval | Int32 | output |
Parameter Discussion
sid: valid SESSION_ID.
signalType: type of signal to wait for. signalType can be one of the following constants:
Note To use the ISO_IN or RS422_IN signals on the NI PCI-1426, select External as the Trigger Type for your function and choose ISO In or RS-422 In as the Signal Level for the trigger line in Measurement & Automation Explorer (MAX). |
IMG_SIGNAL_EXTERNAL |
IMG_SIGNAL_RTSI |
IMG_SIGNAL_ISO_IN |
IMG_SIGNAL_ISO_OUT |
IMG_SIGNAL_STATUS |
signalIdentifier: is the identifier of the signal to wait for. If the signal type is one of the triggers, then this value specifies which trigger line. If the signal type is IMG_SIGNAL_STATUS, signalIdentifier must be one of the following constants:
IMG_AQ_DONE |
IMG_AQ_IN_PROGRESS |
IMG_BUF_COMPLETE |
IMG_FRAME_DONE |
IMG_FRAME_START |
state: state of the signal to wait for. state can be one of the following constants:
IMG_SIGNAL_STATE_RISING | Waits for a rising edge. |
IMG_SIGNAL_STATE_FALLING | Waits for a falling edge. |
IMG_SIGNAL_STATE_HIGH | Returns immediately if the signal is high. Otherwise, waits for a rising edge. |
IMG_SIGNAL_STATE_LOW | Returns immediately if the signal is low. Otherwise, waits for a falling edge. |
timeout: time, in milliseconds, to wait for the appropriate state. If the appropriate state does not occur within the timeout period, the function returns IMG_ERR_TIMEOUT.
Return Value
This function returns 0 on success. On failure, this function returns an error code. For information about the error code, call imgShowError.