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.

Automotive IoT Security: Staying Safe in a Connected Car

For today’s hackers, mobile apps can turn smartphones into unlocking devices for your car whether they’re authorized or not. Car sharing apps can be hacked to find users’ routes, including how much they tipped their drivers. According to a survey from the RSA Conference in March, 84% of people know that the primary means of transportation they use everyday can be hacked remotely like the above two examples. Subscribe to Automation-Talk by Email.

The public is also getting a better sense of how such attacks can happen, as shown by the 82% of RSA respondents who felt that hacking mobile apps connected to their smartphone and car was the most likely point of entry. Any third-party apps could be dangerous, but third-party stores on your car’s infotainment system are typically easier to hack than the App Store on your smartphone.

Vulnerability in Connected Cars

According to the graphic below on application protection for connected cars, the abundance of microprocessors in modern vehicles greatly expands the number of attack points a hacker could make. Whether it’s another connected car, smartphone, or even a smart traffic light, there are plenty of potentially hackable external sources that could transmit information to your own connected vehicle every day.

I’m not sure how many consumers would end up jailbreaking their own car, but some of the other tips on the graphic are worth keeping in mind before you drive, like making sure you regularly check for updates on your car’s infotainment system.

Automotive IoT Security: Staying Safe in a Connected Car

Monitor PLC Scan Time in Delta PLC

Sometimes it necessary and need of time to monitor PLC scan time in PLC program, so for such situations there are some special register (D) in Delta PLC which help in performing such tasks. D1000 is such a special register which is used for monitoring PLC scan time. When the scan time exceeds the set time in the monitor timer, the red ERROR LED indicator remains shining and all outputs will be “Off”. Subscribe to Automation-Talk by Email.

Monitor PLC Scan Time in Delta PLC

The initial set value of the time in the monitor timer is 200ms. If the Delta program is long or the operation is too complicated, MOV instruction can be used for changing the set value as shown in above image. The maximum set value in the monitor timer is 32,767ms. Users can add WDT instruction (API 07) into PLC program.

When CPU execution progresses to WDT instruction, the internal monitor timer is cleared as 0 and the scan time will not exceed the set value in the monitor timer. There is one more special register D1039 which is for Fixed Scan Time and will be discusses later.

Industrial Process Controllers Presentation

This is a good presentation on Industrial Process Controllers which will focus on temperature controllers and there working, different types of controllers like On-Off, Proportional & PID. The presentation will explain all these terms in detail and will tell about there working too. Subscribe to Automation-Talk by Email.

PID controller provides proportional action with two additional adjustments, integral and derivative, which helps the unit automatically compensate for changes in the system.

Recommended Article: Configure Real Time Trend In Intouch SCADA

A temperature controller gets input from temperature sensor such as a thermo-couple or RTD. It compares the actual temperature to the desired control temperature, or set point, and provides an output in the form of transistor output or relay.


Free PLC Softwares for Ladder Logic Programming

There are lots and lots of PLC (Programmable Logic Controller) available in the market and many PLC companies are emerging day by day with their own make and model PLC's and HMI. The best part is that they also provide free copies of their PLC software for your use. You can download the free PLC software from their website and can start learning their instructions, though the logic of all the ladder programming is same and you won't be having any issue in using this software's. Subscribe to Automation-Talk by Email.

Free PLC Softwares for Ladder Logic Programming

Even if you are not a experienced PLC programmer and still searching for job in automation industry, then you should try these free ladder logic programming software to increase your knowledge and programming skills. Why you should stick to only 1-2 brands of PLC's when you can try many different PLC's logic.

Recommended Article: Best PLC Ladder Programming Books

Big automation companies like Siemens, Allen Bradley, Omron etc. do not provide their PLC and HMI software for free, you have to buy license of their software's. So it is better to have goods hands-on some of the freely available software's.

Free PLC Software for Ladder Logic Programming

1. Delta PLC Software: Delta PLC's are very popular due to their cheap cost and easy handling. Delta automation provides its PLC software WplSoft for free. Any one can download their software without any login.

2. TRiLOGI: This is one of the best ladder logic learning software for students and any student or university can use this software free of charge by just writing an email to software company.

3. Cscape Free PLC Software: This PLC software is from Horner Automation group which deals in all-in-one controllers, remote I/O, expansion etc.

