PLC COUNTERS
Types of PLC counters
There are two main types of PLC counters, the count-up counter, and the count-down counter.
For the counter-up counters, we have a counter file name, a counter preset value, a counter accumulated value, a counter count-up bit, and a counter done bit.
For the counter-down counters, we have the same bits and values. The only thing that is different is the counter-down bit on the output. As you can see below, we have this as counter-up bit for the counter-up counter.
![PLC counter tags](https://cdn.prod.website-files.com/65f854814fd223fc3678ea53/65f854814fd223fc3678f67d_Types-of-PLC-counters.jpeg)
There are also two internal memory bits of counter overflow and counter underflow which we’ll discuss later in this article.
PLC counter values
The counter file name is a PLC tag. This tag is where you can find the counters preset and accumulated values and the counters count-up, count-down, done, overflow, and underflow bits.
![PLC counter tags](https://cdn.prod.website-files.com/65f854814fd223fc3678ea53/65f854814fd223fc3678f68e_PLC-counter-tags.jpeg)
Some PLCs create the counter file name for you, and other PLCs have you create the counter file name.
For example, RSLogix 500 creates the counter file name for you but when using Studio 5000, you need to create the counter file name.
![PLC counter file name](https://cdn.prod.website-files.com/65f854814fd223fc3678ea53/65f854814fd223fc3678f693_PLC-counter-file-name.jpeg)
For all of my counter examples, I will use the counter file name Counter1. I will also use a momentary push-button to trigger the counters.
![PLC counter example](https://cdn.prod.website-files.com/65f854814fd223fc3678ea53/65f854814fd223fc3678f68b_PLC-counter-example.jpeg)
For all of my PLC counter examples, I will be using Studio 5000, which is the PLC programming software for Allen Bradley ControlLogix PLCs. But the things that you will learn here in these examples, can be applied to any other PLC software. Because the overall counter functions are similar to any other PLC brand.
![Studio 5000 PLC counter](https://cdn.prod.website-files.com/65f854814fd223fc3678ea53/65f854814fd223fc3678f690_Studio-5000-PLC-counter.jpeg)
Count-up counter
For the first example, I will talk about the count-up counter. I will start by adding a count-up counter instruction to a PLC program rung.
![Count-up counter instruction](https://cdn.prod.website-files.com/65f854814fd223fc3678ea53/65f854814fd223fc3678f6bf_Count-up-counter-instruction.jpeg)
I will also add the momentary push-button input to this rung to trigger the counter.
![Momentary push-button input](https://cdn.prod.website-files.com/65f854814fd223fc3678ea53/65f854814fd223fc3678f666_Momentary-push-button-input.jpeg)
I’ll type Counter1 for the counter name, and type five into the preset value to finish setting up this counter.
If you need any help with downloading the program, there are plenty of videos that show you how to do that. Just give YouTube a good search and you can easily find those videos.
Comments
Post a Comment