Prg_Main
The program Prg_Main
implements the execution of Prg_RTC_Control
and fbSntpClient
along with the assignment of the associated global variables to its input and output parameter. Further, the Prg_Main
contains the program logic to set the weekly drift for the RTC (Real-Time Clock) of the controller. The Prg_Main
itself is called cyclically within the MAST task.
Prg_RTC_Control
The program Prg_RTC_Control
implements the logic to control the RTC of the controller (including the timezone configuration) and provides input and output parameter so that the program can be called from another program.
The flowchart illustrates the running Prg_RTC_Control
on a controller:
Item |
Description |
---|---|
1 |
The timezone configuration parameter are stored in the non-volatile memory of the controller. The parameter set consists of:
NOTE: The value 0 represents the last Sunday of the month.
|
2 |
The operator or the application selects the which shall be set for the RTC of the controller. |
3 |
The time to set selected in Item 2 is converted to the UTC considering the timezone parameter with the use of the function |
4 |
If the application detects a rising edge of the command triggered by the |
5 |
In every program cycle, the RTC of the controller is read by the system function |
6 |
The read RTC value from the controller is converted to the local time considering the timezone parameter with the use of the function |
7 |
The read RTC value from the controller is converted into a structured and ergonomic format using the function |
8 |
The switching limits for the daylight saving time are calculated for the current year using the function |
9 |
With the use of the function |