LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

In our program, we are concerned about reducing CPU work; how to wait until a boolean condition changes in a "while loop"?

Is there a way to wait until a boolean condition changes (instruction is sent) in a "while loop" (because I want the program run until I press exit button)? Now it is consuming a lot of CPU because it is running the loop very fast waiting for instructions unless I stop the program.

Thank you.
0 Kudos
Message 1 of 4
(2,779 Views)
If you don't have a small wait function inside of your while loop, put one in and watch your CPU usage drop way down.
Message 2 of 4
(2,779 Views)
A Wait of about 100 ms is more than what you need to monitor the WHILE loop.
0 Kudos
Message 3 of 4
(2,779 Views)
Use /functions/time and dialog/wait until next millisecond multiple in the
loop. Input 100ms.

"mcdesm" wrote in message
news:506500000008000000EC200000-991728092000@quiq.com...
> In our program, we are concerned about reducing CPU work; how to wait
> until a boolean condition changes in a "while loop"?
>
> Is there a way to wait until a boolean condition changes (instruction
> is sent) in a "while loop" (because I want the program run until I
> press exit button)? Now it is consuming a lot of CPU because it is
> running the loop very fast waiting for instructions unless I stop the
> program.
>
> Thank you.
0 Kudos
Message 4 of 4
(2,779 Views)