LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reinitializing iteration terminal of while/for loops

How does one reinitialize (to ZERO) the iteration terminal of while/for loops. I am reading elements from an array (placed within the while loop) and using the iteration terminal of the while loop to increment the array. I would like to make this a repetitive process (reading elements from an array), and therefore will need to reset the count of the iteration terminal back to zero once all the elements from the array are read. Will appreciate if someone can provide valuable insights on resolving this issue. Thanks!
0 Kudos
Message 1 of 2
(2,702 Views)

There is no way to alter the value coming out of the iteration terminal on a loop, but you should be able to accomplish what you need with the Quotient and Remainder function...just wire the iteration terminal in, and the max count in, and use the remainder output...so after the iteration count passes your max value, the remainder will start return values of 0, 1, 2, etc. again.

And if that doesn't quite do it for you, just use a shift register on the loop border and increment its value or reset it to zero depending on whatever condition you need.

Hope this helps,
-D

Message 2 of 2
(2,697 Views)