LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

resetting the for loop counter

I would like to know how to reset the loop counter in a For loop after it hits the maximum amount of iteration.

0 Kudos
Message 1 of 5
(7,622 Views)

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 

----------------------------------------------------------------------------------------------------------------------------
"If anyone needs me, I'll be in the Angry Dome!"


0 Kudos
Message 2 of 5
(7,613 Views)

put it in a while loop, for loop repeats until some condition is reached

Please remember to accept any solutions and give kudos, Thanks


LV 8.6.1, LV2010,LV2011SP1, FPGA, Win7
Message 3 of 5
(7,607 Views)

Yes that is essentially what I am trying to say.

0 Kudos
Message 4 of 5
(7,606 Views)

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

0 Kudos
Message 5 of 5
(7,016 Views)