TimeSynchronization

BACnet TimeSynchronization may be based upon the local time. In this case both the time master and the time recipients must be location within the same time zone. If the devices are located in different time zones, UTC-TimeSynchronization may be used instead. For this, the property UTC_Offset in the device object must be set to the offset in minutes to UTC. In addition, daylight saving information must be provided by the device and must be calculated in addition to the UTC time.

Implementing a BACnet server does normally not require any specific action. In case a TimeSynchronization message is received, the internal controller clock is updated.

If the controller is acting as a time master, the function block FB_BACnet_Adapter provides two methods to synchronize clocks in other BACnet devices.

TimeSync

TimeSyncEx

TimeSynchronization is an unconfirmed service. A response from the time recipients to the time master is not expected. All devices receiving the time synchronization message shall adjust their local clock.

Example for a time master functionality:

VAR
    stDateTimeSync : ST_BA_DateTime;
    bSuccess : BOOL;
    bSync : BOOL;
END_VAR
------------------------------------------------------------------
If bSync then
    bSync := FALSE;
    bSuccess := BACnet_Globals.DefaultAdapter.TimeSync(pDateTime := ADR(stDateTimeSync), bSendBroadcast := TRUE);
END_IF