Real-time clock
RTC_Set
ADwin
188
ADwin-Gold II
, Manual February 2013
RTC_Set
RTC_SET
sets date and time on the real-time clock of the specified module.
Invalid values are not accepted.
Syntax
#Include
ADwinGoldII.inc
ret_val
=
RTC_Set
(
year
,
month
,
day
,
hour
,
minute
,
second
)
Parameters
Note
The instruction
RTC_Set
may only be used in a process section with low
priority.
See also
Valid for
Gold II-Storage
Example
#Include
ADwinGoldII.inc
LowInit:
REM Set real-time clock to July 4th, 2003 9:17:30
Par_1
=
RTC_Set
(
3
,
7
,
4
,
9
,
17
,
30
)
T11
year
Year (0…99), corresponds to 2000…2099.
LONG
month
Month (1…12).
LONG
day
Day (1…31); valid value ranges according to
month and leap year.
LONG
hour
Hour (0…23).
LONG
minute
Minute (0…59).
LONG
second
Second (0…59).
LONG
ret_val
Status for setting the real-time clock:
0: Date and time are set.
-1: Error, real-time clock may only be set in a low-
priority process.
-2: Error, no real-time clock present.
LONG