LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

exit a sequence mid way

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

?

0 Kudos
Message 1 of 7
(3,925 Views)

@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.

0 Kudos
Message 2 of 7
(3,923 Views)

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.

0 Kudos
Message 3 of 7
(3,900 Views)

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.

0 Kudos
Message 4 of 7
(3,886 Views)

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.

0 Kudos
Message 5 of 7
(3,867 Views)

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

0 Kudos
Message 6 of 7
(3,849 Views)

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).


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 7 of 7
(3,788 Views)