Reading Device ID for Cameras Programmatically in LabVIEW

Updated Jun 24, 2021

Reported In

Driver

  • NI-IMAQdx

Issue Details

My system has multiple cameras connected to it, and each one needs to perform a different task. In order to tell them apart, I would like to read the Serial Number of each camera programmatically. When I try to use an IMAQ Property Node to read the Serial number, however, I get a number that does not match what is printed on the camera.
 
How can I read the Serial Number of my camera from LabVIEW?

Solution

For some cameras, the Serial Number is called a Device ID. In order to read the Device ID, you can implement the following code:

1b.PNG

It could also be that you need to modify the attribute entry here. If the above doesn't work for you, try replacing that string with the following: CameraAttributes::DeviceControl::DeviceID
 

Additional Information

The Device ID will come in as a string, and can be converted to a different datatype as needed.