06-15-2011 08:36 AM
Hi all,
I have 2 VIs which are named "Main" and "Sub". In the "Main" VI, there is a boolean button to open the "Sub" VI. When i press it, "Sub" VI opens. In the "Sub" VI, there is another boolean button to return the "Main" VI. They work well. But when i press "Open Sub VI" button for second time, it does not work.
Anyone have any ideas of how can i can fix this problem?
I have attached the VIs.
Best Regards!
06-15-2011 08:49 AM
Run your main VI in highlight mode and you will see the problem. When you click on the "Main VI" button on the subVI's front panel you are closing its panel, but the subVI is still running. Hence, the main VI is still waiting for the subVI to finish so that it can get the data it depends on. Dataflow programming, not sequential-based programming, which is what you seem to be doing. Thus, you need to stop the subVI's loop on whether the user presses the Stop button or the "Main VI" button.
Code comments: