11-17-2006 09:10 AM
11-17-2006 10:00 AM
As far as I know there is no way of resetting Timer () function. It counts up to 2^32 msec, that is 49 days and some: after tis time is resets to 0 and restarts counting.
What do you mean by "looses track of time"?
11-17-2006 11:57 AM
11-17-2006 01:54 PM
11-17-2006 04:54 PM
Luis, what I am observing is exactly that Timer () function restarts from zero after those 49 days, while eventData2 parameter in a timer callback (that returns the timer from the last execution of the callback) returns a negative number of the corresponding amount of seconds. I had to take appropriate countermeasures in the timer callback in which I am using *(double *)eventData2 for the case when this value is negative...
This occurs on CVI at least up to version 7.1. I handn't yet tried CVI8 in this respect.
11-20-2006 12:01 PM
11-20-2006 02:28 PM - edited 11-20-2006 02:28 PM
Luis, I will call my customers trying to get some more informations on the exact succession of events, but I have no much hopes that I will succeed since I normally place my program in the startup folder so that it starts when the computer starts up. The only possibility to discriminate if the famous 49 days are from computer startup or program startup are that somebody has started the program significantly after the computer has turned on. Moreover, we must go back a lot of time, since I took appropriate countermeasures to contrast this phenomenon... My personal opinion is that the 49 days starts from the first execution of the timer callback, but I cannot grant for it on a instrumental basis.
But it's definitely NOT the case of calls to timer spaced by 49 days: my programs have a timer (multimedia timer in the majority of cases, standard timer in some others) that fires every 0.3, 0.5 or 1 sec depending on the application running. In all these cases the timer callback gets the time from previous call (eventData2) and accumulates it to update some counters for the running tests. It' this value that is rolling over so that on a particular moment it becomes negative by 2^32 minus some fraction of second. With the exception of this event all the application is running correctly, and after this event the timer continues to count consistently.
Last addition: I noticed this event back to CVI 5.5 times and observed it again on CVI6 applications. After this moment I learned how to patch this event so I have no informations on whether in 7 and 7.1 applications does it happen again or not.
Message Edited by Roberto Bozzolo on 11-20-2006 09:30 PM
11-21-2006 10:43 AM
11-23-2006 07:21 AM
Luis,
yes, I was referring to asyncronous timers when I spoke about multimedia timers, and I am using them in my applications when in executable (while when debugging on my machine I use UI timers but for shorter periods). For this reason I cannot be sure wether I saw this rollover also on standard UI timers and when: it's a long time since I begun using async timers... It's true that inside timer callback I have some little delays implemented as while loops on Timer () value, but the interval checked is so little (50 msecs) that it's not probable that we get the rollover in it, moreover they are only used as timeouts in communicating with external equipments: if the device is responding the loop terminates within 15 to 25 msecs, so...
Anyway, I am very curious of the result of your testing: I had not expected that async timers behave differently from UI timers in this respect. Thanks for keeping us up to date.
01-09-2007 05:38 PM