Nov 7, 2016

PLC Programming For Counting Encoder Pulses

PLC Programming For Counting Encoder PulsesEncoder is mainly used for feedback purpose to know the position and distance measurement in Industrial applications. But before going in to the PLC Programming we should be familiar with Types of Encoder , Interfacing of Encoder with PLC.

PLC Programming For Counting Encoder Pulses / Feedback:-

Actually encoder is mounted on the shaft whose position we want to determine or want to monitor its value. Encoder have some PPR and they gives accordingly that number of pulses in one revolution.

Note:- The coupling of encoder with shaft should be done properly for accurate measurement otherwise the efficiency will decrease or it can even destroy.

PLC Logic Development:-

Now we will see the step by step detail for making the PLC Program. First of all we have to decide the condition that when should the counting start i.e when the pulses given by Encoder will be counted. Generally we want this at the auto-cycle start , So here we are considering at Auto Bit ok condition , however it can be done as per application requirement.

We here are considering the example of Omron PLC CP1H, in every PLC there is a Instruction for counting the high speed pules, In Omron it is PRV , so we will write PRV Instruction.

In PRV we have to define the port number where we have connected the Encoder and control Data. After that the value(encoder pulse value) will coming in one Data Register of PLC.

Now we have to decide as what to do this value. Let us take one example , suppose our encoder is of 360PPR i.e it will give 360 pulses in one revolution, Encoder is connected to motor shaft which is driving a conveyor and after every ever 300mm conveyor will stop and a cylinder will come down to cut.

So first we will calculate that in 1 revolution of encoder how much the conveyor moves.

If in 360 pulses conveyor moves 100 mm then we find that , for 1080 pulses of encoder conveyor moves 300mm.

Note:- Settings in the CX-Programmer.

So, after every 1080 pulses we will stop the motor and on the cylinder output and simultaneously reset the Encoder value, and continue this process. We will compare the Encoder Pulse value with the 1080 and at when they equal, motor stops, cylinder down and encoder value reset and motor again runs.

We have made the PLC Program accordingly. See the PLC Program below, we have included both the .cxp and .pdf files.

Download the PLC Program.

Also if you face any problem then you can leave us a comment. You can subscribe to get all related PLC Programs, SCADA Tutorials, HMI, VFD Installation related articles in yours inbox. Subscribe to Automation-Talk by Email for more such articles.

Advertisements :-


  1. how to use encoder ladder progaram

  2. I got some wonderful knowledge from this post, as it contains some useful details which is good for knowledge. Thanks for posting it. Magnetic coupling


Receive all updates via Facebook. Just Click the Like Button Below