Chapter3 Programmingwith NI-IMAQ for 1394
©NationalInstruments Corporation 3-9 NI-IMAQfor IEEE-1394 Cameras User Manual
Advanced Programming ExamplesUselow-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
TheLowLevelSnap1394.c example demonstrates how to perform a snap
acquisitionusing low-level calls. The example sets up a single-frame
acquisitionto a user-allocated buffer. The program retrieves the acquisition
windowsize of the selected camera. After the program sets the ROI, it locks
the memory and acquires the image.
Performing a Grab Using Low-Level Functions
TheLowLevelGrab1394.c example demonstrates how to perform a grab
acquisition using low-level calls. The example sets up a continuous
acquisitionto a single user-allocated buffer.
The program retrievesthe acquisition window size of the selected camera
and performsa calculation to determine the correct memory requirements
ofthe user buffer. The program then creates the buffer.The main processing
loop of the code showshow to copy the buffer to an analysis buffer.
Performing a Sequence Acquisition Using Low-Level Functions
TheLowLevelSequence1394.c example demonstrates how to perform a
sequenceacquisition using low-level calls. The example sets up a sequence
acquisitionto m ultiple buffers allocated by NI-IMAQ. As described in the
low-levelsnap example, the program retrieves the acquisition window size
ofthe selected camera. It createsa bufferlist tod escribe theacquisition
buffers.T he program calculates the correct memory requirements of the
frame buffer. The program starts the image acquisition asynchronously.
The mainp rocessingloop of the code shows how to process each buffer
acquired insequential order.