Programmatically Changing the Camera File for an IMAQ/IMAQdx Interface

Updated Oct 17, 2022

Reported In

Hardware

  • PCIe-1433

Software

  • DevSuite Image and Vision Acquisition

Driver

  • NI-IMAQ
  • NI-IMAQdx

Operating System

  • Windows

Programming Language

  • LabVIEW G

Issue Details

I would like to programmatically change the camera file associated with my IMAQ/IMAQdx interface. How can I do this?

Solution

The current camera file that shows up next to the Channel under Measurement & Automation Explorer (MAX) is actually set by lines in the interface file (.iid) for your specific interface. If your interface name is img0, then this file will be named img0.iid and will be located at <Users>\Public\Documents\National Instruments\NI-IMAQdx\Data (for Windows XP and older, the directory is <Documents and Settings>\All Users\Documents\National Instruments\NI-IMAQ\data)

In this file, there is a line for each channel followed by the name of the camera file (.icd) used by that channel. These camera files are contained in the same directory as the interface file (see path above).
Untitled picture.png
Note: If the camera file (.icd) is not located at the same path as the .iid file, you will need to either move it to the same path or use the full .icd path for the CameraFile argument. 

You can parse the camera file as a text file and replace the portion of text in the quotation marks following the respective channel with the name and file extension of the new file to use. See Change Camera File Programmatically for an example of how to programmatically change your camera file.

Additional Information

Changing the InterfaceName will not change the camera name in NI MAX. The camera alias in NI MAX is set by the name of the .iid file.