High-level grab functions, High-level grab functions -8 – National Instruments Image Acquisition Software User Manual

Page 28

Advertising
background image

Chapter 3

Programming with NI-IMAQ

NI-IMAQ User Manual

3-8

©

National Instruments Corporation

The sample then calls a process function to analyze the image. When the
program is finished, it calls

imgClose

with the interface handle and sets

the freeResources flag to TRUE. This instructs NI-IMAQ to free all of the
resources associated with this interface, which releases the session as well
as the memory buffer allocated by

imgSnap

.

High-Level Grab Functions

A grab is a continuous high-speed acquisition of data to a single buffer in
host memory. Grab functions include

imgGrabSetup

,

imgGrab

and

imgGrabArea

. You can use these functions to perform an acquisition that

loops continually on one buffer. A copy of the acquisition buffer is
obtained by grabbing a copy to a separate buffer. To use these functions,
you must have a valid session handle.

Calling

imgGrabSetup

initializes a session for a grab acquisition.

After

imgGrabSetup

, each successive grab will copy the last acquired

buffer into a user buffer where you can perform processing on the image. A
grab is appropriate 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.

UM.book Page 8 Monday, July 13, 1998 9:49 AM

Advertising