Cscape is a free PLC software with drag and drop feature. It is very easy to use and you can download this software by just creating an account with them.

Cscape Free PLC Software

This software combines graphical ladder diagram programming based on IEC-1131 with operator interface development to completely integrate the control package which is definitely a great feature.

4. Eware32: This software is from Entertron Industries Inc. and work with Entertron's ePLCs only as other software's. This software also has free simulator option so it can even work without any PLC hardware.

Eware32 Free PLC Software

5. KV-Ladder Builder : This is a PLC programming software from Keyence and is freely available at their website. You can download the software by creating account with them. This software also have a simulator mode, so you don't require actual PLC to test your ladder programs.

Recommended Article: Best Free Web Based Online SCADA Software

6. Do-more Designer Programming Software: This software is freely available and is from Automation Direct. This software work well in Windows XP, Windows 7 and Windows 8 also both 32 or 64-bit versions. When connected to internet it automatically checks for software and firmware updates.

There are lot more other free PLC software's available and you can download them from their official websites. If they are not full version at least you can get trail version for testing. I hope you enjoyed this article and it will benefit you in your programming and trying different flavors of PLC's. Please leave your feedback's and comments and also subscribe to our email subscription for free to get latest update on email.

Allen Bradley SST Card Connection to DH+ Network

Here is a cable diagram or connection diagram of SST card connection to the DH+ Network. 6 Pin Connector connects to the card and 3 pin connector connects to the device. Line 2 of 6 pin connector is the line closest to the LED on the SST PCI card. Subscribe to Automation-Talk by Email.

Allen Bradley SST Card Connection to DH+ Network

As shown above, both Line2 and Line1 of six pin connector are shorted and connects to Line1 and Line2 of three pin connector. Shield is connected to shield in both the connectors. If you like this, do not forget to share it with your friends. Do subscribe to receive more such connection diagram directly on your email.

Keyence CZ-V20 Series RGB Digital Fibreoptic Sensors

Hey fellows, you would be happy to know that Keyence has come up with smartest RGB sensor in automation industry. This series of smart sensors is called CZ-V20 Series. If you are having color sensing problem with your current sensor, then you should check features of this sensor as well, may be it's time to change your color sensor. Subscribe to Automation-Talk by Email.

Keyence CZ-V20 Series RGB Digital Fibreoptic Sensors

First we would like you to answer below questions.

1- Does you color sensor fail to sense Black/white object?
2- Fed up with malfunctioning of color sensor on wavy surfaces like conveyors?
3- Problem in detection of color on glossy surface?
4- Sensor breakage due to lower mounting height?
5- Finding it difficult to teach your color sensor?
6- Is your sensor limited to sense only 2 to 4 colors?

If your answer is yes to the above questions, then you should check this revolutionary product from Keyence. They have come up with a revolutionary hybrid technology with their all new CZ Series RGB Colour sensors.

Features of CZ Series RGB Colour sensors


1. Luster Detection and Transparent Target Detection- NEW
This is new feature and has new amplifier for the CZ-H72 luster detection sensor head. Stable luster detection unaffected by target color.

2. FILM mode for detecting presence/absence of films.

3. Response frequency 200┬Ás.

4. One unit can detect 4 different glossy levels.

5. Extremely high power.

6. Extra ordinary sensing range of 90mm.

CZ series has 3 models viz. CZ-H32, CZ-H35S and CZ-H37S with different detecting area, Smallest spot diameter etc. These color sensors are very light and just weight approx 40g to 45g.

These sensors can easily differentiates colors flawlessly, even if surface is glossy or uneven. Just one press of a button, you can teach 8 different colors to this sensor. With ‘Super i’ mode, this sensor can also sense black and white colors.

Applications of CZ Series RGB Colour sensors

These sensors can be widely used in different application such as detecting marks on bags printed with multiple colours, differentiation between the front and back sides of chips after being sealed in embossed tape, detecting the presence/absence of grease, detecting the seam on a spray can, detecting a mark on a tube, checking parts assembly, detecting improperly positioned labels, detecting caps of different colours etc.

If you are interested, do check its product catalog, which can be downloaded from

Do let us know what are your thoughts about these color sensor and will you be interested to use them or take demo. Do subscribe to our newsletter for more such industry news and products update.

Get New Updates

Enter your email address:

Delivered by FeedBurner

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