5. CONFIGURATION
PROGRAM UserPrg
VAR
DayOfWeek : DAYS_OF_WEEK;
END_VAR
--------------------------------------------------------------------------
DayOfWeek := GetDayOfWeek();
5.8.1.2. RTC Writing Functions
The clock settings are made through function and function blocks as follows:
5.8.1.2.1. SetDateAndTime
SetDateAndTime function is used to write the settings on the clock. Typically the precision is on the order of hundreds of
milliseconds.
Figure 131: Set Date And Time
Input parameters Type Description
REQUEST BOOL
This variable, when receives a ris-
ing edge, enables the clock writing.
DATEANDTIME
EXTENDED_DATE
_AND_TIME
Receives the values of date and
hour with milliseconds. See section
165.
Table 161: Input Parameters of SetDateAndTime
Output parameters Type Description
DONE BOOL
This variable, when true, indicates
that the action was successfully
completed.
EXEC BOOL
This variable, when true, indicates
that the function is processing the
values.
ERROR BOOL
This variable, when true, indicates
an error during the Writing.
STATUS RTC_CMD_STATUS
Returns the error occurred during
the configuration. See Table 167.
Table 162: Output Parameters of SetDateAndTime
220