Example Programs

Showing results for 
Search instead for 
Did you mean: 

Wait (ms) and Wait Until Next ms Multiple Explained


Coding that demonstrates how the "Wait (ms)" and "Wait until Next ms Multiple" functions work in a different way.



This VI goes through two common wait VIs in LabVIEW: Wait(ms) and Wait Until Next ms Multiple. There is often a questions of when to use each and what the difference is. Exploring this VI will increase your awareness of the difference of the two functions and how they interact with one another.


There are four cases explored in this VI, and each has a designated tab on the front panel:
0. Wait (ms) - This is the most basic wait function, where the VI will wait a specified number of milliseconds.
1. Wait Until Next ms Multiple - This VI will wait until the system clock has reached a multiple of the specified millisecond amount.
2. Wait & Wait Until - This case explores how the two VIs work when used in parallel. Try this case with different values to see which controls the execution timing.
3. Wait Until Next Explained - This case has a little bit of math that calculates why the Wait Until Next ms Multiple VI waits the amount of time that it does.



LabVIEW 2012 (or compatible)


Steps to Implement or Execute Code
1. Select the tab you would like to run
2. Set the time you would like the functions to wait
3. Run the VI


Additional Information or References


Eric S.
AE Specialist | Global Support
National Instruments
Member LV_learner

Excellent example!   It helps a lot to understand the REAL functions of these two timing blocks. 

Active Participant Broken_Arrow Active Participant
Active Participant

Well done, thanks! 


Member sivarama

Good example and cleared my doubts about these functions

Member sevincom

Really good example with all questions answered

Member ds28

Can any one please tell me, how I can get the specified value to wait(ms) timer as output from it (Supposing 10 is the input to the wait(ms) timer,  how I can 10 in the numeric indicator if I wire it to its output.