National Instruments NI-IMAQ Digital Camera User Manual


 
Chapter 3 Programming with NI-IMAQ for 1394
© National Instruments Corporation 3-9 NI-IMAQ for IEEE-1394 Cameras User Manual
Advanced Programming Examples
Use low-level functions or combine high-and low-level functions for more
advanced programming techniques, including snap, grab, and sequence.
Performing a Snap Using Low-Level Functions
The
LowLevelSnap1394.c
example demonstrates how to perform a snap
acquisition using low-level calls. The example sets up a single-frame
acquisition to a user-allocated buffer. The program retrievesthe acquisition
window sizeof the selected camera. Afterthe programsets the ROI, it locks
the memory and acquires the image.
Performing a Grab Using Low-Level Functions
The
LowLevelGrab1394.c
example demonstrates how to perform a grab
acquisition using low-level calls. The example sets up a continuous
acquisition to a single user-allocated buffer.
The program retrieves the acquisition window size of the selected camera
and performs a calculation to determine the correct memory requirements
of the user buffer. The program thencreates the buffer. The main processing
loop of the code shows how to copy the buffer to an analysis buffer.
Performing a Sequence Acquisition Using Low-Level Functions
The
LowLevelSequence1394.c
example demonstrates howto perform a
sequence acquisition using low-level calls. The example sets up asequence
acquisition to multiple buffers allocated by NI-IMAQ. As described in the
low-level snap example, the program retrieves the acquisition window size
of the selected camera. It creates a buffer list to describe the acquisition
buffers. The program calculates the correct memory requirements of the
frame buffer. The program starts the image acquisition asynchronously.
The main processing loop of the code shows how to process each buffer
acquired in sequential order.