From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple camera Image acquisition in Labview

Hi,

 

I am writing a general purpose template application that must acquire images simultaneously from multiple cameras in LabVIEW using IMAQdx. For maximum flexibility, I would like the number of cameras to be configurable by the user at run time. Previously when I have used multiple cameras I have effectively used parallel while loops to acquire the images, but obviously this is impractical if the maximum number of cameras is not fixed. 

I have used  event structures and the  “Frame Done” event, and it would seem that if I could register the “Frame Done” event from multiple IMAQdx sessions in a single Event Registration Reference, this would be an elegant way of doing this. Is this possible?

 

Any thoughts and suggestions regarding a suitable architecture would be greatly appreciated.

 

Thanks!

Mike

0 Kudos
Message 1 of 8
(5,840 Views)
There are two basic approaches I can suggest:

One way is to have a fixed set of worker threads (loops), regardless of number of cameras, and they each work on some subset of the cameras by iterating through the ones they each operate on.

A more flexible approach is to use VI server and execute VIs asynchronously for each camera. You can interact with he running VIs from your main loop by polling controls and indicators on the Vis. This is much more similar to dynamically spawned threads in other languages.

Eric
0 Kudos
Message 2 of 8
(5,829 Views)

Thanks for the advice Eric.

 

Your first suggestioh is what I was thinking of, but is it possible to use a single event structure to handle Frame Done events from multiple session? 

 

Mike

0 Kudos
Message 3 of 8
(5,809 Views)

Hi Mike,

 

is it possible to use a single event structure to handle Frame Done events from multiple session? 

You can create and use your own user event and even name it FrameDone if you like. Just define User Event and Generate this event right after getting an image in your parallel for loop. But I wouldn't definitely recommend you do this because cameras can have different frame rates and are often controlled by a trigger. 

 

I would suggest you follow Eric's advice and use a parallel task for each camera. You can take a look at Actor Framework as it simplifies running and stopping concurent tasks at run-time.

 

Nikita.

Nikita Prorekhin
CLA
0 Kudos
Message 4 of 8
(4,748 Views)

there is a small trick to do this 
open your cams with imaqdx but use flat sequence for selected port also reed cam mode from information icon and attach it to both of cam property node 
then both of cam will be open and work parallel

0 Kudos
Message 5 of 8
(4,736 Views)

Hello everyone,
I want to design a machine vision system for connecting cables diameter of between 2mm and 5mm and I want to know what type of camera the most appropriate to solve this problem.
The criteria to check are crimping depth on the cables and distances.

thanks

0 Kudos
Message 6 of 8
(4,622 Views)

Hi nouva,

 

In order to gain more visiblity in the Community for your question I would recommend creating a new thread. Also, since this thread is not related to your question it would be better to have it in a separate thread.

 

Have a great day!

 

Kale W.

0 Kudos
Message 7 of 8
(4,597 Views)
answer is easy but as nikale told you have to make new topic for that
0 Kudos
Message 8 of 8
(4,527 Views)