Menu

#14 SetPLCTimeS has problems with the year 2010

open
nobody
None
5
2010-01-05
2010-01-05
klaly
No

If you try to set the PC-systemtime with the function SetPLCTimeS, all was fine in year 2000 ... 2009.
But now in 2010, the date will be setted to 2000, it seems to be a problem with modulo division.

If i can find a solution, than i will pos it.

Discussion

  • Nobody/Anonymous

    For the windows part this works:

    nodave.c
    5722c5722,5728
    < ts[2]=daveToBCD(t1.wYear % 10);
    ---
    > if (t1.wYear > 2000) {
    > ts[1]=daveToBCD(20);
    > ts[2]=daveToBCD((t1.wYear - 2000));
    > } else {
    > ts[1]=daveToBCD(19);
    > ts[2]=daveToBCD((t1.wYear - 1900));
    > }

    The Linix part has to be fixed in the same way.

     
  • klaly

    klaly - 2010-01-06

    now it works fine, thanks to nobody !!!

     
  • Dipesh Padhiar

    Dipesh Padhiar - 2010-02-02

    I have no compiler available, would be very grateful if you could mail me the updated file or post on forum as attachment.
    Thanks very much.

     
  • André Manaças

    André Manaças - 2010-02-02

    hi, can someone sent to my mail or a link with a libnodave.dll with the 2010 bug correct ? i am afraid ou correct it my self bacause something may be wrong... best regards

     

Log in to post a comment.