Statement: clears, Statements: clock1 and clock0 – Rockwell Automation 1771-DB Basic Module User Manual - Series A User Manual
Page 54

Operating Functions
Chapter 5
5–17
Mode:
COMMAND/RUN
Type: CONTROL
The CLEARS statement resets
all of the module’s stacks. The
control,
argument and internal stacks all reset to their initialization
values. You can use this
command to reset the stack if an error occurs
in a subroutine.
Important: When the
CLEARS statement is LISTed it appears as
CLEAR S.
Mode: COMMAND AND/OR
RUN
Type: CONTROL
CLOCK1
The CLOCK1 statement enables the real time clock
feature resident
on the BASIC Module.
The special function operator TIME is
incremented
once every 5 milliseconds after the CLOCK1 statement is
executed. The CLOCK1 STATEMENT uses an internal TIMER to
generate an interrupt once every 5 milliseconds.
Because of this, the
special
function operator TIME has a resolution of 5 milliseconds.
The special
function operator TIME counts from 0 to 65535.995
seconds.
After reaching a count of 65535.995 seconds TIME
overflows
back to a count of zero. The interrupts associated with the
CLOCK1 statement
cause the module programs to run at about 99.6%
of normal speed.
That means that the interrupt handling for the REAL
TIME
CLOCK feature uses about .4% of the total CPU time.
CLOCK0
The CLOCK0 (zero)
statement disables or “turns off” the real time
clock feature. After CLOCK0 is executed,
the special function operator
TIME no longer
increments. CLOCK0 is the only module statement
that can disable the real time clock. CLEAR and
CLEARI do NOT
disable the real time clock, only
its associated ONTIME interrupt.
Important: CLOCK1 and CLOCK0 are independent of the
wall
clock.
5.4.4
Statement: CLEARS
5.4.5
Statements: CLOCK1
and CLOCK0