Wait (ms) Function

Owning Palette: Timing VIs and Functions

Requires: Base Development System

Waits the specified number of milliseconds and returns the value of the millisecond timer. (Windows) The actual wait time may be up to 1 ms shorter than the requested wait time.

This function makes asynchronous system calls, but the nodes on the block diagram execute synchronously. Therefore, this function does not complete execution until the specified time has elapsed.

Details  

 Add to the block diagram  Find on the palette
milliseconds to wait specifies the number of milliseconds to wait. This function does not wait longer than 0x7ffffff or 2,147,483,647 ms or about 25 days. To wait for a longer period, execute the function multiple times or use the High Resolution Polling Wait function. Wiring a value of 0 to this parameter forces the current thread to yield control of the CPU.
millisecond timer value returns the value of the millisecond timer after the wait.

Wait (ms) Details

When LabVIEW calls a VI for example, if millisecond timer value is 112 ms and milliseconds to wait is 10 ms, the VI finishes when millisecond timer value is greater than or equal to 122 ms.

Use the Wait For Front Panel Activity function to eliminate the need for continually polling the front panel to determine if the value of a front panel object changes.

Timer resolution is system dependent and might be less accurate than one millisecond, depending on your platform. Use the Wait Until Next ms Multiple function or the High Resolution Polling Wait VI to improve resolution.

Note  The Wait (ms) function behaves differently on Windows and the LabVIEW Real-Time Module. (Windows) The Wait (ms) function waits at least the value specified by the following formula: milliseconds to wait minus 1 ms. For example, if milliseconds to wait is 3 ms, the Wait (ms) function waits at least 2 ms. If milliseconds to wait is 1 ms, the Wait (ms) function may return without waiting at all. (Real-Time Module) The Wait (ms) function waits at least the value specified in the milliseconds to wait input.