The following libraries have been added to the Library Manager of the application:
Library |
Company |
Function |
---|---|---|
SysTimeRtc |
System |
Provides the components to manage the RTC (Real-Time Clock) of the controller. |
TimeSync |
System |
Implements the SNTP (Simple Network Time Protocol) client feature. It allows the controller to connect to a time server in order to synchronize the internal RTC of the controller. |
To implement the timezone management in this application example, additional functions and data types have been created which are not provided within a library. These functions and data types are available in the application in the folder Applications > POUs_And_Datatypes.
Additional functions and data types are listed in the following table:
Object name |
Type |
Description |
---|---|---|
ST_DateAndTime |
STRUCT |
Data type to provide the date and time in a structured and ergonomic format. |
ST_DstConfig |
STRUCT |
Data type to define the switching limits for the daylight saving time. |
ST_TimeZoneConfig |
STRUCT |
Data type to provide the timezone configuration parameter used by the conversion functions. |
FC_CreateDstParam |
Function |
This function is used to calculate the switching limits for the daylight saving time for the selected year. |
FC_DateTimeConcat |
Function |
This function is used to convert the date and time from the structured and ergonomic format into the UNIX time format. |
FC_DateTimeSplit |
Function |
This function is used to convert the date and time from the UNIX time format into a structured and ergonomic format. |
FC_LocalToUtc |
Function |
This function is used to convert the local time from a structured and ergonomic format to the UTC (Coordinated Universal Time) in UNIX time format. The selected timezone configuration parameters are considered during the conversion. |
FC_UtcToLocal |
Function |
This function is used to convert the UTC from the UNIX time format to the local time in a structured and ergonomic format. The selected timezone configuration parameters are considered during the conversion. |
Global variable list |
Description |
---|---|
GVL_RTC_Control |
Contains variable declarations for variables accessible in the project and which are not needed to be retained after a cold start of the controller. |
GVL_SntpClient |
Contains variables which are linked with the SNTP (Simple Network Time Protocol) client functionality. |
PersistentVars |
Contains the variable declaration of the configuration parameter. PersistentVars is of type Persistent list. This is a special type of a GVL (Global Variable List). It allows you to create variables whose values are retained even if an application download is performed. |