LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

wait function waiting double the normal time

When using either the "Wait (ms)" or "Wait Until Next ms Multiple" functions on most machines with the interval set to 1 ms, the function actually waits 2 ms. However, when using our simulator system (which was set up by my predessessor), both functions only wait 1 ms. The simulator PC is 4-5 years old and work correctly, but all the newer PCs take twice as long.

I suspect that there is some kind of configuration setting somewhere within Windows that he set in order to get the time to work correctly, but I have no idea what it could be, and neither does anyone else that I have talked to.

Does anyone have any ideas?
0 Kudos
Message 1 of 3
(2,152 Views)
How do you know it's actually taking twice as long? Are you using the millisecond timer to time it? If so, don't bother, as you won't get the accuracy you need. On my system I set up a simple test case and the millisecond timer would sometimes say 1, mostly 2, sometimes 16. For that level of accuracy you can't rely on the "regular" timer, as its resolution is only 1 millisecond, and that's a best-case scenario since you're dealing with a non-real-time operating system. Plus, newer PCs tend to come with much more crap installed on them.

Under Windows I know that you can use API functions to access a more accurate timer. There have been previous posts on this, so if you do a search you should be able to dig them up.
0 Kudos
Message 2 of 3
(2,136 Views)

This is a known limitation on certain processors (and maybe LabVIEW versions?).

See the answer by Robert M. here for an explanation and workaround:

http://forums.ni.com/ni/board/message?board.id=170&message.id=99877#M99877

(Also have a look at the entire thread linked above).

Message 3 of 3
(2,131 Views)