LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

error message and stop

Hi, All
 
In a sequence function, I need to stop executing the VI when i receive a special erroe message and if not , it will carry on the next time sequence.
 
I wan to know how to stop the program when i received the error message.
 
thanks
 
 
0 Kudos
Message 1 of 3
(2,609 Views)
Hello srt:
 
You can unbundle the error cluster then set the element to "code".
Then wire it to an "equal" function then to the loop condition of a while loop.
 
I hope this helps.  Please advice if you have any more questions.
 
0 Kudos
Message 2 of 3
(2,599 Views)
Hi srt
 
I assume that you are talking about the sequence structure. If you have let's say 4 sequence frames containing vis, which are connected through the error cluster. Now let's say that the vi in frame 2 generates an error, then the remaining vis will still execute (maybe just the most necessary operations but not all), which will cause your main vi to still execute for a certain time after the error occured.
 
If you want a better control, use a state machine and use the status-value of each vi's error out cluster to control the surrounding loop, in addition to the simple stop button. In this situation the vi executes without any problems, but will stop immediately after the error generating vi terminated.
 
Hope this helps.
 
Thomas
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 3 of 3
(2,597 Views)