10-25-2023 05:50 AM
Hello,
I have an program that uses two 1ms interval async timers running in parallel threads.
I have been using this for 8 years, starting with CVI 2015, and Windows 7.
Recently, after having upgraded to Windows 10 and CVI 2020, and restructuring the program, the timers simply stop working after ~24.5 days.
Everything is perfect until they stop.
This is an test stand program, assuming no test issues, that runs 24/7 for up to 6 months at a time.
I understand from the async timer documentation that this may not be the recommended strategy, but it has worked solidly for 8 years, so something has changed, either in CVI or Windows 10.
Any hints are greatly appreciated.
Dr. Terry Moss
Technical Manager
Robert Bosch Charleston SC
10-25-2023 09:56 AM
That corresponds to a 31-bit rollover as expressed in milliseconds. You might want to dig around that.
10-25-2023 01:32 PM
Thanks for the feedback.
Yes, we have been considering that, but why should a 1ms timer overflow?
If we set a timer with a 30 day interval, it would make sense.
We've been running error free 24/7 for years with the same setup.
10-26-2023 01:54 AM
There used to be a problem in the past in UI timers and Timer () function which were using 32-bit unsigned integers to count milliseconds: that was producing a rollover every ~49.7 days. That problem however has been solved back in CVI5.5 times and never affected async timers which rely on a different mechanism to operate.
A rollover on a 31-bit basis is quite strange, unless a signed integer is used instead of unsigned but again it should happen out of timer environment: are you using timer values somewhere in the program and which calculations are you performing on them? Has some of program timing functions been affected by the refactoring you performed while transitioning to CVI2020?
10-26-2023 05:16 AM
Interesting,
We think we found a problem with the error checking on the timer.
It was using a float variable with a Timer() function to over check the timer.
Apparently as the Timer() value increases with run time, the float variable looses resolution. Once it looses enough resolution, the timer appears to timeout instantly, causing this bug.
The original code used a double, and ran for years...
Thanks for the advice.
Thanks for the
04-04-2024 09:52 AM
Hello Terry. Do you want to say, thats an internally async timer problem or a problem with your self made code?
04-04-2024 11:04 AM
It was definitely a problem with my code.
I was using a float to do the timer comparison, and it was wrapping around, changing it to a double fixed the problem.
Our benches run for months at a time, so we are a little more sensitive to bugs like that.
Thanks...