Chapter 3 Programming with NI-IMAQ for 1394
© National Instruments Corporation 3-3 NI-IMAQ for IEEE-1394 Cameras User Manual
Before you can acquire image data successfully, you must open a camera
with the
imaq1394CameraOpen
function.
imaq1394CameraOpen
requires a camera name and returns a handle to this interface. NI-IMAQ for
1394 then uses this handle to reference this camera when using other
NI-IMAQ functions.
To establish a connection to the first IMAQ1394 device inyour system, use
the following program example:
SESSION_ID session_ID;
if (imaq1394CameraOpen(“cam0”, &sessionID) == IMG1394_ERR_GOOD)
{
// user code
imaq1394Close(sessionID);
}
This example opens a camera named
cam0
. When the program is finished
with the camera, it closes the camera using the
imaq1394Close
function.
For a complete list of the available camera functions, refer to the NI-IMAQ
for IEEE-1394 Cameras online help.
Camera Attributes
Use camera attributes to control camera-specific features such as
brightness and shutter speed directly from NI-IMAQ for 1394. You can
also set camera attributes through the feature tab in MAX. All of the
configured parameters for a camera are stored in a camera (
.icd
) file. This
file is linked to a specific camera.
The following attributes are defined in the IEEE-1394 Based Digital
Camera Specification—Brightness, Auto_Exposure, Sharpness,
White_Balance, Hue, Saturation, Gamma, Shutter, Gain, Iris, Focus,
Temperature, Zoom, Pan, Tilt, and Optical Filter.
To modify these attributes in C or C++, use the
imaqSetAttribute
and
imaqGetAttribute
functions. If your camera does not implement every
attribute specified, the functions return an error.