LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

new labview user question.

Solved!
Go to solution

how do I restart a feedback loop inside a for loop that is inside another loop?

 

example:  I want to run my outermost for loop two times.

                  I also want to run the second for loop, which is inside the first, three times.

                    Inside this second for loop is a feedback loop that starts at 1 and adds 2 to it each time the second loop runs: 1, 3, 5

                 

My question is how do I  make it so that the feed back loop will restart at 1 when the outer for loop reinterates?

 

so tha I get 1,3,5 for the first run of the outer for loop and 1, 3, 5 again for the second run.  Right now I am getting 1, 3, 5 for the first run and then 7, 9, 11 for the second run.

 

Thank You all

0 Kudos
Message 1 of 3
(2,314 Views)
Solution
Accepted by topic author Hai An

Please attach an example and tell us your LabVIEW version.

 

If you have a recent labVIEW version, you can just move the initializer terminal to any of the stacked loops surrounding it. Then initialize it there.

If you have an older LabVIEW version, you might need a little bit more code, e.g. another shift register. Nothing serious, though. 😉

Message Edited by altenbach on 06-06-2009 12:23 PM
Message 2 of 3
(2,313 Views)

Thank you, that helped.  I had a newer version so your solution worked.

 

Thanks again

0 Kudos
Message 3 of 3
(2,289 Views)