National Instruments NI-IMAQ User Manual

Page 26

Advertising
background image

Chapter 3

Programming with NI-IMAQ for 1394

NI-IMAQ for IEEE-1394 Cameras User Manual

3-10

ni.com

Performing an Asynchronous Snap Using Low-Level Functions

The Low-Level Snap1394 Async example demonstrates how to perform an
asynchronous acquisition using low-level calls. The example sets up a
single-frame acquisition to a buffer.

In an asynchronous snap, the program installs a callback function using the

imaq1394InstallCallback

function and starts the acquisition with the

imaq1394StartAcquisition

function. When the buffer is ready, the

driver calls the callback function, allowing you to retrieve the image using
the

imaq1394GetBuffer

function.

One advantage of an asynchronous snap is that you can start the acquisition
and then perform other tasks while waiting for the signal that the image is
ready.

Note

Since the callback function is called in a different thread than the main program, you

should make sure that all of your processing is thread-safe.

Performing an Asynchronous Grab using Low-Level Functions

The

Low-LevelGrab1394 Async

example demonstrates how to perform

an asynchronous grab acquisition using low-level calls. The example sets
up a continuous acquisition to a buffer.

The program installs a callback function which is called each time an image
is acquired until the acquisition is stopped or until the callback function
returns FALSE.

Note

Because the callback function is called in a different thread than the main program,

you should make sure that all of your processing is thread-safe.

Advertising