01-04-2015 10:15 AM
I have a sequence about 4 frames long and could take up to 10 or 20 seconds to execute. How do I exit it if a condition outside the sequence is changed
?
01-04-2015 10:21 AM
@hurricaneh wrote:
I have a sequence about 4 frames long and could take up to 10 or 20 seconds to execute. How do I exit it if a condition outside the sequence is changed
?
I suppose you can use a case structure inside each frame.
However, this is NOT the way to be programming LabVIEW.
Think state machine.
01-04-2015 12:03 PM
This is one of the reasons you shouldn't use the sequence structure except for a very few situations.
You either want to be using a state machine, if the code is advanced enough it needs mulitple frames, or just remove the sequence structure and use wiring to enforce data flow. Using either of these options, it becomes trivial to stop your execution somewhere in the middle.
01-04-2015 02:04 PM
Thanks. I'm only a student and learning this first time. I thought there was a way to do it but its ok as the lecturer wants us to use sequence structures for it.
01-04-2015 03:36 PM
You have a terrible lecturer if this is something they're asking you to do. It's bad design. Do you have the assignment that we can read or was it spoken in class? What is the entire assignment?
You can do things to make it look like the sequence stopped. Anything you do is going to be strange coding.
01-04-2015 04:19 PM
I thought about posting a comment like that but decided to allow for the possiblity that the assignment was intentional. The intent being to demonstrate the difficulty of using a sequence structure for such situations.
The question about a condition changing outside the sequence may make it significantly more difficult to do well.
Without the exact details of the assignment we cannot even make general comments.
Notice that in LV 2014 the sequence structure has been removed from its historic location in the Programming Structures palette, making it less likely to be used because it is "conveniently available."
Lynn
01-05-2015 06:38 AM
johnsold wrote:
Notice that in LV 2014 the sequence structure has been removed from its historic location in the Programming Structures palette, making it less likely to be used because it is "conveniently available."
Only the Stacked Sequence Structure was removed from the palettes. The Flat Sequence Structure is still there (since there are the occasional needs for it).