Is an interesting discussion on the need for a reliable wait routine. A general concensus exists that an "ideal" general purpose wait would meet the following specifications:
Include "error in (no error)" and "error out" for data flow.
Take no action when error in is true.
Exit correctly regardless of the system millisecond timer's current value.
Since LabVIEW version 5.1 (or earlier) NI-DAQ has encluded "Wait +(mS).vi." This vi meets only the requirement to include the error cluster and has been noted to fail the other requirements. Several years ago I had the unfortunate, and rare, occurance where the Wait +(mS).vi was called just prior to a millisecond timer rollover. Since the 33rd bit of a I32 was never set the vi never returned. I've had some version of this vi in my reuse library ever since. It does meet the three criteria listed above- at some CPU usage cost (Although I've made some attempt to optimze the cost.)
After several more years, and a large handfull of clients, the source for CCI Delay.vi has undergone some further improvements.
The FP has been given a bit of a silver update
Execution priority settings have had a few tweaks and the vi is now inlined
The "Seconds" input is now a DBL (with appropriate resolution limiting code)
to re-iterate key points on the code:
LabVIEW Shipping delay funtions have no Standard Error functionality. i.e. it still waits with an error in = TRUE. This is often undesirable when rolling up an error to the handler.
If Built in function are called during a ms timer rollover the routine never returns. Nasty and insidious.
I avoid the U32 limit on the max wait limit
This routine behaves the same on Windows and RT.
Last it adds support for seconds as dbl floored to mSecs.
From the help on Wait (ms)"Note The Wait (ms) function behaves differently on Windows and the LabVIEW Real-Time Module. On Windows, the Wait (ms) function waits up to the value specified in the milliseconds to wait input. On the RT Module, the Wait (ms) function waits at least the value specified in the milliseconds to wait input. The Wait (ms) function has a margin of error of plus or minus one millisecond.
Delay.vi is not obsoleted by Stall Dataflow.vim available in 2017 which adds support for all datatypes including “Green” clusters ( any cluster of <Bool, I32, String> ) but is an alternate to Stall Dataflow.vim where Standard Error Functionallity is desired
"Should be" isn't "Is" -Jay
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.