RTC
®
5 PC Interface Board
Rev. 1.9 e
10 Commands And Functions
530
innovators for industry
Normal
List Command
time_fix_f_off
Function
stores in a buffer the current time and date of the RTC
®
clock/calender or a forward-dated
date and time for use with
.
Call
time_fix_f_off( FirstDay, Offset )
Parameters
FirstDay
This parameter (an unsigned 32-bit value) defines the starting number for
determining the Julian calendar day from the current date of the RTC
®
calendar:
Counting proceeds from
FirstDay
to
FirstDay
+ 364 (+1 for leap years).
Offset
forward dating in
seconds
(as an unsigned 32-bit value);
allowed range: [0 … (2
32
–
1)]
Comments
• Before calling
time_fix_f_off
,
, synchronization of the RTC
®
5
and PC time should be performed (at least once after each
) via
.
• The complete time can be marked through multiple calls of
complete date through multiple calls of
. The commands
time_fix_f_off
,
must therefore be called
before
these marking commands so
that the to-be-marked time or date won’t change during marking.
• If
time_fix_f_off
,
are not called again before a time or date
marking, then the last marked time will be marked again. If
time_fix_f_off
aren’t called at all after a
, then a time of 00:00 or a date
of January 1, 2000 will be marked.
• If
Offset
= 0, then the current date and current time are fixed. One practical use of
forward dating (
Offset
> 0) is for setting a date of expiry based on the current date.
Backdating (
Offset
< 0 ) isn’t possible.
RTC
®
4
RTC
®
5 new command
Version info
Last change with version DLL 524, OUT 526
References
,
Ctrl Command time_update
Function
sets the RTC
®
5’s 24-hour clock and calendar to the current PC time.
Call
time_update()
Comments
• The RTC
®
5 board’s clock doesn’t contain a battery backup. Therefore, the
time_update
command must be called after each
if the RTC
®
5’s 24-hour clock
and calendar are to be calibrated.
• The base value for internal time counting is set to January 1, 2000, 00:00 by
whereas to the PC time by
time_update
. An internal seconds
counter is set to 0 via
or via
time_update
, but is always driven by
the quartz-controlled 10
µ
s clock.
or
, you must call
or
so that the current time can be captured (as sum of the base value and
the current value of the internal seconds counter) and formatted.
RTC
®
4
RTC
®
5 unchanged
(the command was previously only available for the RTC
®
SCAN
alone Board, i.e. the
standalone version of the RTC
®
4 board)
References
,