Hallo Besucher, der Thread wurde 1,3k mal aufgerufen und enthält 6 Antworten

letzter Beitrag von MIRKOSOFT am

uIEC date/time write never set

  • Hi!


    I used for reading date/time from uIEC "T-RA" command - all was correct.

    When I tried to use "T-WA" to write date/time I found problem - date/time is not possible to change, even device no error reports.


    I used simple code (date and time are only example, uIEC device number is 11):

    Code
    1. OPEN15,11,15
    2. PRINT#15, "T-WATHUR. 07/18/19 11:40:30 PM"+CHR$(13)
    3. CLOSE15

    then uIEC reports no error, but date/time is never changed.


    How to fix it?

    Thank you for all.

    Miro

  • T-WATHUR. 07/18/19 11:40:30 PM"

    "THUR." is not a valid day-of-week string. The parser uses fixed offsets within the command string, so everything after that is in the wrong position. To keep the code size down, only very limited validity checks are made on the parsing result.

  • Link: https://www.sd2iec.de/gitweb/?…lob;f=README;hb=HEAD#l235

  • Ok.

    Nice code example - really perfect.

    That's actually my signature....

    Zitat

    So, accepts "T-WA" MON/TUE... etc. - three letter day of week? And needs it dot after DOW?

    It needs four-letter DOWs, some of them with dot and some without, the full list is in the README. Complain to CMD if you don't like that inconsistency. ;)


    I found problem - time is set, but until I reset computer.

    Is possible by any way save time for later?

    I know that uIEC has not battery.

    The uIEC hardware does not have a hardware RTC, it only emulates one in software. When it loses power or is reset, it loses time. sd2iec supports a few different I2C RTCs that can run on battery, but I'm not sure if the pins for that are accessible on the uIEC boards and support for them is not compiled in by default.