Internet PLC Forum
General => Technical support => Topic started 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?
-
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.
-
Perfect! Thanks!
-
Is there a easy way to switch between 12-hour time vs 24-hour time. Or does a custom function need to be written?
-
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$