LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

"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.
0 Kudos
Message 1 of 5
(3,140 Views)
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.
0 Kudos
Message 2 of 5
(3,140 Views)
> 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
0 Kudos
Message 3 of 5
(3,140 Views)
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
0 Kudos
Message 4 of 5
(3,140 Views)
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
0 Kudos
Message 5 of 5
(3,140 Views)