LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Clarification re: For Loop within a For loop

Solved!
Go to solution

Hello,

 

I have an inner For Loop that collects data points using a machine, which iterates "Number of Points + 1" times and an outer loop that iterates 10 times to repeat the whole data collection 10 times (please see attached image for reference). Does this mean that the inner For Loop is what gets executed first before the outer For Loop?

0 Kudos
Message 1 of 4
(106 Views)
Solution
Accepted by solarfacility_user

Yes. Any structure cannot continues until all components have finished. In this case, the inner loop. If you wrap it as a sub-vi, would you have the same question? 🙂

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

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 2 of 4
(97 Views)

Hi user,

 


@solarfacility_user wrote:

Does this mean that the inner For Loop is what gets executed first before the outer For Loop?


Please speak out loud "THINK DATAFLOW!" whenever you have a question about "what executes first, what comes next"…

 

(It really helps to get reminded on this very basic mantra of LabVIEW from time to time.)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 4
(92 Views)

LabVIEW data flow can be summed up in two sentences:

  • A node will not execute until all inputs are satisfied.
  • A node will not produce an output until the node has executed completely.

If you apply this in the most literal sense that you can, you'll be able to solve 99% of your dataflow questions.

 

Edit:  Structures such as FOR loops, qualify as nodes.

 

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 4 of 4
(40 Views)