11-29-2013 04:18 AM
Hi All,
This question must been there before, but I cannot find a suitable answer here on the forums....
I have a 'top-level' VI that does a lot of things. I also have a sub VI that runs a frequency sweep on a piece of equipment. This is done with a for loop.
Problem:
I want to monitor/access the data that is generated in the for loop (See attached, the 3 wires within the green circle I want to monitor).
2 Questions:
How can I access the data on the wires (within the loop) from a higher level VI?
How can I then run this VI in a higher level VI while the higher level VI is continuing and not waiting for the sub-VI to complete?
I tried using a Que but I cannot seem to get that working.
Any suggestions?
Regards,
11-29-2013 09:51 AM
The queue is a good way to move data from a running subVI to another VI. Your problem is that if the subVI is inside a loop in the main VI, that loop in the main VI cannot iterate until the subVI completes. The solution: have the sub VI running in parallel - not inside - the loop.
Look at the Producer/Consumer Design Patterns (at File >> New... >> VI >> From Template >> Frameworks >> Design Patterns >> Producer/Consumer. This may be more than you need at the moment but will show how the parallel code process works.
Lynn