LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

For loop doesn't run

Hi,

 

I'm having a problem in my program that I can't understand why happen.

The program don't run the for loop, that's in the picture.

As you can see, if you run the program, the boolean "FOR TESTE" never turns on.

 

Thanks for your help,

Sílvia

Download All
0 Kudos
Message 1 of 10
(3,848 Views)

One of your incoming arrays that are auto-indexed is empty.

0 Kudos
Message 2 of 10
(3,846 Views)

Thanks for your prompt help.

Which one of the arrays are empty? The values in the "Input read" came from the DAQmx.
If the for have an input array with 3 values and another with 1 value, this can happen?

 

Best regards,

Sílvia

0 Kudos
Message 3 of 10
(3,841 Views)

You have numerous input arrays.  It is difficult to tell which are in and which are out because you only have a portion of the VI in your image, and some of those are entering through the top and bottom of the loop.  The loop will run the number of times equal to the shortest array.  If you actually had an array with 3 elements and an array with 1, it would run 1 time.  But you have more arrays than that, and one must be empty.  Put probes or indicators on the arrays that enter your loop and to figure out which one it is.

Message 4 of 10
(3,839 Views)

The begin of the problem is here, where I initialize the variables that come into the loop from the bottom.

Before the "Array aux" was empty, I correct that but now the for only run one time.

Another doubt is why I can initialize the "Array aux" as a 3D array.

 

Best regards,

Sílvia

0 Kudos
Message 5 of 10
(3,832 Views)

@sreis wrote:

The begin of the problem is here, where I initialize the variables that come into the loop from the bottom.

Before the "Array aux" was empty, I correct that but now the for only run one time.

 

If it only runs one time, then one of your arrays has only 1 element.

 

Another doubt is why I can initialize the "Array aux" as a 3D array.

Is this a question?  If so, what is your question?

 

 

Best regards,

Sílvia


 


 

0 Kudos
Message 6 of 10
(3,829 Views)

The "Array aux" is a 3D array, I initialize the lines, the columns, but I can't initialize the pages..

How can I do that?

0 Kudos
Message 7 of 10
(3,825 Views)

Change the 3rd index and you'll see the other pages.

 

But a better choice is to use the Initialize Array primitive assuming you want all of the elements initialized to the same value.

0 Kudos
Message 8 of 10
(3,822 Views)

What's the "Initialize Array primitive"? Where I find that?

The program it's working.

 

Many thanks,

Sílvia

0 Kudos
Message 9 of 10
(3,815 Views)

A primitive is just a native LabVIEW function such as add, divide, etc. Under the array pallette there is a function to initialize an array.

=====================
LabVIEW 2012


0 Kudos
Message 10 of 10
(3,799 Views)