LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

frequency while loop?( with no waiting time )

Hello,

I am using a while loop with no waiting time inside. Could anyone tell me how often does the loop do its iteration in that case?

Thanks a lot,

Marc
0 Kudos
Message 1 of 7
(5,777 Views)
Hello Marc

This depends on different things e.g. CPU, other running programs ...

But try to use the while loop with a waiting-time inside otherwise processor load caused by your program increases highly.

Thomas
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 2 of 7
(5,769 Views)
If you don't put a wait function, the loop will run as fast as it can. If you right click on the i terminal in the bottom left corner of the loop, and select Create>>Indicator from the pop-up menu you'll have an indicator that shows the number of iterations and you'll see the number will get big fast. This isn't a good thing to do, because this way the loop will take all the resources it can get and leave nothing for other programs.

___________________
Try to take over the world!
0 Kudos
Message 3 of 7
(5,767 Views)
Hi tst,

Thanks for your answer. I'll try with a waiting time of 10 mS then.

Marc
0 Kudos
Message 4 of 7
(5,762 Views)
Hi Thomas,

Thanks for answering. I'll try with 10 mS waiting time.

Marc
0 Kudos
Message 5 of 7
(5,758 Views)
It is not well documented, but zero ms wait is valid. Putting a Wait ms function in the loop with the wait value = 0 will cause the internal LV scheduler to check to see if any other node in the program is ready to run (data available at all inputs). If other nodes are ready to run, they will execute. If none are ready, the loop will iterate agin immediately. This is the best way to rapid execution of a loop while allowing parallel parts of the program to execute before the loop finishes.

Lynn
0 Kudos
Message 6 of 7
(5,738 Views)
Hi Lynn,

Thanks a lot for that info, I'll try that too.

Marc
0 Kudos
Message 7 of 7
(5,725 Views)