LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

For Loop Inside A For Loop

Solved!
Go to solution

Capture.PNGIs it possible to execute all the iterations of the inside for loop for each iteration of the outside for loop? I have attached a screenshot of my program if it helps. If it is possible could you tell me how to do it plz?

0 Kudos
Message 1 of 9
(4,502 Views)

What do you mean by "all the iterations"?  The way you wrote it, it'll execute the inner For loop "Section Number" times for each zero to "MAX L".

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 2 of 9
(4,492 Views)

I have 30 sections and the max L is 40. I want to get sum of the 30 sections for each 0-40 L and then to plot all the sums. The program doesnt work. It gives me nothing. 

0 Kudos
Message 3 of 9
(4,475 Views)

What do you mean by "nothing"?  The values are 0?  The outputs do not show anything?


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 9
(4,460 Views)

Yes the outputs do not show anything.  There is something wrong with it but i cant find the problem. Could you help?

 

0 Kudos
Message 5 of 9
(4,443 Views)

Activate highlight execution and retain values and you might be able to spot what goes wrong. E.g. if the array is empty it will calculate 0 times.

Else it'll be alot easier to help you if you post the VI with some typical values set as Default values.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 6 of 9
(4,435 Views)
Solution
Accepted by topic author dimos94

One thought I have is that I think you want those feedback nodes reinitializing for each iteration of the outter loop.  Personally, I would change them to be shift registers (it would clean up your diagram a little bit).


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 7 of 9
(4,425 Views)

Ok. I attcached the VI. My system has 300 sections. The formula node provides me the power of each section. With the inner loop I get the power for all the sections. The sum is the power of all the sections together. One of the input values in the formula node is the "L". I want the program to calculate all the power sums for all the "L" different values.

0 Kudos
Message 8 of 9
(4,421 Views)

crossrulz your suggestion worked. Thx a lot.

0 Kudos
Message 9 of 9
(4,402 Views)