LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

dynamically run multiple VIs and return values

Dear Experts:

 

I would like to dynamically run 8 VIs from a main VI that esentially do the exact same thing.  The only thing that is different is the data passed to the VIs and the data returned.  The VI has a loop that can possible run for ever and each of the 8 loops can be started at different points in time.  I figure I would use a functional global to pass controls to the VI (loop).  I am not sure how I will get data from each loop.  I can't use a functional global for this because there is no sequencial timing. The number 8 might change so I can't just make 8 loops in main.

 

I would like to be a little more clear.  How do you return individual data from a VI that has been dynamically launched 8 times at different points in time?

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

I would use a queue.  The main VI should have a loop just for processing data from the queue.


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
0 Kudos
Message 2 of 6
(2,057 Views)

I recommend reading the recent LabVIEW Field Journal articles on "Maintaining State Information"

 

This article talks about VI server: http://labviewjournal.com/2012/05/maintaining-state-3/#more-312

 

 

>

"There is a God shaped vacuum in the heart of every man which cannot be filled by any created thing, but only by God, the Creator, made known through Jesus." - Blaise Pascal
0 Kudos
Message 3 of 6
(2,056 Views)

Thanks for the response guys.  I like the queue idea.  So how would you know what clone brought back data (what queue entry belonged to what clone)?

0 Kudos
Message 4 of 6
(2,046 Views)

The data type of the queue needs to be a cluster.  One element being an ID of some sort (this ID should be passed into the subVI) and another element being the actual data.


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
0 Kudos
Message 5 of 6
(2,041 Views)

This is what I was thinking but I just wanted to check with you.  Cool.  Great idea.  Thanks.

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