RMC200 Real-Time Clock

The RMC200 CPU20L and CPU40 include a real-time clock. A real-time clock is a part of the RMC’s circuitry that keeps track of time of day and date while taking into account time changes for the specified time zone region, such as daylight savings time. The real-time clock runs off a battery when the RMC is not powered, which allows the RMC to keep track of real time through power cycles.

When the RMC powers up, the RMC's real-time data registers take on the value of the real-time clock. While the RMC is powered, the real-time data registers increment the time according to the RMC's internal clock frequency–not according to the real-time clock.

Notice that the RMC's real-time clock is not synchronized in any way to network time or GPS time and will drift in the same way that a watch or wall clock will drift. Therefore, to keep accurate time, the real-time clock time must occasionally be adjusted using RMCTools or an external device.

In addition to the real-time registers that are set by the real-time clock at power-up, the RMC200 also has System Time registers that only record the time since the RMC powered up. While the RMC is powered, both the real time registers and system time registers increment according to the RMC’s internal clock frequency. Most applications in the RMC that need to keep track of elapsed time should use the system time registers, not the real-time registers. This is because the time in the real-time registers may jump due to events such as daylight savings time or the user adjusting the real time. See the System Time topic for a list of the real-time registers and system time registers.

Viewing the Real-Time Clock

In RMCTools:

  1. In the Project Pane, expand Modules and double-click the CPU module.

  2. Click the Date and Time page.

On the Display Screen:

  1. On the display screen, browse to Date/Time.

In Registers:

  1. See the System Time Registers for the tag names and addresses of the registers that contain the real time.

Setting the Real-Time Clock

The real-time clock can be set using the following methods:

Using RMCTools:

The real-time clock can be set manually or set according to the time on the PC that is running RMCTools. For advanced users, it can be set via a CIP Service as described at the end of this topic.

 

  1. In the Project Pane, expand Modules and double-click the CPU module.

  2. Click the Date and Time page.

    Set from PC:

    1. In the Set From PC section, click Set Controller Data and Time.

    Set Manually:

    1. In the Set Manually section, select the time and time zone.

    2. Click Set Controller Data and Time.

  3. Click OK and save your project file to store the time zone in the project file.

 

Make sure to also set the time zone, and if necessary, choose the proper region within the time zone for the machine location. Some regions use daylight savings time and others do not, even within the same general time zone.

Using the Real-Time Registers:

The controller has three real-time registers that can be read and written:

These registers can be written to from a user program or from an external device such as a PLC. See the System Time topic for details.

Writing to Real Time UTC, Seconds will automatically update Real Time Local, Seconds and vice versa. The local time zone offset is maintained when either Seconds register is written.

If both Real Time, Nanoseconds and one of the Real Time, Seconds registers is to be written to, then it is important that both registers are written to in the same User Program step or, if written to externally, then both registers should be written to in the same message. If the Seconds and Nanoseconds are written separately, then it is possible for the nanoseconds to roll over between the two writes and end up with an incorrect time.

Using a CIP Service:

Devices that support CIP communications can set the RMC’s real-time clock. Allen-Bradley PLCs support CIP via the MSG instruction.

The following CIP service sets the real time clock in the RMC:

Service: Set_Attribute_Single (10 hex)

Object: C7 hex

Instance: 1

Attribute: 6

Source Element: SystemTime (type = DINT[2])

SystemTime[0] – Real Time UTC, seconds

SystemTime[1] – Real Time, nanoseconds

Seconds and nanoseconds are relative to 1970-01-01 00:00:00Z (midnight, January 1, 1970) and are in UTC (GMT). Nanoseconds are in the range of 0..999,999,999, wrapping every second. Seconds must be at least 1262304000 (2010-01-01T00:00:00Z). The Real Time Local, seconds value will automatically be updated for the currently-selected time zone.

Source Length: 8 bytes

Notice that Allen-Bradley PLCs use a microsecond time base and combines two 32-bit values into a 64-bit value, whereas the RMC uses a nanosecond time base and rolls over the nanoseconds 32-bit word at 1,000,000,000.

Updating Time Zones

As part of the real-time clock, the RMC stores the selected time zone definition, which includes the offset from the UTC and the daylight savings time definition. These definitions can change over time, such as countries removing or adjusting daylight savings time. Delta updates the RMCTools software annually with the latest UTC time zone definitions. RMCTools can then download the updated time zone definition to the RMC.

To update the RMC with the latest time zone information:

  1. Download the most recent version of RMCTools from Delta's website.

  2. Open RMCTools and go online with the RMC.

  3. In the Project view, expand Modules, and double-clock the RMC200 CPU.

  4. On the Date and Time page, in either the Set From PC or Set Manually section, verify that the correct time zone is shown, and click Set Controller Date and Time.

  5. Click OK and save your project file to store the time zone in the project file.

Real-Time Clock Battery

A battery supplies power to the Real-Time Clock when the RMC is not powered. This battery is designed to last at least 10 years when the RMC is not externally powered. The battery is not field-replaceable. To replace the battery, the CPU module must be sent to Delta.

Real Time Clock Battery Low Warning

If the battery voltage drops below 2.5V, the warning message “Real time clock battery is low” will appear in the Event Log and on the Display Screen. If this occurs, the real-time clock values may be inaccurate.

If the real-time clock functionality is not used by the application, the battery low warning can be safely ignored. At the time of this writing (2023), very few applications use the time value derived from the real-time clock. Of the applications that use any of the time registers in the RMC, most use the system time (time since the RMC powered up), not the real-time registers.

Real-Time Clock Internal Fault

Errors related to the real-time clock are reported on the display screen and in the Event Log. The “Real time clock has an internal fault” fault condition occurs when any of the following occur:

If these errors occur, contact Delta technical support. However, if the real-time clock is not used in the application, this error can be safely ignored.

 

 

See Also

CPU20L Module | CPU40 Module | System Time Registers | System Time


Send comments on this topic.

Copyright © 2024 Delta Computer Systems, Inc. dba Delta Motion