PLC Ladder Logic FAQs: A Practical Path from Beginner to Mastery

This engineering brief provides answers to common questions regarding the use of ladder logic for Programmable Logic Controllers (PLCs) and smart relays.

Is ladder logic still used?

Yes, the majority of PLCs offered by DigiKey may be programmed in ladder logic.

Note that ladder logic is one of five IEC 61131-3 languages as described in this note

Is ladder logic worthy of study?

Let’s get down to business and answer that hard question first. Your time is precious, and you need to know if the IEC 61131-3 Ladder Logic (LL) language is worthy of study.

Without question, LL is worthy of study!

Let me explain by providing you with a bit of my background. I’ve been an electronics technician, an engineer, a professor, and now serve as a DigiKey application engineer. I’ve struggled with ladder logic including old relay controls and I have seen people struggle with learning. My background allows me to make this statement across multiple levels.

When we boil everything away and look at the very core of industrial control system, we conclude that system downtime is the overriding factor determining which language should or should not be used. We chose the language best suited to the task at hand.

  • If we were to group all control systems based on complexity, we would see a lopsided distribution with many relatively simple PLCs on one side gradually tapering off to complex controls on the other. By the numbers, simple control systems vastly outnumber complex ones.

  • If you are reading this, you are likely a novice, an instructor, or someone ready to pounce on the eternal PLC language debate. Assume you are a novice; you should start with the most straightforward language.

  • Time is limited. This is especially true for education of both technicians and engineers. The PLC portion of the curriculum is typically limited to one, maybe two if we include advanced classes or independent study. There may also be an opportunity to showcase the PLC as part of a capstone. Either way, the graduate rarely has time to truly learn the PLC and associated hardware.

  • Speaking of hardware, the PLC lives within a larger environment of relays, sensors, and actuators. In many respects this external ecosystem reflects the PLC’s internal LL. To study one is to reinforce the other. We also recognize the deeply entrenched international use of ladder logic to describe both hardware and software. For example, the first transmitter I worked on had over 100 rungs in its control system. All relay-based with mechanical cams and counters for the complex operations. As an example, consider this TechForum post exploring the 3-Wire Start-Stop Circuit.

  • System down time is extraordinarily expensive. A broken machine will burn hundreds to thousands of dollars per minute in idle operator time, material waste, restart and stabilization time, opportunity cost, loss or goodwill, and overtime pay to get back on target.

When we holistically consider all factors, the technician’s skill is the foundation upon which all other considerations rest. In the end, it is the technician’s ability to troubleshoot and restore your systems that support the use of ladder logic.

Tech Tip: Nearly every LL development tool includes a real-time graphical display showing the state of every contact, coil, and timer within the program. This is an indispensable troubleshooting tool. Almost every novice technician can intuit the program to troubleshoot a machine. Here we assume that a novice technician will have access limited to relatively small machines. For sake of conversation, let’s define “small” as less than 100 rungs.

Tech Tip: There is a counterargument that LL is limited to smaller machines. Fair enough, at some level of complexity, the programmer will shift portions or perhaps all program elements to Structured Text (ST). This may reduce the technician’s ability to follow the code. However, at some point we recognize that data structures and flow require advanced understanding of higher-level language typically associated with an advanced computer science degree. Then again, what good is a software specialist that doesn’t understand the hardware? This brings us back to LL.

Is ladder logic easy to learn?

Yes, you can learn the basics in a few days and program the PLC to perform rudimentary logic and time-based tasks. However, mastery of ladder logic will take you the proverbial 10,000 hours. As described by Malcolm Gladwell, this is approximately equivalent to a serious 4-year apprenticeship. Also, as I implied above, ladder logic is not something that is learned in isolation. You must also learn the PLC and how the PLC is connected to the outside world.

Personally, I struggle to understand the complex interaction between machine, operator, and PLC control. As a simple example, how do we handle a machine with a faulty pneumatic solenoid? How do we safely handle the situation when the user breaks a light curtain? Also, how do we add fail-safe redundancy for when the PLC itself fails?

We could rightly claim that it will take a lifetime to learn ladder logic.

How can I get started with ladder logic?

When I was teaching, I always had my students start with PLC Fiddle. If you look closely at Figure 1, you can see the “code School” in the upper left-hand corner. It is well worth your time to explore these elementary lessons. You will find that these lessons carry over to a real PLC albeit with a manufacture-specific change in syntax especially concerning the timers.

Figure 1: Classic implementation of the pushbutton-based start stop motor controller.

Tech Tip: PLC Fiddle was built for sharing. It works especially well in the classroom as students can share a URL. For example click here to open the ladder logic from Figure 1.

How can I master ladder logic?

This is the same question as the player who asks the coach how to get good at basketball.

Practice, Practice, and more PRACTICE!

  • You will need to purchase a PLC and write programs to control real-world devices.

  • Find a mentor. Volunteer to work in the electronics shop. Request assignment to small projects. Enthusiastically show interest and see where it takes you.

  • This field guide contains links to OEM catalogs along with mentors and wizards who provide passionate online materials

  • Study the PLCopen guidelines to better understand what others think about the various programming styles.

  • There is value in learning other PLC IEC 61131-3 languages. Personally, I find this helpful as learning a new language helps with pattern recognition. As an exercise, you could construct parallel structures such as a state machine in ladder, structured text, or sequential function block. A side benefit is that we learn which language works best for each application. This is useful for PLCs that allow mixed language support.

Parting thoughts

PLC programming is like most things in life. At first glance it’s conceptually easy, just like placing the basketball into the hoop. However, to become good takes thousands of hours of deliberate practice.

Please help us improve this FAQ by adding your questions in the space below.

Also, let us know if we missed something.

Best wishes,

APDahlen

Related information

Please follow these links to related and useful information:

About this author

Aaron Dahlen, LCDR USCG (Ret.), serves as an application engineer at DigiKey. He has a unique electronics and automation foundation built over a 27-year military career as a technician and engineer which was further enhanced by 12 years of teaching (interwoven). With an MSEE degree from Minnesota State University, Mankato, Dahlen has taught in an ABET-accredited EE program, served as the program coordinator for an EET program, and taught component-level repair to military electronics technicians. Dahlen has returned to his Northern Minnesota home and thoroughly enjoys researching and writing articles such as this.