Programming instructions

77
16 bit counters
Presets
Presets are the number of times the rung driving the counter has to go
through a FALSE to TRUE state transition before turning on.
16 bit counters have a range of 1 to 32,767.
Counter presets can be either a K constant, or a variable, such as a data
or file register. Having a D device as the preset allows an operator to
make changes to the counter preset from an HMI.
The accumulated value of the timer never goes above the preset value.
Once the counter coil has turned on, it will remain on until reset. Even the
use of the Decrement instruction to reduce the count will not deactivate
the counter coil.
Counting direction
16 bit counters only count up.
Reset
The accumulated value of a counter returns to 0 when the RST C#
instruction is activated.
Counters addressed from C100 ~ C199 are latched counters and retain
their count even at power down. C0 ~ C99 will lose their counts at power
down unless they have been declared as battery-backed in PLC
Parameters
Limitations
Counter negative number presets are not permitted.
The only way to make a counter count down is to use the DECP
instruction prior to the counter reaching its preset. Once the counter coil is
turned on, the only way to turn it off is to use the RST instruction. The
counter will appear to count down, but the counter coil will not turn off.
Using the INCP instruction will make the counter count up and count pass
the preset. However, the counter coil will not be activated by reaching the
preset with the INCP instruction. The final count must come from a
FALSE to TRUE transition of the counter rung.