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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Abruptly stop a program without stopping LabVIEW

I am running a multiple nested loop program where, if something goes wrong in the test, I can stop the entire test. So, where ever the program is at, I want to be able to stop the test without stopping labview.

Thanks alot!
0 Kudos
Message 1 of 5
(2,937 Views)
Is this for debugging purposes? If so labview 7.0 and later has conditional probes which can pause a program (break) if conditions are as specified on the probe. If you are not debugging loops should be stopped using logic, it is probably not the best Idea to us a "break" statement such as ones provided in languages like C++. Using unconditional jumps without logic behind them make programs difficult to read and verify. Anyway the conditional probes are a very nice tool for debugging and I recomend them (besides they are free).

-Paul
Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 2 of 5
(2,930 Views)
I want to incorporate this into a full application. This program is made to run a series of tests on a product. Each test is within another loop or case structure. These various tests are in one major while loop. If this product fails at any test, I want the entire test to stop.. There is a stop vi, but that stops labview, not the test.
0 Kudos
Message 3 of 5
(2,929 Views)
Use a queue to pass the Stop message to all the loops. If I have state machines that may take some time to shut down in a orderly manner, I use pairs of queues (Command and Status). The first sends the Stop command to the appropriate loops/state machines. As each machine shuts down it sends a Halted message back on the status queue, either in the Halt state of the state machine or just after exiting the loop. When all lower level loops have Halted, the upper level loop executes its Halt state and quits. This allows as much versatility as you may need for orderly terminations without leaving parts of the system in unknown states (whhich can make restarting tricky). Each loop must check the command queue on each iteration to detect the presence of the Stop command in a timely manner.

Lymm
0 Kudos
Message 4 of 5
(2,915 Views)
Greg,

You could also use a Local Variable to monitor a hault command. The local variable could be tied into the conditional terminal on all loops. The value would always be false (depending on logic) unless something happened in a loop that was cause for hault. A true could then be written to the local variable which in turn would be read by all operating while loops.

Just another idea,

-Brett
0 Kudos
Message 5 of 5
(2,892 Views)