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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

When a while loop is run how can the iteration value be saved so it can be used as some input value the next time the loop is run?

When a while loop is run how can the iteration value be saved so it can be used as some input value the next time the loop is run?

0 Kudos
Message 1 of 6
(2,815 Views)

Shift registers.  Put a shift register on your outer loop as well as the inner loop.

0 Kudos
Message 2 of 6
(2,809 Views)

 

Thank you for your reply. But can you elaborate by giving an example in the form of a vi.

 

Thanks

0 Kudos
Message 3 of 6
(2,768 Views)

The iteration terminal always starts at zero with every new run, so you need to make your own.

As Ravens already said, create shift registers in the inner and outer loop and connect them all. Initialize outside with zero and add a "+1" in the innermost loop. See how far you get.

0 Kudos
Message 4 of 6
(2,756 Views)

@gates123 wrote:

Is this what you are saying?


Yes, that looks about right. If you want the inner loop to also start with zero on the indicator (like any normal loop!), wire the indicator before the increment function.

0 Kudos
Message 6 of 6
(2,707 Views)