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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Run any number of re-entrant VI's

Solved!
Go to solution

Hi,

 

I'm trying to create a VI that will concurrently run any number of re-entrant subVI's. After looking at many examples, the one that best replicates the behaviour I want is found at \examples\general\Reentrant Panels.llb\Reentrant Panels.vi.

 

My problem is that this example only runs up to two subVI's. How would I change this behaviour so I could run as many as I wanted? For loops don't seem to work because the first subVI must be stopped before the next will be run, and I need them to run concurrently. Here are a couple methods I've tried (all using for loops):

 

Multiple Re-Entrant SubVI's.JPG

 

I've also attached the Labview example in case you don't have it.

I haven't yet found any examples or posts that achieve this behaviour, and I'm fairly new to this area of Labview, if you could point me in the right direction it would be much appreciated!

0 Kudos
Message 1 of 6
(2,300 Views)

You might want to have a look at the Asynchronous Call By Reference.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 6
(2,282 Views)

What LabVIEW version do you have? If you configure the FOR loop for parallelism,  iterations can can run concurrently, up to the number of parallel instances configured.

Message 3 of 6
(2,280 Views)
Solution
Accepted by lauraalkhoury

Method 2 should work fine.  It should spawn new subvi's every time it is called.  

 

reentrant.PNG

This method calls the following and it spawns 3 new subvi's every time it is called.

reentrant2.PNG

Message 4 of 6
(2,277 Views)

@ altenbach Parallel processing would be ideal, but this VI will be much larger eventually, running on machines with potentially only one processor. For the record I'm using LV 2011 Professional.

0 Kudos
Message 5 of 6
(2,206 Views)

@lauraalkhoury wrote:

@ altenbach Parallel processing would be ideal, but this VI will be much larger eventually, running on machines with potentially only one processor. For the record I'm using LV 2011 Professional.


You still get parallel instances, even if you are only running on one CPU, so the end effect should be similar.

(of course the number of parallel instances is limited to 64).

0 Kudos
Message 6 of 6
(2,200 Views)