Chapter3 Programmingwith NI-IMAQ for 1394
©NationalInstruments Corporation 3-3 NI-IMAQfor IEEE-1394 Cameras User Manual
Before you canacquire image data successfully, you must open a camera
with the imaq1394CameraOpenfunction. imaq1394CameraOpen
requiresa camera name and returns a handle to this interface. NI-IMAQ for
1394then uses this handle to reference this camera when using other
NI-IMAQfunctions.
Toestablish a connection to the first IMAQ1394 device in your system, use
the followingprogram example:
SESSION_ID session_ID;
if (imaq1394CameraOpen(“cam0”, &sessionID) == IMG1394_ERR_GOOD)
{
// user code
imaq1394Close(sessionID);
}
Thisexample opens a camera named cam0. When the program isfinished
withthe camera, it closes thecamera using the imaq1394Close function.
Fora complete list of the available camera functions, refer to the NI-IMAQ
forIEEE-1394 Cameras online help.
Camera AttributesUse camera attributes tocontrol camera-specific features such as
brightness and shutter speed directly from NI-IMAQ for 1394. You can
also setcamera attributes through the feature tab in MAX. A llof the
configuredparameters for a camera are stored in a camera (.icd) file. This
file islinked to a specific camera.
The followingattributes 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.
Tomodify these attributes in C or C++, use the imaqSetAttribute and
imaqGetAttributefunctions. If your cameradoes not implem ent every
attributespecified, the functions return an error.