imgSessionWaitSignalAsync

NI IMAQ Function

imgSessionWaitSignalAsync

Usage

rval imgSessionWaitSignalAsync(SESSION_ID sid, uInt32 signal, uInt32 state, CALL_BACK_PTR function, void* data);

Purpose

Waits for a signal to be in a given state and when the signal is in that state, calls a user-defined function.

Note  This function is obsolete. The replacement function is imgSessionWaitSignalAsync2, which incorporates the functionality of imgSessionWaitSignalAsync but also returns additional information.

Parameters

Name Type Direction
sid SESSION_ID input
signal uInt32 input
state uInt32 input
function CALL_BACK_PTR input
data void* input
rval Int32 output

Parameter Discussion

sid: valid SESSION_ID.

signal: signal to wait for. The signal can one of the following constants:

IMG_AQ_IN_PROGRESSAsserted when the device initiates an acquisition either through a software- or hardware-triggered start.
IMG_AQ_DONEAsserted at the end of an acquisition when the last piece of data has been transferred to memory.
IMG_FRAME_STARTAsserted at the start of acquisition into each image buffer.
IMG_FRAME_DONEAsserted at the end of acquisition into each image buffer.
IMG_BUF_COMPLETEAsserted when an image buffer has been transferred to memory and is available for image processing.
IMG_EXT_TRIG0Specifies the external trigger 0.
IMG_EXT_TRIG1Specifies the external trigger 1.
IMG_EXT_TRIG2Specifies the external trigger 2.
IMG_EXT_TRIG3Specifies the external trigger 3.
IMG_EXT_RTSI0Specifies RTSI line 0.
IMG_EXT_RTSI1Specifies RTSI line 1.
IMG_EXT_RTSI2Specifies RTSI line 2.
IMG_EXT_RTSI3Specifies RTSI line 3.
IMG_EXT_RTSI4Specifies RTSI line 4.
IMG_EXT_RTSI5Specifies RTSI line 5.
IMG_EXT_RTSI6Specifies RTSI line 6.
Note  IMG_EXT_TRIG ‹0..3› refers to the external trigger lines of the image acquisition device. IMG_EXT_RTSI ‹0..6› refers to the internal pins on the RTSI controller of the image acquisition device.

state: state of the signal to wait for. state can be one of the following constants:

IMG_SIGNAL_STATE_RISINGWaits for a rising edge.
IMG_SIGNAL_STATE_FALLINGWaits for a falling edge.
IMG_SIGNAL_STATE_HIGHReturns immediately if the signal is high. Otherwise, waits for a rising edge.
IMG_SIGNAL_STATE_LOWReturns immediately if the signal is low. Otherwise, waits for a falling edge.

function: pointer to the callback function. Your function should match the following prototype:

uInt32(*function)(SESSION_ID sid, IMG_ERR err, uInt32 signal, void* userdata)

Note  The return value of the callback function determines the behavior of the driver for subsequent signal assertions. Return zero to disregard future signal assertions. Return a non-zero value to reinstate the callback function.

data value that is passed to the callback function. The value can be a pointer to user data.

Return Value

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

For more information, refer to the Obsolete functions topic.