Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Document Type: Example Program
NI Supported: Yes
Publish Date: Sep 6, 2006

Changing Camera Configuration Programmatically

4 ratings | 4.00 out of 5
Print

Downloads

Filename: 2127.vi
Requirements: View

Filename: 2128.vi
Requirements: View

Filename: set_acq_window_lv70.vi
Requirements: View

Filename: get_directory_path_lv60.vi
Requirements: View

Filename: scale_and_center_image_lv70.llb
Requirements: View

Filename: get_camera_info_lv60.vi
Requirements: View

The following examples ship with NI-IMAQ:

LabVIEW:
National Instruments\LabVIEW\examples\IMAQ\IMAQ High Level.llb
- HL Analog Attributes.vi

CVI:
National Instruments\MeasurementStudio\CVI\samples\IMAQ\Display
- Analog Attributes.prj

The following examples illustrate additional functionality with changing camera configuration programatically.

The first example changes the camera file associated with an interface file (*.iid- img0 for example). This can also be accomplished by saving a camera file and interface file for each configuration you need. This can be done through MAX. The benefit of this approach is that once you have imgA associated with a camera file and imgB associated with another camera file, then all you have to do in the program is close the session to imgA and open a session to imgB. Another approach is to change the interface (*.iid) file programmatically. The first example allows you to specify an interface file (img0.iid, img1.iid, ..., depending on interface name of the given device) and programmatically change channel 0 of the camera file. With this program, you can change the camera file without opening Measurement & Automation Explorer (MAX). This VI opens the appropriate .iid file, searches the string for channel 0, and replaces the string of data that represents the camera file.

The second example modifies the camera file (*.icd). When you change camera attributes programatically, the changes are not permanent and the attributes will reset to their original values when you open the camera file again. This example illustrates how you could make permanent changes to camera files so the changes remain after the session closes.

The third example gets the name, manufacturer and model of the camera associated with the interface.

The fourth example gets the path to the directory where the camera files are located. This could be useful to programmatically copy a camera file to this location.

The fifth example changes the acquisition Region of Interest (ROI) so the image is centered and scaled given user input values.

The sixth example sets the acquisition window size, ROI, Look-Up Table, and image invert properties programmatically.

Related Links:
Camera File Knowledge Base

Requirements


Filename: 2127.vi

Software Requirements


Application Software: LabVIEW Full Development System 6.0
Language(s): C, LabVIEW

Hardware Requirements


Hardware Group: Vision (IMAQ)
Driver: NI-IMAQ 2.5.3

 
Filename: 2128.vi

Software Requirements


Application Software: LabVIEW Base Development System 6.1
Language(s): C, LabVIEW

Hardware Requirements


Hardware Group: Vision (IMAQ)
Driver: NI-IMAQ 2.6

 
Filename: set_acq_window_lv70.vi

Software Requirements


Application Software: LabVIEW Base Development System 7.0
Language(s): LabVIEW, C

Hardware Requirements


Hardware Group: Vision (IMAQ)
Driver: NI-IMAQ 2.6

 
Filename: get_directory_path_lv60.vi

Software Requirements


Application Software: LabVIEW Professional Development System 6.0
Language(s): C, LabVIEW

Hardware Requirements


Hardware Group: Vision (IMAQ)
Driver: NI-IMAQ 2.6

 
Filename: scale_and_center_image_lv70.llb

Software Requirements


Application Software: LabVIEW Base Development System 7.0
Language(s): C, LabVIEW

Hardware Requirements


Hardware Group: Vision (IMAQ)
Driver: NI-IMAQ 2.6

 
Filename: get_camera_info_lv60.vi

Software Requirements


Application Software: LabVIEW Base Development System 6.1
Language(s): C, LabVIEW

Hardware Requirements


Hardware Group: Vision (IMAQ)
Driver: NI-IMAQ 2.6

 
4 ratings | 4.00 out of 5
Print

Reader Comments | Submit a comment »

 

Legal
This example program (this "program") was developed by a National Instruments ("NI") Applications Engineer. Although technical support of this program may be made available by National Instruments, this program may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this program with each new revision of related products and drivers. THIS EXAMPLE PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).