Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

programatically rename cameras

I'm working on a setup routine for a set of 12 cameras. I acccess these cameras on a system by name (cam01... cam11), and it would be great if I could programtically rename the cameras in my setup VI. However, I ahve not had any sucess using the Rename alias VI found in the ni system configuration VIs. Can this be done? Since I have to set up many testers, doing the renaming manually in MAX is tedious and slow.

 

 

_____________
Creator of the BundleMagic plugin for LabVIEW!
0 Kudos
Message 1 of 5
(4,165 Views)
What version of Vision Acquisition do you have installed? The rename SysAPI function is what the right-click->rename function in MAX uses, so it should work.
0 Kudos
Message 2 of 5
(4,157 Views)

My solution works as follows:

1. Enumerate all connected cameras.

2. Filter cameras by the Model Name, so that I am only working with a subset of the cameras I can see. I use  an array of strings containing the Model Names I want to work with.

3. If the camera passes the filter, I use the interface name to find the iid file in C:\Users\Public\Documents\National Instruments\NI-IMAQdx\Data, Open this files, and read the contents.

Using String Search and Replace, I find the string in brackets {InterfaceName = "[interface_name]"}, and modify [interface_name] with my new name for that camera.

4. I Close and Delete the iid file, and Create/Replace a new iid file using the new interface name [interface_name].iid

5. I write the modified iid file contents to this new file, and close it.

 

The only downside to this method is that in order for the Enumerate Cameras.vi to see the new interface names, the application must be restarted. I have not found a way around this yet. If anyone reading this has a solution for this, please do tell.

Machine Vision, Robotics, Embedded Systems, Surveillance

www.movimed.com - Custom Imaging Solutions
0 Kudos
Message 3 of 5
(2,524 Views)

What SysAPI? Windows?

Machine Vision, Robotics, Embedded Systems, Surveillance

www.movimed.com - Custom Imaging Solutions
0 Kudos
Message 4 of 5
(2,520 Views)