4. Configuration
182
RTCStatus := SetTimeZone (TimeZone);
xWrite := FALSE;
END_IF
ATTENTION:
To set the clock, use time and date values within the following valid range: -12h59min to 13h59
min, otherwise it reports an error through the STATUS output parameter. For further details on the
STATUS output parameter, see the correspondent section.
RTC Data Structure
The RTC Reading and Setting function blocks of Hadron Xtorm Series CPU use the following data
structure.
EXTENDED_DATE_AND_TIME
This structure is used to store the RTC date when using function blocks for date reading/setting
purposes:
Structure
Type
Variable
Description
EXTENDED_DATE_
AND_TIME
BYTE
byDayOfMonth
Stores the day of the month of set date.
BYTE
ByMonth
Stores the month of the set date..
WORD
wYear
Stores the year of the set date.
BYTE
byHours
Stores the hour of the set date.
BYTE
byMinutes
Stores the minutes of the set date.
BYTE
bySeconds
Stores the seconds of the set date.
WORD
wMiliseconds
Stores the milliseconds of the set date.
Table 4-130. EXTENDED_DATE_AND_TIME
DAYS_OF_WEEK
This structure stores the day of the week when using the function for date reading purposes:
Enumerator
Value
Description
DAYS_OF_WEEK
0
INVALID_DAY
1
SUNDAY
2
MONDAY
3
TUESDAY
4
WEDNESDAY
5
THURSDAY
6
FRIDAY
7
SATURDAY
Table 4-131. EXTENDED_DATE_AND_TIME
RTC_CMD_STATUS
This enumerator returns the type of error in the RTC reading/setting: