LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Repeat a loop a number of times, but permit the user to override this limitation (so the loop can run infinitely)

Solved!
Go to solution

I need to run a loop a number of times defined by the user. But the user will have as well the possibility to run the loop infinitely. I thought of using a While loop with some logic between its counter of loop iteration and the loop condition. I was wondering if there is any other easier possibility (perhaps with the for loop).

Thanks for your help. 

0 Kudos
Message 1 of 3
(2,261 Views)
Solution
Accepted by topic author teach74

FOR loops are lazy.  They can only run for so long.  Your best bet would to to use the iteration terminal and do the comparison.


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
Message 2 of 3
(2,255 Views)
Solution
Accepted by topic author teach74

Yes, WHILE loop all the way.

 

"Infinitely" is a very long time! 😄 Note that the iteration terminal is I32 and will saturate at one point (stuck at 2147483647). If you need it to continue, you might want do make your own, incrementing a 64bit integer in a shift register, for example. Make sure you don't autoindex at any output tunnels, or you'll run out of memory.

Message 3 of 3
(2,228 Views)