cancel
Showing results for 
Search instead for 
Did you mean: 

"Terminating while loop"

Highlighted
DonTan
Member

"Terminating while loop"

Hi,

I am currently writing a Labview program which sometimes requires the termination of the labview program before the program completes its execution.

Is there any way to achieve this programmatically instead of manually using the abort button provided by labview.

Your assistance in the above will be greatly appreciated.
4 REPLIES 4
Matt_R
NI Employee (retired)

Re: "Terminating while loop"

Message contains an attachment
There is a VI called "Stop" located in the Application Control Functions pallette. You can call this programmatically, and it causes the same behavior as the abort button.
Greg_McKaskle2
Trusted Enthusiast

Re: "Terminating while loop"

> Is there any way to achieve this programmatically instead of manually
> using the abort button provided by labview.
>

There is both an Abort/Stop and a Quit/Exit node on the palettes. You
might try to use the Search button on the palettes to look for it.

Greg McKaskle
shaf
Member

Re: "Terminating while loop"

I had a similar problem. In my makros I often have a while loop covering the user buttons. When any of these is depressed I exit the while loop and go into a sequence. However, if at any point during the sequence the user presses the CANCEL button on my front panel or there is a fault response from the controller I require the sequence to exit without further execution.

The only way I have found to do this is to put a case statement in each frame of the sequence with a TF input reading the cancel button and the fault Boolean.

Has anyone got a better solution? I do not want the VI to exit just to stop running the sequence until the user selects another button.

Shaf
LucaP.
Active Participant

Re: "Terminating while loop"

You can replace the sequence structure with the help of a case structure inside a while loop. Than connect the iteration terminal of the loop to the selector terminal. This will have the same behaviour as a sequence structure. But you have one big advantage: The case structure can pass data to end the while loop during any case.

Hope this helps

Luca
Regards,
Luca