Internet PLC Forum

General => Technical support => Topic started by: MarkWater on August 13, 2014, 12:26:10 PM

Title: Time/Date
Post by: MarkWater on August 13, 2014, 12:26:10 PM
Are you able to change the time and date of a SmartTile through an HMI via modbus?
Title: Re:Time/Date
Post by: support on August 13, 2014, 02:16:53 PM
Yes, the RTC data on the SmartTILE-Fx are mapped to the following Modbus register address (zero offset):

TIME[1] : 512
TIME[2]:  513
TIME[3]:  514
DATE[1]:  516
DATE[2]:  517
DATE[3]:  518
DATE[4]:  519

You can use Modbus function 03/04 to read these registers and Function 06/16 to write to these registers.
Title: Re:Time/Date
Post by: MarkWater on August 13, 2014, 07:09:11 PM
Perfect! Thanks!
Title: Re:Time/Date
Post by: MarkWater on August 20, 2014, 03:01:00 PM
Is there a easy way to switch between 12-hour time vs 24-hour time. Or does a custom function need to be written?
Title: Re:Time/Date
Post by: support on August 20, 2014, 06:11:05 PM
The real time clock data is only expressed in 24 hours format. But you can easily display it as 12 hours with simple IF statement:

IF (TIME[1] > 12)
    A$ = STR$(TIME[1]-12)+":"+STR$(TIME[2])+STR$(TIME[3])+" PM"
ELSE
    A$ = STR$(TIME[1])+":"+STR$(TIME[2])+STR$(TIME[3])+" AM"
ENDIF

SETLCD 1,1, "Time = " + A$