Topic: DMD0223

Help File Version: 2.9.4.37

Synchronizing the Clocks on Multiple Do-more PLCs


The TimeSync Configuration option allows the Ethernet-equipped Do-more PLCs on a local network to automatically synchronize their internal real-time clocks. A typical network of Do-more PLCs will have one configured as a TimeSync ServerA Do-more CPU that is confiugured to generate TimeSync messages for other Do-more CPUs on the network that are configured as Clients and Alternates. At each Update Interval or any time the Server's real-time clock is changed, a TimeSync Server will broadcast TimeSync messages to Clients and Alternates., one or more PLCs configured as TimeSync Alternates, and the remaining PLC configured as TimeSync Clients. The TimeSync packet contains the current time from the TimeSync Server and the Update Interval so that a TimeSync ClientA Do-more PLC that is configured to receive process TimeSync messages that are sent from a TimeSync Server. Each time a Client receives a TimeSync message it will update it's real-time clock with the real-time clock information in the TimeSync packet. or a TimeSync AlternateA Do-more CPU configured to normally function as a TimeSync Client but will promote itself to a TimeSync Server if there are no TimeSync packets received within the Update Interval. will know when to expect the next TimeSync packet.

 

TimeSync packets are automatically sent by the TimeSync Server at the specified Update Interval. A TimeSync packet is also sent any time the real-time clock on the TimeSync Server is manually changed by the Do-more Designer Programming Software, or changed by a NETTIME (SNTP Client) instruction in the PLC.

 

Because the current Date and Time for a given PLC is rendered from component values, TimeSync packets contain all of the information required for each PLC to render a synchronized value. These packets contain the TimeSync Server's UTC time value, the Time Zone adjustment, and the $SummerTime setting. With these settings synchronized, the PLCs will all render the same $LocalTime value for their internal clocks.

 

Note: This feature uses TCP/IP broadcast packets to synchronize the real-time clocks of the Clients and Alternates, which means that only PLCs within the TimeSync Server's Broadcast DomainA broadcast domain is a logical network segment in which any device connected to the network can directly transmit to any other on the domain without having to go through a routing device. These are typically very basic networks that use hubs rather than switches or routers. A special broadcast address consisting of all 1s is used to send frames to all devices on the network. can be synchronized.

 


Configuring a Do-more CPU to participate in a TimeSync network is done through the CPU Configuration page of the System Configuration utility.

 

There are four possible options for the TimeSync Configuration feature:

Disabled means the TimeSync feature in this CPU is disabled, the PLC's real-time clock will not be synchronized by a TimeSync Server. This is the default configuration.

 

Client means this CPU will process TimeSync messages that are sent from a TimeSync Server. Each time a Client receives a TimeSync message it will update it's real-time clock with the real-time clock information in the TimeSync packet, set its Status Bit $TimeSynced (ST23) ON which indicates that the clocks have been synchronized, and begin timing down from the Update Interval so the Client will know when to expect the next TimeSync packet.

 

Server means this CPU will generate TimeSync messages for other PLCs on the network that are configured as Clients and Alternates. At each Update Interval or any time the Server's real-time clock is changed, a TimeSync Server will broadcast three TimeSync messages at five second intervals - three messages are sent to make sure that the Clients and Alternates receive at least one of the messages.

 

Alternate means this CPU will normally function as a TimeSync Client but will promote itself to a TimeSync Server if there are no TimeSync packets received within the Update Interval. An Alternate will begin the process of promoting itself to a Server 15 seconds after the Update interval has expired.

The process of a TimeSync Alternate promoting itself to a TimeSync Server is as follows:

 

  1. The Alternate will broadcast a packet asking any TimeSync Servers on the network to immediately send a TimeSync packet.
     

  2. If a TimeSync packet is received the promotion process is stopped and the Alternate reverts back to a Client waiting on the next TimeSync packet.
     

  3. If no TimeSync packet is received, the Alternate will generate it's own TimeSync packet - using it's real-time clock and Update Interval values - and broadcast that packet on the network.

 

This TimeSync Alternate will continue to operate as a TimeSync Server until one of the following happens:
 

  1. A legitimate TimeSync Server connects to the network and begins sending TimeSync messages. At this point the Alternate will revert back to a Client and then process TimeSync packets as it normally would while operating as a Client.
     

  2. The Alternate PLC is power-cycled. When the Alternate powers-up it will query the network for a TimeSync Server. If a Server responds the Alternate begins operating normally. If no Server responds the Alternate begins the process to once again promote itself to be a TimeSync Server.
     

  3. The Alternate PLC undergoes a PROGRAM -to- RUN mode transition. When the Alternate goes back into RUN mode it will query the network for a TimeSync Server. If a Server responds the Alternate begins operating normally. If no Server responds the Alternate begins the process to once again promote itself to be a TimeSync Server.

Update Interval is used in the following three ways:

By a TimeSync Client once a Client has it's time synchronized, it sets its own $TimeSynced status bit and will begin using the Update Interval value as a countdown timer to know when to expect the next TimeSync packet. If that packet is not received before the Update Interval expires the PLC will reset it's status bit $TimeSynced (ST23) to indicate that the time is no longer synchronized.
 

By a TimeSync Alternate once an Alternate has it's time synchronized, it sets it's own $TimeSynced status bit and will begin using the Update Interval value as a countdown timer to know when to expect the next TimeSync packet. If the next packet is not received before the Update Interval expires the Alternate will begin the process of promoting itself to a TimeSync Server.
 

By a TimeSync Server to designate the frequency that TimeSync packets are broadcast on the network.

 


See Also:

Date and Time Overview


Setting the Clock

 

Synchronizing the Clocks on Multiple Do-more PLCs