LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

For loop is not executing proper;ly.

A for loop within a while loop is not reinitializing the iteration value. It is stays pegged at N-1. AT first is was not even excuting and was getting bypassed altogether. I put in a couple of 30ms(and 1000ms) waits within all loops to slow it down. This made the for loop start executing, but now it only executes once.
0 Kudos
Message 1 of 4
(5,026 Views)
Hello,

Can you post your code?
0 Kudos
Message 2 of 4
(5,018 Views)
A For loop can only get "bypassed" if it is told to run zero times by either connecting a numeric constant or control to the "N" ternimal with a value of zero on the upper left corner or by connecting an array with no elements to the border with auto indexing on.

Either of these conditions would cause the For loop to not execute any iterations. This would also cause the iteration value to be zero.

If you have both an auto indexing array and a numeric value connected to the For loop, it will execute the number of times of the lower number.

Without seeing your code, it's hard to guess what might be going on, but this might give you a bit of clue as to where to start looking for the problem.

Ed

Message Edited by Ed Dickens on 02-25-2005 12:26 PM



Ed Dickens - Certified LabVIEW Architect
Lockheed Martin Space
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
Message 3 of 4
(5,007 Views)
Sounds like you are reading the iteration value after the for loop has executed.

Put a two second delay inside your for loop, and wire a numeric indicator inside the for loop to the iteration box.

The iteration value will always stop at N-1, and if you tunnel that value outside of the for loop, all you will get at the tunnel is the last value.

- John
0 Kudos
Message 4 of 4
(4,994 Views)