Time synchronization
In this description, the term time stands for the combination of date and time (Date and Time).
BACnet time synchronization
In BACnet, time synchronization is performed via two services:
TimeSynchronization synchronizes the time based on the local time, i.e. the timer and the time receiver must be in the same time zone.
When using UTCTimeSynchronization (UTC=Universal Time Coordinated) the time is transmitted as GMT (Greenwich Mean Time = local time London). The timer converts the time to GMT before sending. Using the local settings UTC_Offset and DaylightSavingsStatus (in the device object of the server), the time receiver then converts back to the local time.
UTC_Offset specifies the value in minutes relative to GMT. A positive value is to be used westward from GMT, a negative value eastward from GMT.
Western Europe has an offset of -60 minutes from GMT. This is set as the default value in the TwinCAT BACnet server and may have to be adjusted when used in other time zones with the use of UTC.
![]() |
|
TwinCAT as BACnet time receiver
If a TwinCAT controller receives a BACnet time synchronization, the internal time of the controller is set with this time.
TwinCAT as BACnet timer
If a TwinCAT controller is used as a BACnet timer, it must determine the exact time from an external location, e.g. by using the NTP service on an external NTP server (NTP = Network Time Protocol). For example, time.windows.com is available as a publicly available time server.
The method TimeSyncEx im FB_BACnet_Adapter
is available for taking over the time and, if necessary, broadcasting in the network.
The following values are passed to the call as parameters:
Name | Type | Description |
---|---|---|
pDateTime | ST_BA_DateTime | Pointer to a structure of type ST_BA_DateTime (see library Tc3_BA2_Common). In this structure the date and time to be set is passed or returned in case of eSyncMode = 3. |
eSyncMode | E_BACnet_TimeSyncMode | Enumeration
|