LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

go out from stack sequence when there is an error

Hi All,

 

I have a small code that used to do the simple testing. I used all stack sequence to control the equipment sequencely. What I want to do is if there is an error (either failed to control equipment or any error that can occur) in any sequence, the code will make it go out rather than loop thru all the sequence then go out, is it possible to do this kind of feature ? I do try to using the event to raise the error but it failed cos I have no idea how to do it.Anybody please help.

 

Thanks 

0 Kudos
Message 1 of 9
(4,649 Views)

What you want instead of a sequence is a CASE structure inside a WHILE loop, with the ITERATION count "i" tied to the CASE selector.

 

 See attached pic.

Every frame gets a chance to abort the "sequence". 

 

Picture 1.png

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

Message 2 of 9
(4,639 Views)
This question comes up a lot. The short (and only answer) is no. Use a state machine instead.
Message 3 of 9
(4,638 Views)

Hi williamle...,

i recommend to change your sequence to a statemachine (while loop with case structure). You can then stop the loop from every case.

 

Mike

Message 4 of 9
(4,637 Views)

Using sequence structures makes this impossible. This is one of the major reasons not to use sequence structures........

Switch to a state machine (available as design pattern in the template browser) in order to implement such a feature.

 

hope this helps,

Norbert 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 5 of 9
(4,636 Views)

Hi All,

I do see your point, and I agreed this is one of the good method instead. But the problem is there are too

many VI (about 20++ maybe more than that) that using the stack sequence, if modify 1 by 1,it will took some time to change, is this there is any method  to do rather change all to state machine ? if can, I don't 

want to change to much those sub VI, but when worse come to worse, still I still will change to the state machine. 

 

Thanks

0 Kudos
Message 6 of 9
(4,602 Views)

But the problem is there are too many VI (about 20++

 

Are you running 20 different test sequences ?  Or 20 instances of the same test?

 

If it's the same test, or even a similar test, then make it a subVI, feed it parameters to customize it, and be done.

 

If they're really that different, then the mistake was to write 20 different test sequences without handling errors.

 

If that's the case, I know of no way to automatically replace the things. 

Message Edited by CoastalMaineBird on 07-16-2009 05:14 PM
Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

Message 7 of 9
(4,599 Views)
You can right click on a stacked sequence structure and replace it with a case statement.  Sequence locals will get blown away and you'll end up with a few broken wires but code in each frame will be preserved.
Message 8 of 9
(4,569 Views)

Three perfect answers in the same time! Smiley Happy

 

Only Steve beat them by whisker. Smiley Wink

- Partha ( CLD until Oct 2027 🙂 )
0 Kudos
Message 9 of 9
(4,558 Views)