Academic Hardware Products (myDAQ, myRIO)

cancel
Showing results for 
Search instead for 
Did you mean: 

Why While Loop has a "Wait Until Next ms Multiple" inside?

 
0 Kudos
Message 1 of 2
(6,867 Views)
The timer inside a While loop is used to free CPU resources when they are not needed.
If you run a while loop without any sort of timing, this would use all the CPU time and it will try to run as fast as possible, never allowing other processes to take up CPU resources. This is very undesirable since it may become really hard to just interact with a button on the Front Panel when a While loop is running free.
If you put a timer in it, the code inside the loop will execute. The execution will take some time to complete. Since there is a timer in there, the next iteration will start after a certain amount of time, thus allowing other processes to access the CPU.

These are concepts that are very well explained during a LabVIEW Basics 1 Course.

You can also refer to this Knowledge Base for more details

Regards,

AlessioD
National Instruments
0 Kudos
Message 2 of 2
(6,859 Views)