LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Windows Data/Time loses time when using CVI and AsyncTimer

Hi,
I have a temperature datalogging system with the use of a AsyncTimer for getting sensordata from the RS232.
It is written in CVI 6.0 and I made distribution kits.

At older PC's (Pentium I and II running Windows 95 and 98SE) the date/time is losing time.

See for some infomation:
http://www.itc.virginia.edu/desktop/dci/timeloss.html
and here:
http://support.microsoft.com/default.aspx?cid=http://support.microsoft.com:80/support/kb/articles/Q189/7/06.ASP&NoWebContent=1

I think that the AsyncTimer (where I use Delay() and Timer() ) is disturbing the windows timer functions.
Time lag is between zero and 12 minutes per day.
Sometimes there is no lag sometimes there is. Restarting the computer and the
software sometimes solves the problem, sometimes not.
When time is lagging, ending my applications does not help anymore: time keeps lagging untill windows is restarted.

Any help is appreciated.
0 Kudos
Message 1 of 4
(2,836 Views)
Our timing functions do not disturb the windows system clock. As it says in your first article, in Win9X OSs, it can get disturbed when the system gets really busy. This has nothing to do with what your programs are doing, but how much CPU time they are monopolizing.

If you want your CVI programs to monopolize less if the CPU time so it is available for other Windows processes, you can do that by changing the sleep mode in your CVI program. Changing the sleep mode slows down the event processing loop in CVI to allow more CPU time for other processing. You can change the sleep mode with the SetSleepPolicy function. You can set it to VAL_SLEEP_SOME or VAL_SLEEP_MORE to allow more CPU time. Just as an aside, this is one of many stability issues with th
e Win9X OS's. I would try to get off of those OS's on onto Windows 2000 or XP as soon as you can.

Best Regards,

Chris Matthews
National Instruments
0 Kudos
Message 2 of 4
(2,836 Views)
Dear Chris,
Thank you for your answer.
Unfortunately I already use VAL_SLEEP_MORE (by default).
I am trying to give Windows more time to handle the clock.
Will inserting Delay() calls inside time-consuming calculation help?
I assume the delay funtion is event driven and not merely a software loop.

Regards, Ton van Denzel.
0 Kudos
Message 3 of 4
(2,836 Views)
Delay calls may help, but really shouldn't be necessary. I would make sure that it is the CVI app that is taking up the CPU time. You can use a task monitor application, such as TaskInfo2002, available here, to check the CPU usage. It may be another process, like virus software or task schedulers, are causing the CPU spikes that result in time loss.

Chris
0 Kudos
Message 4 of 4
(2,836 Views)