Distributed Clocks settings

Determination of the current Distributed Clock time

If the current distributed clock time is required in a PLC cycle, this can

  1.  be linked via an input variable of the EtherCAT master
  2.  displayed directly by the terminal as a 64-bit system time
Distributed Clocks settings 1:

Functions for data types with 64-bit width

A selection of functions for handling 64-bit numbers is available under Beckhoff TwinCAT in the TcUtilities.lib library. Longer execution times are required here than is the case with standard, 32-bit data types.
A data type with a width of 64-bits is defined in TcEthercat.lib as T_DCTIME or in TcUtilities.lib as T_LARGE_INTEGER.

1. Via the EtherCAT master

The EtherCAT master can display a copy of the current master distributed clock. To this end activate the setting "Show DC System Time (64 bit)" in the EtherCAT device --> EtherCAT tab --> Advanced Settings --> Distributed Clocks (Fig. Activation of the master distributed clock display).

Distributed Clocks settings 2:
Activation of the master distributed clock display

The process image of the EtherCAT master now looks as shown in Fig. Extended process image of the EtherCAT master:

Distributed Clocks settings 3:
Extended process image of the EtherCAT master
Distributed Clocks settings 4:

SYSTIME

The EtherCAT master value DcSysTime is to be used with care and should serve only as a coarse indication as to which time zone (order of magnitude: 1-2 task cycles) the Distributed Clocks system is currently in.

This is due to the fact that the local time in the terminal is read into associated buffers several µs before retrieving frame. The EtherCAT strand then requires some time for transporting the process data to the master. Due to the character of the visualization, the online display in the TwinCAT System Manager is accurate at best to a three-figure millisecond range. Within a PLC the SysTime process data may also be outdated to a certain degree: depending on when the analysis takes place in the program code, the process data may be several µs/ms older. If responses of an EtherCAT strand (e.g. an EL2258 output terminal) are to be based on a SysTime read in this way, 2-3 PLC cycles should be taken into account as a buffer.

It is more appropriate to use an EL2258 with other EtherCAT slaves that generate a timestamp based on ambient influences, such as the EL1252.

Alternatively, functions can also be called at NC/PLC runtime that immediately return the current DC time, e.g. F_GetCurDcTickTime. Refer to the notes on the TwinCAT time sources in the EtherCAT system documentation.

2. Terminal's own SysTime

The MultiTimestamp terminals can offer the local DC system time of the terminal directly as a process data:

Distributed Clocks settings 5:
Setting SysTime

To this end, the "PDO DEV Input Device" has to be activated in the System Manager:

Distributed Clocks settings 6:

SysTime

The value DcSysTime of the terminal is to be used with care and should serve only as a coarse indication as to which time zone (order of magnitude: +/-1 task cycle) the Distributed Clocks system is currently in. The reason is that the local time in the terminal is only determined once per macro cycle, without specification of the exact time.

It is more appropriate to use an EL2258 with other EtherCAT slaves that generate a timestamp based on ambient influences, such as the EL1252.

Alternatively, functions can also be called at NC/PLC runtime that immediately return the current DC time, e.g. F_GetCurDcTickTime. Refer to the notes on the TwinCAT time sources in the EtherCAT system documentation.

Distributed Clocks settings 7:

SysTime 32/64 bit

The PDO SysTime is filled as follows:
- in "CompatibleModus" the 64 bit variable is filled with the full 64 bit distributed clock time

- in "MultiTimeStamp Modus" the 64 bit variable is only filled with the lower 32 bit, since this is also the time width of the time stamps.