User guide

AB
17
Chapter
171
Timer and Counter Instructions
This chapter covers the following timer and counter instructions for use with
all processors except where noted:
Timer On-Delay (TON)
Timer Off-Delay (TOF)
Retentive Timer On-Delay (RTO)
Count Up (CTU)
Count Down (CTD)
HighSpeed Counter (HSC) fixed controller only
Counter or Timer Reset (RES)
Timers and counters are output instructions. They include:
Timer On-Delay (TON). It counts timebase intervals when the rung is
true and resets when the rung is false (nonretentive). The timebase is
selectable as 0.01 sec or 1.0 sec for SLC 5/02 processors, and set at 0.01
sec for fixed controllers and SLC 5/01 processors. See page 173.
Timer Off-Delay (TOF). It counts timebase intervals when the rung is
false and resets when the rung is true (nonretentive). The timebase is
selectable as 0.01 sec or 1.0 sec for SLC 5/02 processors, and set at 0.01
sec for fixed controllers and SLC 5/01 processors. See page 174.
Retentive Timer On-Delay (RTO). An on-delay timer which retains its
accumulated value when the rung goes false. See page 175.
Count Up (CTU). The count increments at each false-true transition of
the rung. See page 177.
Count Down (CTD). The count decrements at each false-true transition
of the rung. See page 177.
HighSpeed Counter (HSC). A special CTU counter for use with fixed
controllers having 24 VDC inputs. See page 179.
Counter or Timer Reset (RES). This instruction resets the accumulated
value and status bits of a counter or timer. It cannot be used with TOF
timers. See page 1713
.
Timer and counter instructions have 3-word data file elements, illustrated on
pages 172 and 177. Word 0 is the control word, containing the status bits
of the instruction. Word 1 is the preset value. Word 2 is the accumulated
value.
The accumulated value is the current number of timebase intervals that have
been measured for a timer instruction; for a counter instruction, it is the
number of false-totrue transitions that have occurred. The preset value is
the set point that you enter in the timer or counter instruction.
When the accumulated value becomes equal to or greater than the preset
value, the done status bit is set. You can use this bit to control an output
device.
Timer and Counter
Instructions Overview