PLC Counter Instructions | Type and Examples

PLC Counter Instructions | Type and Examples

In this article we have studies for PLC counter instructions with their type and examples, in an earlier tutorial, we have studied timer instruction with their types.

What is the PLC Counter?

A counter is a PLC instruction that either increment (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 instructions come in three basic types: up counters, down counters, and up/down counters.

Typer of Counters

Counter instructions come in three basic types:
  1. UP Counters,
  2. Down Counters, and
  3. UP/Down Counters.

1. UP Counters

Up counter is an increment counter. which means it counts “up” with each off-to-on transition input to its “CU” input.


plc counter


Whenever there is a true value entry in the CU input, the counter will turn on and CV will display the count. This counter output must be activated whenever the current value is equal to or greater than the preset value (Q is active if CV ≥ PV). The counter output instruction will increase by 1 each time the counted event occurs.

Example of UP Counter:

Up counters are usually used to keep track of how many times an event has happened. Let’s say you want a process to complete 5 times before cleaning needs to happen.

For this you have to set the counter limit (PV) to 5. Each time the process has completed you will give a pulse on the count input (CU). When the process has completed 5 times, the output (Q) will be set. Now you can use that output to for example set an alarm that the system needs cleaning.

When cleaning is done you can give a pulse on the reset input (R) and you can now start over again.

2. Down Counters

The down counter counts from the preset value to zero. It decreases the pulse or number.


plc counter


The down-counter instruction will count down or decrease by 1 each time the counted event occurs. Each time the countdown event occurs, the accumulated value decreases. Normally, the down counter is used together with the ascending counter to form an up / down counter.

Example of Down counter:

Imagine you have a semi-automatic process where the operator needs to do a manual task to start a process. The process needs to be completed 5 times but when there is 2 times left the operator needs to inspect. It is important that the operator can see how many processes are left, since the total amount of processes can vary.

This is where the down counter comes in handy. What you need to do here is to assign the total amount of process times to the counter limit (PV) and then give at pulse at the load input (LD). Now you have to total amount as the current counter value (CV).

Every time the process has completed you give a pulse on the count input (CD). You can now use CV to show the operator how many processes are left. When he can see that there are 2 lefts, he needs to inspect. Additionally, you can even add an alarm by comparing CV to 2 with an equality operator.

3. UP/Down Counters

The up-down counter counts the value from zero to the preset value or from the preset value to zero.


plc counter

The up / down counter has a “reset” input (R) and a “load” (“LD”) input to force the current value. Activating the reset pin forces the counter to set zero, activating the load input forces the current value of the counter to the preset value (PV).

Example of UP/DOWN counter:

One way of using the up down counter is to count finished products. Say you want to produce a certain number of products in a batch control system. But after every product is finished a manual inspection is needed. If a product is discarded, you will have to subtract it from the number of finished products.

For this you can use the up down counter. Every time a product is finished you can give a pulse at the count up input (CU). But if at inspection the product fails the quality test you can give a pulse at the countdown input (CD) to decrement the number of products produced.

PLC Counter Applications:

  • Bottle Filling Plant
  • Parking Space Application
  • Sequential Controller Application

Conclusion

This is all the information about the counter function in PLC programming. I hope you like this blog, if you want more tutorial about PLC programming then please comment down below.


PLC Related More Articles


Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.