LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LV 5.11 Question for the old timers

For reasons I won't get into here I am using LV 5.11 for this test.
 
I have a couple arrays that are being initialized properly but not being updated and return to their uninitialized (grayed out) state when the program runs . (Min-Remain and Current State)
 
Running the trace I see that the main for loop is not being executed.
 
I don't think I have ever ran into this before.
 
Any ideas?


Message Edited by RTSLVU on 12-06-2007 11:55 AM
========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 1 of 5
(2,920 Views)

A FOR loop iterates as many times as...

  • The smallest number of (1) the value wired to N and (2) the size of the smallest autoindexing input array.

You have an autoindexing tunnel containing an empty array (from the unititialized shift register!), thus the iteration count will be zero. 🙂

 

It's not really a question for old timers. This behaves the same even in 8.5 and is correct and expected. 😄



Message Edited by altenbach on 12-06-2007 10:10 AM
0 Kudos
Message 2 of 5
(2,912 Views)
You've got one unitialized shift register so this array will be empty and the for loop will not execute. When you use the auto-indexing feature of a for loop, it will iterate for a count equal to the size of the smallest array. Zero elements in an array equal zero iterations of a for loop. It makes no difference whether you do or do not have a number wired to the count terminal of the for loop.
0 Kudos
Message 3 of 5
(2,904 Views)

Thanks guys, I just noticed that myself too.

But shouldn't the for loop have operated correctly if I wired a constant to it's loop count terminal?



Message Edited by RTSLVU on 12-06-2007 12:28 PM
========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 4 of 5
(2,898 Views)


RTSLVU wrote:
But shouldn't the for loop have operated correctly if I wired a constant to it's loop count terminal?

It already IS operating correctly! As I said in my post, the smallest value determines the iteration count. 😄
0 Kudos
Message 5 of 5
(2,891 Views)