03-06-2012 05:50 AM
I would like to know how to reset the loop counter in a For loop after it hits the maximum amount of iteration.
03-06-2012 06:14 AM - edited 03-06-2012 06:15 AM
Hi,
When the For loop reaches its maximum iteration count (defined by the number wired to "N" in the top left corner) it will exit the loop.
When the loop is run again the loop counter ("i" in the blue box) will be reset to 0.
Is this what you meant?
-CC
03-06-2012 06:18 AM
put it in a while loop, for loop repeats until some condition is reached
03-06-2012 06:19 AM
Yes that is essentially what I am trying to say.
07-15-2014 12:39 PM - edited 07-15-2014 12:40 PM
@kevin_khan wrote:
Yes that is essentially what I am trying to say.
What are you trying to say? (it is not clear which post you are replying to).
What do you mean by "reset"? The loop counter always starts at zero whenever the FOR loop starts.
If you have an indicator connected to it inside the loop, and you want to zero it before the loop is called the next time, you can use a local variable.
We can typically give much more detailed advice if you would attach a simplified code example. Please do so. Thanks!