4. Configuration
178
ATTENTION:
The function blocks for RTC (RTC (NextoGetDateAndTime, NextoGetDateAndTimeMs,
NextoSetDateAndTime e NextoSetDateAndTimeMs) reading and writing cannot be used in the area
of redundant data in redundant projects. The function blocks can be used only in non-redundant
POUs, as the POU NonSkippedPrg. For more details on the functioning of POU NonSkippedPrg see
NonSkippedPrg.
Function Blocks for RTC Reading
The clock reading can be made through the following functions:
GetDateAndTime:
Figure 4-81. Date and Hour Reading
Input and Output
Parameters
This variable returns the value of date and
hour of RTC in the format shown at Table
4-123
Table 4-114. Input and Output Parameters of GetDateAndTime
Returns the function error state, see Table
4-125
Table 4-115. Output Parameters of GetDateAndTime
Utilization example in ST language:
PROGRAM MainPrg
VAR
Result : RTC_STATUS;
DATEANDTIME : EXTENDED_DATE_AND_TIME;
xEnable : BOOL;
END_VAR
--------------------------------------------------------------------------
IF xEnable = TRUE THEN
Result := GetDateAndTime(DATEANDTIME);
xEnable := FALSE;
END_IF
GetTimeZone
The following function reads the Time Zone configuration, this function is directly related with time
in Time Zone at SNTP synchronism service.
Figure 4-82. Configuration Reading of Time Zone