Chapter 4. CPU Operation
158
PACSystems* RX7i, RX3i and RSTi-EP CPU Reference Manual
GFK-2222AD
4.8.2
Time-of-Day Clock
A hardware time-of-day clock maintains the time-of-day (TOD) in the CPU. The time-of-day clock
maintains the following time functions:
▪
Year (two digits)
▪
Month
▪
Day of month
▪
Hour
▪
Minute
▪
Second
▪
Day of week
The TOD clock is battery-backed and maintains its present state across a power failure. The time-of-day
clock handles month-to-month and year-to-year transitions and automatically compensates for leap
years through year 2036.
You can read and set the hardware TOD time and date through the application program using Service
Request function #7. For details, refer to
PACSystems RX7i, RX3i and RSTi-EP
CPU Programmer’s
Reference Manual,
GFK-2950 Chapter 6.
High-Resolution Time of Day Software Clock
A high-resolution software TOD clock is implemented in firmware to provide nanoseconds resolution.
When the high-resolution software TOD clock is set, the hardware TOD clock is set with the YYYY: Mon:
Day: Hr: Min: Sec fields in the POSIX
72
time, the RTC is read, and the delta between the POSIXtime and
the value read from the RTC is computed and saved. Thus, if 1-second resolution is desired the hardware
TOD clock is read. Otherwise, the high-resolution software TOD clock is read to provide greater
resolution. When the latter occurs, the hardware RTC is read and the saved delta added to the value
read.
When the SNTP Time Transfer feature is implemented, all SNTP time updates received at the CPU will
cause the high-resolution software TOD clock to be updated.
Synchronizing the High-resolution Time of Day Clock to an SNTP Network
Time Server
In an SNTP system, a computer on the network (called an SNTP server) sends out a periodic timing
message to all SNTP-capable Ethernet Interfaces on the network, which synchronize their internal clocks
with this SNTP timing message. If SNTP is used to perform network time synchronization, the time-stamp
information typically has ±10ms accuracy between controllers on the same network.
Synchronizing the CPU TOD clock to an SNTP server allows you to set a consistent time across multiple
systems. Once the CPU TOD clock has been synchronized with the SNTP time, all produced EGD
exchanges will use the CPU TOD current value for the time-stamp.
The CPU TOD clock is set with accuracy within ±2ms of the SNTP time-stamp.
TOD clock synchronization is enabled on an Ethernet module by the advanced user parameter (AUP),
ncpu_sync
. The CPU must also use a COMMREQ in user logic to select an Ethernet module as the time
master. For additional information, refer to
Time-stamping of Ethernet Global Data Exchanges
in
PACSystems RX7i, RX3i and RSTi-EP TCP/IP Ethernet Communications User Manual,
GFK-2224 Chapter
4.
72
RSTi-EP CPE100/CPE115 does not allow the Time-of-Day clock to be set older than 1
st
Jan, 2001 when POSIX format is used
along with SVC_REQ 7.