
Chapter3 Programmingwith NI-IMAQ for 1394
©NationalInstruments Corporation 3-7 NI-IMAQfor IEEE-1394 Cameras User Manual
Calling imaq1394SetupGrabini tializes a session for a grab acquisition.
Afterimaq1394SetupGrab, each successive grab copies the last acquired
bufferinto a user buffer where you can perform processing on the image.
Usegrab for high-speed applications where you need processing performed
on only one image at a time. Figure 3-3 illustrates a typical grab
programming order.
Figure3-3. GrabProgramming Flowchart
The Grab1394.c exampledemonstrates how to perform a grab using
imaq1394Grab.The example performs multiple grabs until an appropriate
condition is met. The program configures the session to perform a grab
operation bycalling the imaq1394Grab function.
The program then calculates the area to grabusing the current ROI and
bytesper pixel. In this example, the program allocates a user buffer for
grabbingand passes this buffer to imaq1394Grab. When the acquisition is
complete, it stops. The program then frees the user bufferand al lo f the
resources associatedwith this camera by calling imaq1394Close.
imaq1394CameraOpen
imaq1394CameraOpenopens
andconfigures the camera
accordingto the file set up by
Measurement& Automation Explorer.
imaq1394Graband imaq1394GrabImage
copythe contents of the driver buffer
toa user buffer. You can call imaq1394Grab
andimaq1394GrabImage multiple times
forhigh-speed acquisition.
User-specificimage processing
imaq1394Closecloses the camera and session.
imaq1394SetupGrabconfigures the camera for a
continuousacquisition.
imaq1394SetupGrab
imaq1394Grab
or imaq1394GrabImage
User-SpecificFunctions
imaq1394Close
(Loop)