Chapter 5 - Programming Counters
Chapter 5 - Programming Counters
5.2 Up-Counter
5.3 Down-Counter
5.5 Examples
5.1. Counter Instructions
Resetting to zero is done with a pushbutton located on the side of the unit.
5.1. Counter Instructions
5.2 Up-Counter
5.3 Down-Counter
5.5 Examples
5.2. Up Counter
5.2 Up-Counter
5.3 Down-Counter
5.5 Examples
5.3. Down Counter
5.2 Up-Counter
5.3 Down-Counter
5.5 Examples
5.5. Incremental Encoder-Counter Applications
5.2 Up-Counter
5.3 Down-Counter
5.5 Examples
5.6. Examples
Example 2: Parts are moving on the conveyor from one process line to other with a constant
speed. Out of 1000 parts, one part is taken out for quality check. Implement automation of this
process in PLC using Ladder Diagram programming language:
To detect the parts, detector such as
proximity switch, optical sensors is used.
Give this detection, as an input to Up
Counter which is incremented with each
part’s detection.
Set counter preset value to 1000.
Operate Solenoid for a few seconds until the
part is diverted for quality check.
5.6. Examples
Example 3: Objects are moving on a conveyor 1. When an empty box is detected, conveyor starts
and 5pcs are packed in a box. When box is filled, it is carried to the storage area via conveyor 2.
Implement automation of this process in PLC using Ladder Diagram programming language:
Use proximity switches to detect moving objects on the conveyor 1 and to detect an empty box on conveyor 2.
Use counter to count number of objects to be packed.
Use timer such that when 5pcs are detected,
conveyor runs for a while and stops when 5th
object is finally collected in the box.
When number of parts to be packed are detected
timer is activated. When timer is over, it stops the
conveyor until next empty box is detected.
Assuming time taken by the last 5th object is
2secs to be collected.
5.6. Examples
Example 4: 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:
Example 5: 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.
5.6. Examples
Example 6: Different objects are moving on a conveyor belt. Let’s say, circular
balls, square blocks and rectangular blocks. All three types of objects are collected
in the same sized box. As these types are different in size and shapes as well,
number of objects to be placed are different for each type. Set counter value
according to different sized objects’ detection. Implement automation of this in
PLC using Ladder Diagram programming language.
5.6. Examples
Example 8:
5.6. Examples
Example 9: 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:
Example 10: When I0 is on conveyor Q0 will be on. If only I3 lower sensor is on and after that I4 sensor
gets on, stopper 1 forward Q1 will be on. When stopper 1 final position reed switch I6 gets on then Q1
will be off and reverse valve Q2 will be on.
If I2 and I3 both sensors get on together and after that I4 sensor gets on, nothing will happen. When I5
sensor gets on stopper 2 forward Q3 will be on. When stopper 2 final position reed switch I7 gets on
then Q3 will be off and reverse valve Q4 will be on. I1 is an emergency stop button.
5.6. Examples
Example 11: I0 is start push button, I1 is stop push button, I2 lower sensor, I3 upper sensor, I4 filling position
bottle detector, I5 capping position bottle detector, I6 labelling position bottle detector, Q0 is conveyor, Q1 is
filling valve, Q2 is single acting stopper 1, Q3 is capping output, Q4 is single acting stopper 2, Q5 is laser
printer output and Q6 is single acting falling bottle ejector.
When I0 is pressed conveyor will be on. When I2 and I3 are on together and I4 is on, Q1 and Q2 will get on for
5 second. After this when I5 is on then Q3 and Q4 will be on for 2 seconds. After this when I6 is on then Q5
will be on for half second. If only I2 will get on, then Q6 will be on for 1 second. If neither I2 nor I3 gets on for
30 seconds, then system will get off automatically. I1 is for emergency stop.