Skip to main content

Time synchronisation (NTP)

info

This page is for support and IT staff. The clock of the server is set in Windows, partly in a command prompt opened as administrator; the clock settings of the drivers are in the configuration editor. On a Linux server, use the time service of that operating system.

YTCC relies on correct clocks in two places. A command that is more than 2 seconds old when it reaches its driver is not carried out; its result is Command expired, not applied. The age is measured against the clocks of the computers involved. Event times come from the devices: the event list and trends use the device time, so RTUs with drifting clocks put events in the wrong order. Synchronise the server first, then the devices from it.

See Time stamps and time zones for how YTCC uses the two times of a value.

Before you begin​

  • You are signed in to the server as a Windows administrator.
  • You know the address of an NTP server in the plant network.
  • To change device settings: the project is open in the configuration editor as root.

Steps​

1. Synchronise the server clock​

These are the standard Windows commands for the Windows Time service. Run them in PowerShell as administrator and replace <NTP server> with the address of your time server:

Set-Service w32time -StartupType Automatic
Start-Service w32time
w32tm /config /manualpeerlist:"<NTP server>" /syncfromflags:manual /update
w32tm /resync

If the server is a member of a Windows domain, it takes its time from the domain controllers; check that with w32tm /query /source and leave the configuration as it is.

Check the result with w32tm /query /status. Source names your time server and Last Successful Sync Time is recent.

2. Synchronise IEC 60870-5-101 RTUs from YTCC​

The IEC 101 driver sets the RTU clock itself. On each IEC 101 device, check:

  • Clock sync on connect: on (the default), so the clock is set each time the link comes up.
  • Clock sync period (s): 3600 by default; 0 turns the periodic synchronisation off.
  • Clock sync mode: how several RTUs behind the same host are synchronised.

The driver sends the server's time, so step 1 must be done first. See IEC 60870-5-101 over TCP.

3. Synchronise IEC 60870-5-104 RTUs and DNP3 outstations​

Synchronise IEC 104 RTUs from their own time source, for example an NTP server or a GPS clock in the substation. See IEC 60870-5-104.

The DNP3 driver synchronises an outstation when mode in its Time sync setting is lan or non_lan; the default none sends nothing. See DNP3.

4. Set the time offset of RTUs on local time​

An IEC 101 or IEC 104 RTU that keeps local time instead of UTC needs Time offset minutes on its device: the offset from UTC in minutes, for example 180 for Turkish local time. The offset is fixed. For a DNP3 outstation, the offset is time_offset_minutes in its Time sync setting.

5. Check the device times​

In the signal list, show the Device time and Received time columns, or open the signal detail of a few signals. For a device that sends time tags, the two times should be close and the Time source should be device. Many values with device time invalid mean that the RTU clock or its time offset is wrong: YTCC treats a device time more than 5 minutes ahead of the arrival time, or more than 7 days behind it, as invalid.

Result​

The server takes its time from the NTP server, the RTUs are synchronised from YTCC or from their own time source, and the device times of new values match their arrival times within the transmission delay.