03-29-2011 03:10 AM
Hi,
I got a question with for loop and while loop.
When an empty array constant (zero element) is connected to For Loop with "enabling index", there are no any interations executed in For Loop. But, If the For Loop is replaced with While loop, no problem.
LabVIEW 2010
Solved! Go to Solution.
03-29-2011 03:20 AM
Hi,
It's ok. I don't see any problem.
For the "For loop" when you connect the Array with Indexation the number of Iteration is set to the size of the Array. The Iteration number assigned to N (in your case 10) is ignored.
For the "While Loop" the number of Iteration is set by the Boolean Condition and the size of Array is ignored.
Paul
03-29-2011 03:21 AM - edited 03-29-2011 03:24 AM
Hi weitong,
please go through LabVIEW-Basics and the context help to learn about AutoIndexing behaviour:
A FOR loop iterates the maximum number of (size of autoindexing arrays) and (number wired to N)! In your case this will result in zero = max(size of empty array; 10)!
03-29-2011 05:06 AM - edited 03-29-2011 05:07 AM
@GerdW wrote:
Hi weitong,
please go through LabVIEW-Basics and the context help to learn about AutoIndexing behaviour:
A FOR loop iterates the maximum number of (size of autoindexing arrays) and (number wired to N)! In your case this will result in zero = max(size of empty array; 10)!
The maximum??? DOn't you mean the MINIMUM?
If the number of elements in array =2
and N terminal is wired to 5
"I think" it will execute only 2 times
03-29-2011 06:06 AM