imgSessionAcquire

NI IMAQ Function

imgSessionAcquire

Usage

rval imgSessionAcquire(SESSION_ID sid, uInt32 async, CALL_BACK_PTR callback);

Purpose

Starts an acquisition, synchronously or asynchronously, to the buffers in the associated session buffer list.

Parameters

Name Type Direction
sid SESSION_ID input
async uInt32 input
callback CALLBACK_PTR input
rval Int32 output

Parameter Discussion

sid: valid SESSION_ID.

async: asynchronous flag. If async is zero, this function does not return until the acquisition completes.

callback: pointer to the callback function. If async is non-zero, this callback function is called under one of the following two conditions:

  • If the acquisition is non-continuous, the callback is called when all buffers are acquired.
  • If the acquisition is continuous, the callback is called after each buffer becomes available.

Your function must match the following prototype:

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

Note  For non-continuous acquisitions, the callback function must return zero. For continuous acquisitions, the return value of the callback function determines the behavior of the driver for subsequent buffer completions. Return zero to disregard future buffer complete notifications. Return a non-zero value to continue to receive callbacks.

Return Value

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