11-07-2012 09:47 AM
@LordSnow wrote:
Both SubVIs are in the main VI's while loop. Is it possible that this is why it is not working as intended, that terminating a VI within a while loop causes the while loop to terminate as well
No, only two things can cause a while loop to stop: the conditional terminal's stop condition is met, an abort is sent to the application instance the while loop is running in. Check your logic in main vi
11-07-2012 10:05 AM
You really need to show some code. Even a scaled down version to show the architecture would help. Otherwise, we are totally shooting in the dark.
11-07-2012 10:16 AM
@LordSnow wrote:
P@Anand wrote:
@LordSnow wrote:
Hi,
I have a VI with two SubVIs which are being executed sequently, with the second SubVI waiting for an user event in the first SubVI. The SubVI front panels are open and used as the user interface when they are executed. When I push the stop button on the second SubVI's front panel, I do not want the whole VI to stop, but only that SubVI and execute the first SubVI once again.
Does anyone have any idea how to achieve that?
Thanks,
LordSnow.
I am bit confused of what you try to achive. How you are executing your sub vi's if you can attach your ode it would be easy to see what you are trying to do.
Regretfully, I can't upload my code. Therefore, I will try to be more precise in my description. I open the main VI and execute it. This opens and executes the first SubVI, which waits for the user to interact with the front panel. Once this interaction has taken place, the second SubVI is executed which includes pretty much all the code there is. When I did everything I wanted to do in this second SubVI I push the previously mentioned stop button in order to stop that SubVI and that SubVI only, but right now all the VIs stop. My intention is to open the first SubVI again after I stopped the second SubVI.
Does that help?
I'm confused. Why can't this be implemented by just putting the two sequential sub-vis (presumed wired that way through data flow) in a while loop with the second sub-vi having its own event structure that exits when the stop button is pressed?
11-07-2012 03:10 PM
@LordSnow wrote:
I have a while loop both in the second SubVI and in the main VI. Both loops have terminals which are not interdependently wired, therefore I thought that the while loop in the main VI would continue to run even if I terminate the while loop in the second SubVI. Apparently, I was wrong, because the whole program stops when I push the stop button.Both SubVIs are in the main VI's while loop. Is it possible that this is why it is not working as intended, that terminating a VI within a while loop causes the while loop to terminate as well?
Yout main vi doesn't loop, you have some error in the loop condition there.
/Y