4. Configuration
179
When called, the function will read the clock current value and fill the DATEANDTIME structure.
The function returns the reading result.
Example in ST:
PROGRAM UserPrg
VAR
xStatus
: RTC_CMD_STATUS;
DateAndTime : EXTENDED_DATE_AND_TIME;
xRead
: BOOL;
END_VAR
--------------------------------------------------------------------------
IF (xRead = TRUE) THEN
xStatus := GetDateAndTime(DateAndTime);
xRead := FALSE;
END_IF
GetDayOfWeek
The GetDayOfWeek function reads the day of the week.
Output Parameters
Type
Description
GetDayOfWeek
DAYS_OF_WEEK
Returns the day of the week. See RTC Data
Structure - DAYS_OF_WEEK
Table 4-123. Output Parameters
When called, the function reads the day of the week and fills the DAYS_OF_WEEK structure.
Example in ST:
PROGRAM UserPrg
VAR
DayOfWeek
: DAYS_OF_WEEK;
xRead
: BOOL;
END_VAR
--------------------------------------------------------------------------
IF (xRead = TRUE) THEN
DayOfWeek := GetDayOfWeek();
xRead := FALSE;
END_IF
GetTimeZone
The GetTimeZone function reads the time zone settings.
Input and Output
Parameters
Type
Description
TIMEZONE
TIMEZONESETTINGS
Structure with the time zone value, read from
the CPU. See section RTC Data Structure -
TIME ZONE SETTINGS.
Table 4-124. Input and Output Parameters
Output Parameters
Type
Description
GetTimeZone
RTC_CMD_STATUS
Returns the setting/reading result. See
RTC_CMD_STATUS
Table 4-125. Output Parameters
When called, the function reads the time zone current setting and fills the TIMEZONE structure. The
function returns the reading result.