LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Calling multiple identical subVIs that have an embedded while loop

This was originally posted on the vision board, but I have moved it here after a suggestion.

 

I have up to now always coded labview in a fairly linear manner.  My applications typically involve one thing happening, then the next, then the next.  However, I now want to do something a bit different, or at least try.

 

The purpose of the VI is to monitor a spinning wheel with a video camera.  Some times we monitor one wheel, sometimes we monitor up to 12 wheels, each with its own camera.

 

I have a parent VI that sets up the parameters for testing (number of wheels, Camera number for each wheel etc).  It then call a subvi that loads the camera settings,and proceeds to 'watch' the spinning wheel and make some machine vision measurements based on the images.  This proceeds for 10 minutes, then the VI does some final calculations and closes and 'passes' the measurement data back to the parent VI.  If there is more than one wheel, it then calls the same VI with the parameters for the next wheel.

 

What I want to do is have the parent VI call many copies of my same subvi at the same time, so that multiple wheels are being monitored at the same time, not one after the other.  I can't figure out how best to do this.  To date I have not used global variables, or libraries in Labview, maybe these would make my problem easier.  When I have needed more than one camera at a time, I have opened and closed them in the same VI; however, in this case I could need as many as 12, making the code really ugly.  

 

I could pull all the timing out of the subvi and move it to the parent VI.  I would also need tomove the open and close camera portion of the subvi to the parent vi.  But this approach will make my code really ugly (which isn't the best to begin with!).   So I am looking for ways to approach the problem..

Cheers,

Andre

0 Kudos
Message 1 of 3
(2,700 Views)

This Nugget has code that demonstrates how to launch multiple instance of a single template. You tell it how many ...

 

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 2 of 3
(2,667 Views)

Hi AZimmer,

 

Here's a simple community example that you may also find helpful.

 

Aaron P

National Instruments

Applications Engineer

http://www.ni.com/support

0 Kudos
Message 3 of 3
(2,643 Views)