From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
11-07-2012 08:18 AM
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.
11-07-2012 08:38 AM
@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.
11-07-2012 08:58 AM - edited 11-07-2012 08:59 AM
Oh Lord!
Do you mean you are pressing the "Abort" button in the ribbon bar? (I shook the magic 8-ball it said "it is very likely")
Do not do that! (Stoping your vi with the abort button is like stoping your car with a tree. It will stop but, there may be consequences.)
Abort instantly ends the LabVIEW RTE so all executing VIs are killed at the point and in the state they are currently in. (zero clean-up) You really need to exit your vi's with some condition.
11-07-2012 09:14 AM
@JÞB wrote:
Oh Lord!
Do you mean you are pressing the "Abort" button in the ribbon bar? (I shook the magic 8-ball it said "it is very likely")
Do not do that! (Stoping your vi with the abort button is like stoping your car with a tree. It will stop but, there may be consequences.)
Abort instantly ends the LabVIEW RTE so all executing VIs are killed at the point and in the state they are currently in. (zero clean-up) You really need to exit your vi's with some condition.
Sorry for being that blunt, but right now I feel it's necessary: I'm not an idiot... With "stop button" I meant the control which one can place on the front panel!
11-07-2012 09:21 AM
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?
11-07-2012 09:27 AM
I believe you have a while loop in the 2nd sub vi you mentioned and also I am not sure if you have a while loop in the main vi. In your 2nd sub vi create a stop button of your own and wire it to the stop terminal of the loop then use a while loop in the main vi. So now you have your main vi running continously which means once your 2nd sub vi is done your 1st sub vi again starts running. This is what you want right?
11-07-2012 09:30 AM
Do you mean something like a simple state machine?
11-07-2012 09:41 AM
Oh.. Yeah.. 🙂
11-07-2012 09:41 AM
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?
11-07-2012 09:42 AM
Launch you sub VIs with: Start Asynchronous Call