MA-006
–
Minitrans Operator Guide
–
Rev 2.2
5-Mar-20
Page 24 of 26
Appendix A
Time Sync Implementation
The product has a time-sync feature that allow users to synchronize the clock time on
the product. This Appendix explains the data format options for the “time sync” and its
implementation.
A.1
Time Format
Under the standard Modbus
®
register list, the timing is defined in Table A-1:
Table A-1: Timing
Register Permissions
Group
Size
Description
Data Format
1200
R/W
4*
UTC Clock: Years
YYYY (BCD)
1201
UTC Clock: Months, days
MMDD (BCD)
1202
UTC Clock: Hours, minutes
HHMM (BCD)
1203
UTC Clock: Seconds, Day of week
(0-6, 0 Sunday)
SSWW (BCD)
This R/W (read/write) register is in BCD format (Binary Coded Decimal). Some systems
are not compatible with this data format.
*Note: The time registers can be written separately in 5 seconds interval in any order.
This feature is available starting TransfixHost v1.12.4.
A.2
UNIX® Epoch register
A UNIX Epoch register was added to the host board firmware (v1.12.2) to make systems
integration easier in cases of system incompatibility. Both register formats (BCD & UNIX)
will be maintained in future firmware versions and both affect the same single clock. The
details of the UNIX time registers are listed in Table A-2:
Table A-2: UNIX time registers
Register
Access
Flags
Version
Storage Class
Effect
After
Name
Description
Data Format
1197
rg2,wg2
1.12.2
RAM
immediately
RTC_UNIX_TIME
Current
Time UTC in
UNIX format
32-bit integer
1198
These registers are readable and writable, but should be written together as a single 32
bit value.
A.2.1
UNIX time format
The number of seconds from the UNIX epoch time of 1st Jan 1970 00:00.
A.2.2
UNIX time example
For reference, the time on a device is reported in TransConnect as 12 Aug 2011 11:56:00
BST and the corresponding value in the registers mentioned above is 13146616.
When testing, please check that you are reading registers 1197-1198 (assuming
addresses start at 999 +1) and decoding an unsigned 32 bit big endian number. The
epoch time is in UTC. This matches the device time. An online converter e.g.
http://www.epochconverter.com/ can be used to verify.