Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 3

A Simple Counter

This counting routine is used to count the number of bottles moving along a
conveyor belt.

A Simple Counter

A Simple Counter
As the bottles move down the conveyor belt they break photocell PC1s
beam. Every time the beam is broken the input associated with PC1 (X000) is
turned ON. In the program this directly drives a counter. Here C000 is used to
log the number of bottles that have passed PC1. C000 has been given an upper
limit to which to count to. This may represent the total number of bottles to be
processed that day or shift. The example shows the limit to be 3000.
Once the counter reaches the limit it is signaled by the output coil of C000
being energized. To indicate this completion of the counting task to the outside
world, a contact of the counter C000 is used to drive the output Y000. This in
turn activates a STOP lamp, LP1, thus allowing the machine operators to
know that the target has been reached.
Because the counter retains its data, some method of resetting the current
count value is required. This is achieved by using the Reset push button, PB2.
PB2 is associated with input X001 and allows the counter to be set to zero. The
STOP lamp is turned OFF and the complete system is ready for the next 3000
bottles to pass by.

You might also like