04-07-2017 12:43 PM - edited 04-07-2017 12:47 PM
So this is an interesting behavior. I pulled this code out of a larger vi I am using. The two dimensional array appears to be empty, but the for loop that is auto-indexing on this array executes 106 times. Curious if anyone can duplicate this on their machine.
I am using LabVIEW 2014 on a Win7 OS.
Solved! Go to Solution.
04-07-2017 12:59 PM
That is expected.
The control has a 100 X 0 array saved in it.
This will do the same thing.
The loop is indexing on the first index.
Ben
04-07-2017 01:04 PM
@Ben wrote:
That is expected.
The control has a 100 X 0 array saved in it.
How can you tell?
04-07-2017 01:05 PM
Watch it with the light bulb on.
Sit down, wrap your head with duct tape and check out this thread.
Ben
04-07-2017 01:22 PM
Whooa! Thanks for the link.
Not sure I would call this expected behavior. A for loop iterating on an empty array seems counter intuitive to me.
04-07-2017 01:26 PM
If you read that thread you will see that I was of the same opinion when I first encountered an empty array with a non-zero dimension.
Reader Digest summary....
Hidden in array wires are I32's that hold the size of the arrays. For loops use that dimension infor to control loop iteration counts. With an array of size "100 X 0 " the "100" controls how many time the For loop iterates.
Read that thread for more insight.
Ben