From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
i have a "for" loop that contains an operation that produces a true value when the output is a specific number. i used a flat sequence to perform the operation and a constant of 10 for the "for" loop iteration. My probem is that when i get to interation three, this produces the boolean to go to true and i want to exit the "for" loop instead of going through the rest of the iterations. is there a way to exit the loop when this goes true. for this particular application i need a for loop and can't use a while loop. thank you
attached is a sample vi that gets the jist of what i am doing.
Yes there is no break and continue inside of a for loop unlike many other languages. This is most likley due to breaking the dataflow model. 2 choices esist
1. while loop with a counter (i>=itteration max) stop ORed with your additional stop condition (stop is true)
2. Use a for loop but place the code inside of a case structure (less efficient since the loops will continue to spin eventhough there is no code to execute)