
UM-0085-B09
DT80 Range User Manual
Page 39
RG
Internal Maintenance
There are several internal maintenance channels, which are read in the same way as normal channels. These allow, for
example, the terminal voltage of the DT80's internal batteries to be measured. See the Internal Maintenance section of
the DT80 Channel Types table
.
System Timers
There are four internal reloading system timers, which are read in the same way as channels. The four timers increment
at the following rates, and reset to zero when their range (maximum value) is reached:
System Timer
Channel Type
Increments Every Default range
Provides
1
1ST
1 second
60 (1 minute)
Second of the minute
2
2ST
1 minute
60 (1 hour)
Minute of the hour
3
3ST
1 hour
24 (1 day)
Hour of the day
4
4ST
1 day
7 (1 week)
Day of the week: (0 = Sunday, 1= Monday, etc.)
System timers are normally synchronised to the previous midnight or Sunday, and increment at the beginning of each
second, minute, hour or day. If the DT80's date/time is set, the system timer channels will be updated to match the new
time.
The range of a system timer can be set using the channel factor. For example,
2ST(15)
will count from 0 to 14,
resetting every quarter hour, on the quarter hour. If the range is set to 0 then the timer will not reset, except at midnight
(
1
-
3ST
) or midnight Sunday (
4ST
)
If a system timer is explicitly set to a value, e.g.
1ST=12
, then it will no longer necessarily be synchronised to the actual
time. In this example, after being set
1ST
will count up from 12 to 60, at which point it will reset back to 0 and start
counting again. It will always differ from the time-of-day seconds count by a fixed offset.
If a system timer's range is set, it will automatically be resynchronised to the actual time. Therefore
2ST(60)
can be
entered at any time to return
2ST
to its default behaviour. If a system timer is set to a value outside its range, it is
immediately adjusted so that it is in range. When you enter nST=x, you are actually doing
n
ST
=x
mod
range
. Thus
2ST=62
will actually set
2ST
to 2.
Examples
Assume the time is now 12:34:56. Then:
2ST
2ST 34
(34 minutes past the hour – counter resets on the hour)
2ST(0)
2ST 754
(754 minutes since midnight – counter resets at midnight only)
2ST(22)
2ST 6
(754 mod 22 – counter resets at midnight and every 22 minutes thereafter)
2ST=1
2ST 1
(counter is no longer synchronised to midnight)
2ST(22)
2ST 6
(setting range value resynchronises timer to current time)
2ST
will now increment every minute, resetting back to 0 each time it reaches 22. When midnight comes around, it will
again be reset to 0.
Delay
It is often useful to insert a fixed delay into a DT80 program. There are two ways of doing this, each for a particular
Executing Commands in Schedules (P59)
, there is a distinction between
channel definitions
and
commands
. Channel definitions (
1V
,
T
,
5SDI12
etc) are executed as part of a schedule. Any commands (
U
,
G
,
DELDATA
etc.) triggered by the schedule (using
ALARM
or
DO
statements) will be queued but not executed until the
schedule completes.
The DELAY=n channel definition will insert a delay of n ms between two channel definitions. For example:
RA20S 1WARN=1 DELAY=1000 1WARN=0
will turn on the Attn LED, wait one second, then turn it off. (There are more better and more compact ways to do this, e.g.
1WARN(1000,R)=1
; the above is simply to illustrate a point.)
On the other hand, the PAUSE n command will insert a delay of n ms between two commands. The following will do a
similar thing to the previous example:
RA20S DO{SATTN; PAUSE 1000; CATTN}