01-09-2007 04:58 PM
01-09-2007 05:20 PM
It depends on timing. If you place all subvi's in one loop, and have data dependency between the subvi's (like Error Out of one going to Error In of another), they will execute one at a time. The next data collection won't happen until all subvi's have executed once. You could put them all in one loop and not connect wires from one to the other, and then they will all execute in parallel. But one subvi that is faster than another would collect its data and would have to wait until the slowest vi is done before the next loop iteration tells it to collect again. If you put each subvi in its own loop, they would each run in parallel, and the fastest one would not have to wait for the slowest one to finish.
So it depends on timing. Whichever method you choose, be sure to put a delay in each loop (even 1mS) to give the CPU time to process other functions.
01-09-2007 05:37 PM
Thanks Tbob
In that case, since there are no dependencies btwn the subVIs, I will place them all in one big while loop so that I can wire the output of each subVI to a "write data to file" subVI that will run at the while loop rate.
This brings me to another question:
Will LabVIEW allow me to call the same subVI multiple (to access different instruments) inside of the while loop? In other words, if the data collection is happening in parallel, will I be able to use multiple instances of the same subVI simultaneously?
Thanks again.
01-09-2007 06:21 PM
01-09-2007 06:26 PM - edited 01-09-2007 06:26 PM
"Will LabVIEW allow me to call ...multiple instances of the same subVI simultaneously?"
Depends....
Is the subVI re-entrant?*
Are all of the VI's called by the subVI re-entrant?
Does the subVI show its Front Panel?**
If using VISA are you up to date on driver verions?***
If you clear all of the above you are on your way. ![]()
Have fun,
Ben
*A re-entrant VI will allow simultaneous execution by creating unique data spaces for each instance of the subVI.
**Prior to LV8, LV would allow the viewing of one intsance of a re-entrant VI and that required double-clicking on the instance you wanted to view. ![]()
***In GPIB applications that used multiple devices would occationally force LV to execute as single threaded. ![]()
Has been fixed since about LV8.
Message Edited by Ben on 01-09-2007 06:27 PM
01-09-2007 06:30 PM
Thanks guys,
I will make the particular subVI reentrant and see how it goes.