08-05-2017 09:32 PM
So, for a larger project I would like to be able to programatically open and close a VI through a main VI. Attached to here is not the full project but some example code for you guys to see. In the code I can open the VI through the first one easily enough, but when I try to close the VI through the other VI, it all just locks up. Nothing happens and the CLOSE button stays in a TRUE state even though I've programmed it to return to FALSE in the case structure.
So....I have no idea. I've tried a number of variations of the code and the program never works. When I had this code inserted into my main project, it even returned an Error 1039 code when I tried to close the VI through the main project. So, what do you guys think?
Solved! Go to Solution.
08-05-2017 11:44 PM
Some comments:
Bob Schor
08-05-2017 11:48 PM
You run it with "wait until done" thus the upper case will not complete until the subVI is done. The while loop cannot go to the next iteration until this happens.and the lower case structure can never be reached. Use execution highlighting to see what happens.
(I am sure you are aware of latch action and greedy loops. I guess in the real program there is a lot more code)
08-06-2017 11:46 PM
Yep, that seemed to be the problem. Thanks!