Timestamp correction

The TwinCAT time, which is used by default for timestamps in the Data Logger, deviates more and more from the actual system time the longer a controller is in run mode. This is due to the fact that different hardware counters are used as clock generators. With the concept of timestamp correction, which TwinCAT offers, it is possible to append corrected timestamps to the recorded samples. The correction using the External Time Provider, which TwinCAT provides, can be made both in relation to an external time source via NTP (Network Time Protocol) and in relation to the EtherCAT Distributed Clock via PTP (Precision Time Protocol).

The settings for timestamp correction can be found under the Data Logger project node in the tab Time Source.
If the desired Precision Category is selected, any External Time Provider is displayed. If none exists yet, a provider can be created via the button Create.

Timestamp correction 1:

This then appears in the project under the TcCom-Objects node, which you can access via the button Config.

Timestamp correction 2:

Here you should ensure that the Task that controls the Time Provider object is selected in the Context tab.

Timestamp correction 3:

In addition, the cycle time of the provider's synchronization with the NTP server and the server host name can be set via the Init parameter.

Timestamp correction 4:

This creates timestamp corrections that the Logger uses to correct an offset resulting from the difference between the TwinCAT time and the NTP-synchronous time.