03-28-2016 08:01 PM
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.
03-28-2016 08:34 PM
08-07-2019 02:03 PM
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.
08-07-2019 02:04 PM
What SysAPI? Windows?
08-07-2019 02:07 PM