09-15-2017 02:54 PM
Hello,
I am currently putting together several VIs (to run as sub-VIs) to run in succession in a master VI. The first VI in this series accesses some hardware and then is supposed to disconnect once the VI has completed its run using the 'close all references' and 'close communication'. However, when the program reaches the next sub-VI in the series which requires the same hardware, the VI will not execute because it's hanging up on the hardware. I have tested that VI separately and verified that it works stand alone which leads me to the hardware conclusion. Please advise.
Thanks,
Emma
Solved! Go to Solution.
09-15-2017 08:03 PM
As subVIs, I would move the initialization of communications and instruments to the beginning of your top level VI. Also move the closing to the end of top VI. Then you pass the references to the subVIs for them to use as needed.
09-28-2017 01:16 PM
Good call. Thanks!
09-29-2017 06:56 AM
The other choice is to have each sub-vi as a contained package for any one instrument. Each sub-vi when called, will open, perform an instrument task, then close the instrument each time. This will allow the top level to handle all of the calls, display and data handling. It becomes a question of how often will an instrument be contacted or called and is the instrument a shared resource?