LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

When debugging, a for loop is not entered even though the number 6 is passed to "N".

I cannot figure out why a for loop is not entered when I debug it. When debugging a value of 6 is clearly passed to "N", the number of iterations the loop is supposed to execute. So when I debug, execution highlighting just parses right over the loop, even though I request to enter the loop. Everything inside of the loop is not executed. Have you experienced this before? - Any ideas?
0 Kudos
Message 1 of 3
(2,629 Views)
Look at any arrays that you have coming into the for loop. If they are auto indexed and they are null, it will do this. Right click on the input and select disable indexing.
Message 2 of 3
(2,629 Views)
As mentioned by "eh" auto-indexed arrays that are empty will cause this.

A "FOR loop" will itereate as many times as is indicated by the smallest number elements in any of its auto-indexed inputs.

When you watch it in execution-highlighting, you probably will see a "0" coming in on an auto-indexed input.

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 3 of 3
(2,629 Views)