LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Data not leaving FOR LOOP

Hi everyone,

 

I'm trying to create a program that would fit some PNG images of lasers beams. At each iteration of the FOR loop, I would select a new image, extract the data I need from it and then plot the data from each of these images in the same graph. But I can't understand why the data is not leaving the for loop.

 

Can someone please help me?

 

The VI and the image I'm trying to use to test it are attached. 

Thanks,

Yuri


 

Download All
0 Kudos
Message 1 of 8
(2,899 Views)

Because you have the two while loops in side your For Loop, you have a user interface annoyance where the user has to keep hitting the two boolean buttons for it to proceed through the For Loop iteration.  Then do it again on the next iteration, then the next, ....

 

Once you've gone through all of that, then the For Loop will pass the data out to the XY graph

0 Kudos
Message 2 of 8
(2,893 Views)

Thanks for the repply RavensFan

 

But actually the two while loops are intentional. I need it so I can change the PNG image at each iteration of the for loop.

 

If you try the highlight execution, even after you press the buttons so the information leave the two while loops, when it gets out of the last piece of the sequence it gets stuck there. The information doesn't get out of the for loop and then the next iteration starts.

0 Kudos
Message 3 of 8
(2,835 Views)

Hey Yuri94,

 

that's the expected behaviour of the for loop. The "data" exits the for loop when all iterations are finished.

0 Kudos
Message 4 of 8
(2,822 Views)

Yuri94 wrote:The information doesn't get out of the for loop and then the next iteration starts.

Yeah, that's the way data flow works.  The data will not exit the FOR loop until the loop is complete.


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 5 of 8
(2,817 Views)

Oh! I thought it would leave at each iteration! Thanks guys!

But do you know any way way it could leave one at a time? Not that it makes any difference for doing what I need, but just out of curiosity...

0 Kudos
Message 6 of 8
(2,804 Views)

Put the indicator inside the For Loop, and build the array inside so that the indicator updates on each iteration.

0 Kudos
Message 7 of 8
(2,802 Views)

Ok, that's easy! Hahahaha. Thank you all.

0 Kudos
Message 8 of 8
(2,798 Views)