08-10-2012 10:10 AM
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?
08-10-2012 10:17 AM
I would use a queue. The main VI should have a loop just for processing data from the queue.
08-10-2012 10:19 AM
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
08-10-2012 10:43 AM
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)?
08-10-2012 10:51 AM
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.
08-10-2012 10:53 AM
This is what I was thinking but I just wanted to check with you. Cool. Great idea. Thanks.