Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

How to autodetect cameras attached to the computer

We have several lab computers with a mixed bag of cameras, some attached using a PCI-1405, another using a CameraLink PCI-1428 and a few GigaE cameras. I'm trying to make a generic control program for use with several of these computers.

Is there an easy way to detect which, and how many cameras that are atteched to one computer (multiple video sources in some of the experiments). Right now I'm doing the "try to initalize, if success a cam is attached".

The 1405 and 1428 appears the same for the program (both called "img0"), is there a way to tell which type I'm attaching to? On the 1428 I'm controlling the shutter/gain, and option that shouldn't be available to the 1405.

Thank you in advance!

0 Kudos
Message 1 of 4
(3,780 Views)

Hi,

I think the best way to do this is to use the IMAQdx Enumerate Cameras.vi in conjunction with the IMAQdx Discover Ethernet Cameras.vi to enumerate the cameras attached to the computer. This will also return detailed information about each connected camera.

Best regards,

Peter Porsman | Applications Engineer | National Instruments
0 Kudos
Message 2 of 4
(3,724 Views)
Hi,

Yes, that is what I am doing for the GigE cameras. But I can't seem to find the same cam-type information for the IMAQ interface (used for our CameraLink and BNC-attached cameras).

My current approach is to requesting one frame during initalization, and then let the program make a "guess" based on hardcoded imagetype/image_size for the cameras I have. This avoids the LabVIEW crash that happens if I try to change shutter or gain of a BNC attached camera, as if it was a CameraLink (both type framegrabbers are driven using the IMAQ interface, I can not tell the difference any other way)

Of course, this method will not work if I attach a random "unknown" camera to the program.

(However, this "grap-one-frame" initalization does filter out the GigE problem I usually have, where the GigaE camera is initalized ok, the grab has been started ok, but the program fails with a timeout when a frame is requested.).



0 Kudos
Message 3 of 4
(3,704 Views)
Hi,
 
Unfortunately, this is not possible with CameraLink or BNC cameras, but you could check the c:\program files\National instruments\NI-IMAQ\data directory for .iid files. They would contain information about currently connected CameraLink or BNC cameras.
 
Best regards,
Peter Porsman | Applications Engineer | National Instruments
0 Kudos
Message 4 of 4
(3,699 Views)