Lecture 6’s sequence
6.1 Counter Instructions
6.2 Up-Counter
6.3 Down-Counter
6.4 Cascading Counters
6.5 Incremental Encoder-Counter Applications
6.6 Combining Counter and Timer Functions
6.1. Counter Instructions
Programmed counters serve the
same function as mechanical
counters.
Every time the actuating lever is
moved over, the counter adds one
number.
Resetting to zero is done with a pushbutton located on the side of the unit.
6.1. Counter Instructions
Electronic counters can count-up,
count down, or be combined to
count-up and down.
Although most counters used in industry
are up-counters, numerous applications
require the implementation of down-
counters or of combination up/down-
counters.
6.1. Counter Instructions
All PLC manufacturers offer some
form of counter instruction.
One common counter application is
keeping track of the number of items
moving past a given point.
6.1. Counter Instructions
PLC counters can be programmed 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 down-counter is decremented the counter is energized.
by 1 each time the rung containing
the counter is energized.
Lecture 6’s sequence
6.1 Counter Instructions
6.2 Up-Counter
6.3 Down-Counter
6.4 Cascading Counters
6.5 Incremental Encoder-Counter Applications
6.6 Combining Counter and Timer Functions
6.2. Up Counter
The up-counter is used to count false-to-true transitions of an input
instruction and then trigger an event after a required number of counts
or transitions.
The up-counter output instruction will
increment its accumulated value by 1
each time the counted event occurs.
6.2. Up Counter
Up-Counter timing diagram
6.2. Up Counter
A one-shot, or transitional, contact is often used to automatically clear
or reset a counter.
The one-shot can be triggered
from a momentary signal or
from a signal that comes on
and stays on for some time.
It stays on for one scan only and then goes off.
It stays off until the trigger goes off, and then
comes on again.
6.2. Up Counter
Some PLCs provide transitional contacts or one-shot instructions.
The off-to-on transitional contact
provides a one-shot pulse when the
trigger signal makes a off-to-on
transition.
The on-to-off transitional contact
provides a one-shot pulse when
the trigger signal makes a on-to-
off transition.
Lecture 6’s sequence
6.1 Counter Instructions
6.2 Up-Counter
6.3 Down-Counter
6.4 Cascading Counters
6.5 Incremental Encoder-Counter Applications
6.6 Combining Counter and Timer Functions
6.3. Down Counter
A down-counter will count down or decrement by 1 each time the counted
event occurs.
Down-counter timing diagram
6.3. Down Counter
Normally the down-counter is used in conjunction with the up-counter to
form an up/down counter.
Up-down counter timing diagram
6.3. Down-Counter
Program that provides continuous monitoring of items in process.
The accumulated count of the counter
continuously indicates the number of
in-process parts.
Lecture 6’s sequence
6.1 Counter Instructions
6.2 Up-Counter
6.3 Down-Counter
6.4 Cascading Counters
6.5 Incremental Encoder-Counter Applications
6.6 Combining Counter and Timer Functions
6.4. Cascading Counters
Depending on the application, it
may be necessary to count events
that exceed the maximum number
allowable per counter instruction.
One way of accomplishing this
count is by interconnecting, or
cascading, two counters.
Lecture 6’s sequence
6.1 Counter Instructions
6.2 Up-Counter
6.3 Down-Counter
6.4 Cascading Counters
6.5 Incremental Encoder-Counter Applications
6.6 Combining Counter and Timer Functions
6.5. Incremental Encoder-Counter Applications
The incremental optical
encoder creates a series of
square waves as its shaft is
rotated.
The encoder disk interrupts
the light as the encoder
shaft is rotated to produce
the square wave output
waveform.
6.5. Incremental Encoder-Counter Applications
Cutting objects to a specified length
The object is advanced for a
specified distance and measured
by encoder pulses to determine
the correct length for cutting.
Lecture 6’s sequence
6.1 Counter Instructions
6.2 Up-Counter
6.3 Down-Counter
6.4 Cascading Counters
6.5 Incremental Encoder-Counter Applications
6.6 Combining Counter and Timer Functions
6.6. Combining Counter and Timer Functions
Example 1: Automatic stacking program
In this process, conveyor M1 is used to stack metal plates onto conveyor M2. The
photoelectric sensor provides an input pulse to the PLC counter each time a metal plate
drops from conveyor M1 to M2. When 15 plates have been stacked, conveyor M2 is
activated for 5s by the PLC timer. The operation of the program can be summarized as
follows:
When the Start button is pressed, Conveyor
M1 begins running.
After 15 plates have been stacked, conveyor
M1 stops and Conveyor M2 begins running.
After conveyor M2 has been operated for
5s, it stops, and the sequence is repeated
automatically.
6.6. Combining Counter and Timer Functions
Example 2: Product flow rate program:
This program is designed to indicate how many parts pass a given process point per
minute. The operation of the program can be summarized as follows:
When the start switch is closed, both the timer and counter are enabled.
The counter is pulsed for each part that passes the parts sensor.
The counting begins and the timer starts timing through its 1-minute time
interval.
At the end of 1-minute, the timer done bit causes the counter rung to go
false.
Sensor pulses continue but do not affect the PLC counter.
The number of parts for the past minute is represented by the accumulated
value of the counter.
The sequence is reset by opening and closing the start switch.
6.6. Combining Counter and Timer Functions
Example 3: Motor lock-out program
This program is designed to prevent a machine operator from starting a motor due to
overload condition that has tripped off more than 5 times in an hour. The operation of the
program can be summarized as follows:
The normally open overload (OL) relay contact momentarily
closes each time an overload current is sensed.
Every time the motor stops due to an overload condition, the
motor start circuit is locked out for 5 min.
If the motor trips off more than 5 times in an hour, the motor
start circuit is permanently locked out and cannot be started
until the reset button is actuated.
The lock-out pilot light is switched on whenever a permanent
lock-out condition exists.
Stop button is used to stop operation of the system any time.