What we also discovered is that in 2020 it will read 2032.
So it appears there is a x16 and not a x10 on the second digit of the year.
Again this only happens when your application software calls the RTC when the seconds are :00 with all other seconds (01 to 59)
It will return the proper year.
We created our own date/time read function to correct the issue.
This function also yields the right answer if the RTC operates properly.
(When a :00 read is called it returns the last proper date/time that it read)
For most applications that call the RTC often and are not too sensitive on the exact time this will work OK (POS applications etc)
Jan
FIX:
SYSTEMTIME t1;
GetLocalTime(&t1);
Now changed to
GetAdvantechTime(&t1);
void GetAdvantechTime(SYSTEMTIME *t1)
{
static SYSTEMTIME stLastTime;
SYSTEMTIME stCurrentTime;
if(stLastTime.wYear == 0)
{
while(stLastTime.wSecond == 0)
GetLocalTime(&stLastTime);
}
GetLocalTime(&stCurrentTime);
if(stCurrentTime.wSecond == 0)
*t1 = stLastTime;
else
*t1 = stCurrentTime;
}
Rishi wrote:
2016 date bug...
06-Jan-10
We are experiencing incorrect year being reported by Win CE 4.2 OS.
Occasionally the
year will be 2016 instead of 2010. Has anyone else seen this? Any
medical device manufacturers out there experiencing the same problem?
Previous Posts In This Thread:
Submitted via EggHeadCafe - Software Developer Portal of Choice
Create a MediaPlayer in WPF
http://www.eggheadcafe.com/tutorials/aspnet/db715139-e5e8-4d7c-8de9-047064c42b1f/create-a-mediaplayer-in-w.aspx
So assuming that the real-time clock starts 2000, the year register will
hold the value 0x10 (16) and not the value 0x0A for 2010. The year 2020 would
be stored as 0x20 (32) in the external RTC and not the value 0x14, etc.
Check OALRtcInit, OEMGetRealTime, OEMSetRealTime, OEMSetAlarmTime,
OALIoCtlHalInitRTC
Chris
--
http://developce.blogspot.com/
"jan van kessel" wrote:
> .
>
Others, what CPU/board/BSP are you working with?
--
Bruce Eitman (eMVP)
Senior Engineer
Bruce.Eitman AT Eurotech DOT com
My BLOG http://geekswithblogs.net/bruceeitman
Eurotech Inc.
www.Eurotech.com
"cjay" <cj...@discussions.microsoft.com> wrote in message
news:7A1930FC-09C5-4C2F...@microsoft.com...
We are having mysteriously changing dates on our system running Win CE 4.2 Pro. It is an Advantech G2, system purchased thru Hamilton for car wash codes at gas pumps. Satelite unit at gas station sells codes, Master at Car wash redeems. The problem clearly started after Jan 1 2010, but our system date changes itself to the wrong date by days, not to 2016. It has lost the correct date this way 6 - 10 times since Jan 1st. If the one unit gets ahead of the other in date / time, the system fails - codes are sold that won't be valid when expected. We would greatly appreciate if you can advise on our issue. Specifically, we feel our symptoms may not be remedied by the patch that will be coming from Advantech thru Hamilton to us - especially since the system date is not getting off by more than days not to 2016.
- David Paterno
jan van kessel wrote:
RTC 2016 bug fix
06-Jan-10
Jan
FIX:
SYSTEMTIME t1;
GetLocalTime(&t1);
Now changed to
GetAdvantechTime(&t1);
Previous Posts In This Thread:
On Wednesday, January 06, 2010 12:56 PM
Rishi wrote:
2016 date bug...
We are experiencing incorrect year being reported by Win CE 4.2 OS.
Occasionally the
year will be 2016 instead of 2010. Has anyone else seen this? Any
medical device manufacturers out there experiencing the same problem?
On Wednesday, January 06, 2010 3:07 PM
jan van kessel wrote:
RTC 2016 bug fix
Jan
FIX:
SYSTEMTIME t1;
GetLocalTime(&t1);
Now changed to
GetAdvantechTime(&t1);
On Monday, January 11, 2010 11:35 AM
cjay wrote:
Looks like a bug in your OAL and the person who wrote it making a mistakewith
Looks like a bug in your OAL and the person who wrote it making a mistake
with the BDC calculation (or lack thereof). You will find that in a lot of
external real-time clocks the time is represented in the register as 0xTU
where T=Tens and U=Units.
So assuming that the real-time clock starts 2000, the year register will
hold the value 0x10 (16) and not the value 0x0A for 2010. The year 2020 would
be stored as 0x20 (32) in the external RTC and not the value 0x14, etc.
Check OALRtcInit, OEMGetRealTime, OEMSetRealTime, OEMSetAlarmTime,
OALIoCtlHalInitRTC
Chris
--
http://developce.blogspot.com/
"jan van kessel" wrote:
On Monday, January 11, 2010 12:16 PM
Bruce Eitman [eMVP] wrote:
Chris, very nice explanation.Others, what CPU/board/BSP are you working with?
Chris, very nice explanation.
Others, what CPU/board/BSP are you working with?
--
Bruce Eitman (eMVP)
Senior Engineer
Bruce.Eitman AT Eurotech DOT com
My BLOG http://geekswithblogs.net/bruceeitman
Eurotech Inc.
www.Eurotech.com
On Tuesday, January 19, 2010 6:46 AM
ym wrote:
so the issue seems to be the binary codes......WHERE IS THE SOLUTION?
so the issue seems to be the binary codes......WHERE IS THE SOLUTION? i seem
to be having problems with my windows mobile....I have been looking for a fix
but none so far...everybody is talking aout it though and the cab fle i
downloaded from microsoft DID NOT fix the bug!
On Monday, March 08, 2010 8:49 PM
David Paterno wrote:
2016 time fix and G2 system date off by days not years
Jan Van Kessel,
We are having mysteriously changing dates on our system running Win CE 4.2 Pro. It is an Advantech G2, system purchased thru Hamilton for car wash codes at gas pumps. Satelite unit at gas station sells codes, Master at Car wash redeems. The problem clearly started after Jan 1 2010, but our system date changes itself to the wrong date by days, not to 2016. It has lost the correct date this way 6 - 10 times since Jan 1st. If the one unit gets ahead of the other in date / time, the system fails - codes are sold that won't be valid when expected. We would greatly appreciate if you can advise on our issue. Specifically, we feel our symptoms may not be remedied by the patch that will be coming from Advantech thru Hamilton to us - especially since the system date is not getting off by more than days not to 2016.
- David Paterno
Submitted via EggHeadCafe - Software Developer Portal of Choice
More Fun with Fluent NHibernate Automapping
http://www.eggheadcafe.com/tutorials/aspnet/50aa9259-6dbb-4d16-9639-81ee42171b00/more-fun-with-fluent-nhib.aspx