What’s next – Rockwell Automation 1771-DB BASIC MODULE User Manual

Page 130

Advertising
background image

Chapter
Expressions, Variables and Operators

9

9 -20

You can change the fraction portion of TIME by manipulating the contents
of internal memory location 71 (47H). You can do this by using a
DBY(71) operator (page 9 -18). Note that each count in internal memory
location 71 (47H) represents 5 milliseconds of TIME.

>DBY(71) = 0

:REM FRACTION OF TIME = 0

>PRINT TIME

READY

>RUN

0

>NEW

>DBY(71) = 3

:REM FRACTION OF TIME = 3*5ms = 15 ms

>PRINT TIME

READY

>RUN

1.5 E-2

Only the integer portion of TIME changes when a value is assigned.
This allows you to generate accurate time intervals. For example, to create
an accurate 12-hour (43200 seconds) clock use an ONTIME statement
(page 11 -25). When the TIME interrupt occurs, the statement TIME 0 is
executed, but the millisecond counter is not re-assigned a value.
If interrupt latency exceeds 5 milliseconds, the clock remains accurate.

Commands

10

What’s Next?

Advertising