Counters
Counters
Counter Definition:
A counter is a PLC instruction that either increments (counts up) or decrements (counts
down) an integer number value when prompted by the transition of a bit from 0 to 1
(“false” to “true”).
Counter come in three basic types:
➢ up counters
➢ down counters
➢ up/down counters.
Both “up” and “down” counter instructions have single inputs for triggering counts,
whereas “up/down” counters have two trigger inputs: one to make the counter increment
and one to make the counter decrement.
Counters
Counters will increment their present count value when input signals are triggered from OFF→ON.
Counters are provided as built-in elements in PLCs and allow the number of occurrences
of input signals to be counted. This might be where items have to be counted as they pass
along a conveyor belt, or the number of revolutions of a shaft, or perhaps the number of
people passing through a door.
Forms of counter
A counter is set to some preset number value and, when this value of input pulses has
been received, it will operate its contacts. Thus normally open contacts would be closed,
normally closed contacts opened. There are two types of counter, These are up-counters
and down-counters. Up-counters count from zero up to the preset value, i.e. events are
added until the number reaches the preset value. When the counter reaches the set value,
its contacts change state. Down-counters count down from the preset value to zero, i.e.
events are subtracted from the set value. When the counter reaches the zero value, its
contacts change state. Most PLCs offer down counting.
The above figure shows a block-formatted counter. The instruction block indicates the type of counter (up or
down), along with the counter’s preset value and accumulated or current value. The counter has two input
conditions associated with it, namely, the count and reset. All PLC counters operate, or count, on the leading
edge of the input signal. The counter will either increment or decrement whenever the count input transfers
from an off state to an on state. The counter will not operate on the trailing edge, or on-to-off transition, of the
input condition.
Some manufacturers require the reset rung or line to be true to reset the counter, whereas others require it to be
false to reset the counter. For this reason, it is wise to consult the PLC’s operations manual before attempting
any programming of counter circuits. PLC counters are normally retentive; that is, whatever count was
contained in the counter at the time of a processor shutdown will be restored to the counter on power-up. The
counter may be reset, however, if the reset condition is activated at the time of power restoration.
PLC counters can be designed to count up to a preset value or to
count down to a preset value. The up-counter is incremented by 1
each time the rung containing the counter is energized. The down-
counter decrements by 1 each time the rung containing the
counter is energized. These rung transitions can result from events
occurring in the program, such as parts traveling past a sensor or
actuating a limit switch. The preset value of a programmable
controller counter can be set by the operator or can be loaded into
a memory location as a result of a program decision.
Explanations:
1. When the CNT instruction is executed from OFF to ON, which means that the counter coil is
driven, and should thus be added to the counter’s value; when the counter achieved specific set
value (value of counter = the setting value), motion of the contact is as follows:
2. If there is counting pulse input after counting is attained, the contacts and the counting values
will be un unchanged. To re-count or to conduct the CLEAR motion, please use the RST instruction.
SS2
series:
1-When X0 = ON, RST
instruction resets C0.
2-Every time When X1 is driven,
C0 will count up (add 1).
3-When C0 reaches the preset
value K5,output coil Y0 will be
ON and C0 will stop counting and
ignore the signals from input X1.
a) X10 drives M1200 to determine counting
direction (up / down) of C200
b) When X11 goes from OFF to ON, RST
instruction will be executed and the PV
(present value) in C200 will be cleared and
contact C200 is OFF.
c) When X12 goes from Off to On, PV of
C200 will count up (plus 1) or count down
(minus 1).
d) When PV in C200 changes from K-6 to K-
5, the contact C200 will be energized. When
PV in C200 changes from K-5 to K-6, the
contact of C200 will be reset.
e) If MOV instruction is applied through
WPLSoft or HPP to designate a value bigger
than SV to the PV register of C0, next time
when X1 goes from OFF to ON, the contact
C0 will be ON and PV of C0 will equal SV.