03-11-2010 11:27 PM - edited 03-11-2010 11:30 PM
Your main VI will not continue on its next loop iteration until all code inside of it has completed. That includes the subVI. So your while loop will basically stop until your subVI's while loop is stopped.
This is basic LabVIEW and understanding dataflow.
I would recommend looking at the online LabVIEW tutorials
LabVIEW Introduction Course - Three Hours
LabVIEW Introduction Course - Six Hours
If you want the subVI to run independently of the rest of your code, then you can implement the subVI in a separate while loop parallel to your main VI's while loop. You will want to look at producer/consumer architectures and pass data by way of queues.
Perhaps you should remove the while loop out of the subVI and let its repetition be handled by your main VI's while loop. Do you really want to open and close those VISA resources on every iteration of that subVI's while loop?
You might also want to look at a state machine architecture. Basic states for your VI would be initialization, program shutdown, start test 1, run test 1, end test 1, start test 2, run test 2, end test 2. Also, probably an Idle state where it is waiting for user input to start one test or the other or hit the stop button.