Up and down counters pdf




















Or how many products has been produced. PLC counters are also used to assist logging to SCADA systems by counting the amount of times these events has happened or setting alarms when an event has happened a certain amount of times. With all that said timers are very useful and it is crucial for every PLC programmer to know the basics of counting in a PLC program. In this article I will explain how counters work, and how you can use them in your PLC programs.

Before you start counting in any PLC program there are some basics you should know first. These are basic information about the counter instructions and the PLC itself. Counters use variables of certain data types to store numbers in the PLC. All counters need to store at least two numbers:.

Since these two numbers are saved in a certain data type they also have their limits. A signed integer also takes up 16 bits, but the first one is used for signing, so you will only have 15 bits for the actual number. The maximum value of the signed integer is Although it is rare that you will need to count to such high numbers, it is still important know to avoid overflow errors. This often happens with encoders and other high speed components. In this case you will need a special input module for high frequency speed signals.

These input modules are better known as high-speed counters and they are built to capture inputs of various high frequencies. All counter operations or counter function blocks has some inputs and some outputs. In fact, I talked about two of them before counter limit and current counter value.

What is important to know here is which data type the inputs and outputs take. The first counter instruction I will introduce you to is the up counter, also known as just CTU. As the name implies, this PLC counter is used for counting up. By using our site, you agree to our collection of information through the use of cookies. To learn more, view our Privacy Policy.

Log In Sign Up. Download Free PDF. Kamal Anoune. Download PDF. A short summary of this paper. If all we did not care about maintaining an accurate total count of objects past 25 — but merely wished the program to indicate when 25 objects had passed by.

With each sensor pulse received, the counter instruction decrements. When it reaches zero, the Q output activates. A potential problem in either version of this object-counting system is that the PLC cannot discriminate between forward and reverse motion on the conveyor belt.

If, for instance, the conveyor belt were ever reversed in direction, the sensor would continue to count objects that had already passed by before in the forward direction as those objects retreated on the belt. If two light beams are oriented parallel to each other, closer than the width of the narrowest object passing along the conveyor belt, we will have enough information to determine direction of object travel:. This is called quadrature signal timing, because the two pulse waveforms are approximately 90 deg one-quarter of a period apart in phase.

A Ladder Diagram PLC program designed to interpret the quadrature pulse signals is shown here, making use of negative-transition contacts as well as standard contacts:.

This is known as divide by 4 circuits or mod 4 ripple counter. By this, we can conclude that — If there are n FFs then the output frequency will be divide by 2 n. Also generate 2n unique states. So the frequency division basically forms counting state. Here we are seeing that the output of the 1st FF act as clock for 2nd FF. Suppose the FF takes 30ns for generating output i. Therefore, the output of second FF will be obtained after 60 ns.

So the propagation delay is ripples through the FFs and becomes more when the number of FFs increases. Therefore, asynchronous counter are too slow for generating big counting. As we know, when the output state i.



0コメント

  • 1000 / 1000