Camera Attributes

NI IMAQ

Camera Attributes

Camera attribute VIs allow you to control camera-specific functions, such as integration time and pixel binning, directly from LabVIEW. You can set them from MAX. Information about specific attributes for some cameras is contained in a camera attribute file <my camera>.txt, which is in the <NI-IMAQ>/Camera Info directory, where <NI-IMAQ> is the location to which NI-IMAQ is installed.

Use the IMAQ Set Camera Attribute VI to set the value of a camera attribute. The camera attribute file lists all attributes for the camera and each attribute description contains four fields: Attribute Name, Description, Data Type, and Possible Values.

Note  Camera attribute files are not available for every camera.

The Attribute Name field contains the name of the attribute in quotes. Wire this field to the Camera Attribute input on IMAQ Set Camera Attribute VI. The Data Type field contains the data type of the attribute which can either be String, Integer, or Float. String indicates that there is a list of possible values which are listed in Possible Values in quotes. To set the value of a string attribute, wire the appropriate string value to Attribute Value on IMAQ Set Camera Attribute.

Note  The spelling and syntax of the Attribute Name and string values must match the camera attribute file exactly.

A data type of Integer indicates that NI-IMAQ converts the string wired to Attribute Value to an integer. Float indicates that NI-IMAQ converts the string wired to Attribute Value to a floating point number. The valid numeric values for integer and float data types are listed in Possible Values. Use Format into String, located on the String subpalette, to convert numerics into strings for use with IMAQ Set Camera Attribute. The following figure shows how to use IMAQ Set Camera Attribute to set the value of a float camera attribute.

Use the IMAQ Get Camera Attribute VI to get the value of a camera attribute. Use MAX to find information about the attributes for your camera. All camera attributes are returned in string format. If the data type of the attribute is integer or float, use the Scan from String function, located on the String subpalette, to convert the string into a numeric. The following figure shows how to use IMAQ Get Camera Attribute with Scan from String to get the value of a float camera attribute.

Many cameras are configured with serial commands. Camera files provided by National Instruments are already programmed with the appropriate camera serial command set. All serial commands set in the camera file are automatically sent to the camera when IMAQ Init is called. If you need more low-level control over the serial communication between the camera and your IMAQ device, use the IMAQ Serial Read and IMAQ Serial Write VIs.

The following figure illustrates how to use the IMAQ Serial VIs.