NTP provider

The NTP provider is an (S)NTP client that cyclically receives a time signal from an NTP server. This allows it to calculate an offset of the system time from the time signal of the NTP server and make it available accordingly.

Configuration

The NTP provider is implemented as TcCOM module TcNtpExternalTimeProvider. This module is commissioned as a TcCOM module as follows:

TwinCAT project
1. Insert a TcCOM module under System->TcCOM Objects and select type TcNtpExternalTimeProvider in the category External Time Provider.
NTP provider 1:
2. The module requires a task from which it is called. This is parameterized via the Context tab of the module:
NTP provider 2:
The TcCOM module can be parameterized:

NTP provider 3:

The configuration takes place in the Parameter (Init) tab. The parameters have the following meanings:

Client Para:

This module passes a determined offset to TwinCAT via the ITcSetExternalTime interface. In addition, outputs are available for mapping.

NTP provider as NTP server

Optionally, the same module can also act as an NTP server. Thus, a time signal can be obtained from an external NTP server (as a client) and simultaneously provided to lower-level systems.

For the external server, the NTP protocol typically requires a minimum query time of 8 seconds or more. The NTP provider as NTP server, on the other hand, allows more frequent query intervals.

NTP provider 4:

Server function

The server functionality is normally hidden. It can be displayed and configured via Show Hidden Parameters:
NTP provider 5:

The following parameters are used to adjust the NTP information provided. By default, the parameters are set as specified in the protocol; they can be overwritten here:

Filter function

If offsets are determined by the NTP server query, the module can independently perform a transition from the old offset to the new offset.

This functionality is normally hidden. It can be displayed and configured via Show Hidden Parameters:

NTP provider 6:

The following parameters apply if "Linear" is selected as eMode:

Diagnostics

Diagnostic information can be viewed under the Parameters (Online) tab.

NTP provider 7:

For each line there is a corresponding description in the Comment column.

In addition, corresponding symbols are available for programmatic evaluation:

NTP provider 8: