LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

detect when a for loop has finished

Solved!
Go to solution

I want to be able to turn on a led when a for loop has finished, I wired an array to the for loop, so I don't know how many times it will iterate, because I wired an array, which comes from all files in the recursive file list. Can someone please help me figure this out?

0 Kudos
Message 1 of 6
(3,631 Views)

Think dataflow, simply have your LED write depend on data passed from the loop (an error wire for instance).

Matt J | National Instruments | CLA
0 Kudos
Message 2 of 6
(3,620 Views)
Can you please give me a pic showing this?
0 Kudos
Message 3 of 6
(3,617 Views)
Solution
Accepted by topic author Nando88

Don't worry about the last function, it's just a placeholder. The idea is that it won't execute until the for loop has finished because it is waiting on information from the error wire.

Dataflow.PNG

Matt J | National Instruments | CLA
Message 4 of 6
(3,610 Views)

Hello nando

 

 I attached you a pic, we are comparing the iteration terminal, and if it becomes greater than 0, we will have a True as output

0 Kudos
Message 5 of 6
(3,525 Views)

@KIKEV89 wrote:

Hello nando

 

 I attached you a pic, we are comparing the iteration terminal, and if it becomes greater than 0, we will have a True as output


And suppose the loop runs exactly 1 time?  Then the i value will be finished at 0, it is not greater than 0.  The boolean won't light even though the loop is done running.

0 Kudos
Message 6 of 6
(3,516 Views)