LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

running several subvis in parallel

Hi,

I would like to create a vi where I can run several instances of the same subvi in parallel. This subvi is used to decode a bit stream for a nihsdio device. There are 16 channels on the device. Each instance of this subvi can only decode one channel. I would like to wire to a case structure the number of channels that a acquring data. The number of instances of the subvi that will run will be dependent on this number. If four channels are  acquiring data, then I will have 4 instances of the subvi in that case structure. For 16 channels, I will have 16 instances of the subvi. The block diagram can become very crowded in this case. Is there a better technique for coding something like this?

Thank you,

Tim
0 Kudos
Message 1 of 4
(2,437 Views)
If you save your subvi as a VI template, you can use VI server to spawn as many copies of it as you need.  At least this is what I do in LV7.1.  You just need to use some method to differentiate the data you get from each of the spawned copies.
 
Hope this helps,
Jon 
0 Kudos
Message 2 of 4
(2,428 Views)
Do you have some magic computer with 16 CPUs? Does the subVI store intermediary results between calls for each instance?
 
If the answer is no to the above two questions, just use it in a FOR loop and loop through the channels sequentially.
 
Please provide more details of the application.
Message 3 of 4
(2,415 Views)
Hi,

Thanks for your response. I am just using a FOR loop now. The vi does not store intermediate results between each instance, nor do I have a computer with 16 cpus.


0 Kudos
Message 4 of 4
(2,407 Views)