mtnshack (Customer) asked a question.
Does anyone have problems keeping the CLICK RTC on time? Mine is falling behind several seconds a day.
I've plotted the RTC against universal coordinated time. It turns out that the clock oscillator is about right, and nowhere near slow enough to fall behind several seconds a day. The fact is that the clock falls behind because a second is repeated twice, which happens anywhere from once every 3 hours to 7 hours. It also once skipped a second. The graph below shows the seconds difference between the RTC and universal coordinated time, over a day.
You can see a slight upward trend in the flat areas. It means the RTC second hand is actually moving a little bit faster than UTC. If you take out the 1s steps, so that the line becomes a smooth ramp, then the clock only gains 1/4 of a second over the whole 25 hours.
What could be causing the second to leap around?
Details of the Setup
CLICK C0-12DD1E-2-D, firmware v2.60
The ladder program is running at a fixed/scheduled scan rate of 100 ms.
The ladder program does read the RTC, but it never writes. The RTC registers are read by math functions and by comparison logic.
A HMI reads a dozen or so registers on the CLICK via Modbus/TCP/IP every second. The RTC registers are also read by the HMI.

The specification for the RTC in the CLICK C0-1x series is a possible drift of 100s per month.
Additionally, the cycle for updating RTC data to the SD register is 1s. Therefore, there is an error of 1s ± 1s in the timing of the display of data in the SD Register.