
Chapter 3 Programming with NI-IMAQ
NI-IMAQ User Manual 3-4
©
National Instruments Corporation
This example opens an interface to img0 and then creates a session to
acquire images. When the program is finished with the interface and
session, it then closes both handles using the imgClose function.
For a complete list of the available session functions, refer to the NI-IMAQ
Function Reference Manual.
Managing BuffersBuffer management can be performed either by you or automatically by
NI-IMAQ. If the high-level acquisition routines (imgSnap, imgGrab,
imgSequenceSetup, and imgRingSetup) are initiated with NULL
pointers for buffer addresses, NI-IMAQ will automatically allocate a buffer
and return the value of the buffer pointer to you. After you have a buffer
pointer, you can use this pointer in successive calls.
For greater control of the acquisition buffers, such as creating buffers larger
than the image size for adding borders, you can create them by calling a
memory allocation routine (for example, malloc) or using the low-level
function imgCreateBuffer. When creating buffers using either approach,
dispose of the buffers using free or imgDisposeBuffer when applicable
to free PC memory for maximum performance.
Camera AttributesThe camera attributes allow you to control camera functions, such as
integration time and pixel binning, directly from NI-IMAQ. These camera
attributes are camera-specific and can also be set in the IMAQ
Configuration Utility on the Advanced tab. Information about specific
attributes for your camera is contained in <my camera>.txt, which can
be found in the ni-imaq/camera info directory. For more information
about camera attributes and their uses, please consult your camera
documentation.
Note Currently, camera attributes are supported only by the IMAQ PCI-1424.
The camera attribute file lists all attributes for the camera. Each attribute
description contains four fields—Attribute Name, Description,
DataType, and Possible Values. The Attribute Name field contains the
name of the attribute in quotes. The DataType field contains the data type
of the attribute—String, Integer, or Float. String indicates that there are
several valid values for this attribute that are expressed as strings. The list
of valid values is indicated in Possible Values. Integer indicates that the
UM.book Page 4 Monday, July 13, 1998 9:49 AM