07-16-2009 09:32 AM
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
07-16-2009 09:48 AM
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".
Blog for (mostly LabVIEW) programmers: Tips And Tricks
07-16-2009 09:49 AM
07-16-2009 09:49 AM
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
07-16-2009 09:49 AM
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
07-16-2009 05:03 PM
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
07-16-2009 05:13 PM - edited 07-16-2009 05:14 PM
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.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
07-17-2009 07:16 AM
07-17-2009 07:55 AM
Three perfect answers in the same time! ![]()
Only Steve beat them by whisker. ![]()