Hello all,
As an update to this problem, the CVI asynchronous timers rely on the Windows multimedia timers (see ..\CVI\toolslib\toolbox\asynctmr.c for details) to fire the event at the appropriate time. The incorrect behavior you are seeing is caused by an issue with the windows timers where they wrap around every 429496 milliseconds. For any interval,
x larger than 429496 milliseconds, a wrap occurs and the timing interval is actually
x-429496 milliseconds. This issue has been reported to Microsoft. More information on the behavior of the multimedia timer and the bug report can be found in the following
MSDN discussion.
As a workaround, you can changed the interval of the timer to 1 second (i.e. use single shot events), manually track the number of elapsed timer ticks and perform an operation after the desired time elapses. For instance, instead of setting the timer interval to 600 seconds, set the timer interval to 1 second and increment a counter in the timer callback each time it is called. On the 600th call to the timer callback, perform the code you would like executed every 600 seconds.
Note: This behavior only occurs when the time interval is larger that the wrap around interval of the Windows multimedia timer. Therefore, if you keep the asynchronous timer interval below the wrap around time specified above, you can avoid this behavior.
Hope that helps.
Wendy L
LabWindows/CVI Developer Newsletter