Setting 1394 Camera Attributes Using Visual Studio .NET 2003/2005 Primary Software: Driver Software>>NI-IMAQ for IEEE-1394Primary Software Version: 2.1 Primary Software Fixed Version: N/A Secondary Software: Measurement Studio>>Visual C++ Support Hardware: Image Acquisition (IMAQ)
Problem: How do I programmatically set 1394 camera attributes using Visual Studio .NET 2003/2005? Solution: 1394 cameras can set attribute values in a couple of different ways in what are known as attribute modes. You can select from a list of supported modes, including Absolute, Auto, Off, One Push, Relative, and Ignore. To find out which modes are supported by your camera you can consult the camera's user manual or go to Measurement and Automation Explorer » NI-IMAQ Devices » [IMAQ device] » [camera] and click on the tab "Camera Attributes". Here you will be able to click on each attribute and see which modes are available to use. You can also programmatically determine the available modes for a certain attribute by using the i Visual C++ Example:
Parameter Discussion: Attribute specifies the attribute whose value you want to set. In LabWindows/CVI, when you click the control a dialog box opens containing a hierarchical list of the available attributes. Attributes whose values cannot be obtained are dimmed. Help text is shown for each attribute. Select an attribute by double-clicking it or by selecting it and then pressing Enter. If the attribute shown in this ring control has named constants as valid values, you can bring up a list of them by moving to the Attribute Value control and pressing value shown in the bottom half of the Attribute Value control, the corresponding constant is marked in the displayed list. If the specified attribute is a camera attribute, the user may set one of the following values: • IMG1394_AUTOMODE: Allows the camera to always control the selected camera attribute. • IMG1394_ONEPUSHMODE: Allows the camera to control the selected camera attribute once, and then return to the manual control state with adjusted values. • IMG1394_OFFMODE: Disables the selected camera attribute. • IMG1394_ABSOLUTEMODE: Sets the selected camera attribute to use 32-bit floating-point numbers that map to real-world units. In this mode, the driver refers to the absolute camera attribute for the control value. • IMG1394_IGNOREMODE: Prevents the driver from writing the selected camera attribute to the camera. Return Value: On success, this function returns IMG1394_ERR_GOOD. On failure, this function returns an error code. You can obtain a more detailed error message with imaq1394ShowError or, if you are using Microsoft Visual Basic, imaq1394ShowErrorCW. imaq1394SetAttribute function twice. Once to put the attribute in the right mode and then again to set the value. The value is then either an unsigned long passed by value for relative mode or a double passed by reference for absolute mode.Related Links: Product Manuals: NI-IMAQ for IEEE 1394 Cameras User Manual Developer Zone Tutorial: Acquiring from Firewire Cameras using National Instruments NI-IMAQ for IEEE 1394 Attachments:
Report Date: 11/16/2006 Last Updated: 12/20/2006 Document ID: 43FILNP6 |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
