LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to break out of a sequence structure

Solved!
Go to solution
Is there a way to break out of sequence structure?
0 Kudos
Message 1 of 6
(8,290 Views)
Solution
Accepted by topic author aderogba
No. That is one of the reasons that sequence structures are often frowned upon. Far better to rewrite the code to be a state machine.
Message 2 of 6
(8,282 Views)
Hello, I am just a beginner in labview.. May be this is not the solution to your question but i'm simply posting what i did in my project a couple of months before2234.PNG..Smiley Very Happy
Message 3 of 6
(8,258 Views)

What was suggested above technically will work but the whole point that Dennis was trying to make is that you shouldn't write your program in this way. LabVIEW is a dataflow language, not a sequential language. Take the time to actually learn the techniques associated with dataflow programming and use them. It is a VERY powerful programming paradigm. Sequence frames should be used very sparingly and only for very specific reasons. Generally they should only be used for sequences that will always run the complete sequence and where no data flow exists. The perfect example is the technique used to time a block of code. A three frame sequence is used with a Get Time in the first and last frames and the code you want to time in the middle frame. A single frame sequence is often used to impose article dataflow. Other than that try to avoid using sequence frames. Do yourself, and anyone who may need to maintain your code later on, and learn dataflow programaming.

 

Also, the above example is not very good code since it is using multiple local variables. In general local and global variables should be avoided since they also break the dataflow programming paradigm and can lead to race conditions in your code.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Message 4 of 6
(8,246 Views)
Thanks for the feedbacks; I will re-wrtie my code.
Message 5 of 6
(8,209 Views)

Hello Mark,

 

                I read what you have written and accept it. Thank you for your advice. I will try to learn the data flow programming and deliver better results.

 

Regards,

 

Nitzy 

Message 6 of 6
(8,179 Views)