Ladder diagram (LD) has long held the crown as king of the IEC 61131-3 programming languages, and for good reason. Its electrical schematic-style visuals and straightforward logic have long made it the go-to language for control systems using programmable logic controllers (PLCs), especially in North America.
Familiarity holds some staying power for LD, but it remains a practical choice for machine builders and system integrators who prioritize ease of maintenance.
Ladder logic forms the bulk of code for most customer software at Dynamic Motion Control (DMC). “It’s familiar and easy to troubleshoot for the majority of the industry,” says Patrick Smith, senior project engineer at DMC, a CSIA-certified system integrator, who has worked with manufacturers of all sizes since 1996.
Unless an original equipment manufacturer (OEM) plans to own the long-term maintenance of a machine or is selling its aftermarket service to end users with the machines, it’s essential to consider the skill set of the end user and the maintenance techs’ abilities.
Most maintenance teams that DMC works with are comfortable with LD, with some experience working with other languages. “DMC always provides the full source code to customers, allowing them to make their own changes and more easily troubleshoot, so taking the needs of their maintenance team into account is a key part of our programming approach,” says Smith, who notes it makes customers happy and saves middle-of-the-night phone calls if a machine stops working.
“Ladder is typically used for applications that involve discrete logic control, such as turning a valve on or off or programming a state machine that involves a sequence of operations,” says Imran Mohamed, motion control application engineer at Yaskawa America. “Automation tasks demand deterministic execution, real-time control and robust safety functions. IEC 61131-3 languages provide the clear and structured approach that is essential for these requirements. It's not uncommon for safety logic to be written exclusively in ladder diagram for this reason.”
The visual of LD represents the electrical flow or schematic, so it’s a way to truly visualize the system. “A picture is worth a thousand words, so the ladder diagram has all the boxes and every representation of the electrical flow,” says Hoat Phung, senior application engineer at ABB. Many younger engineers come out of college with experience in languages like Python, but industrial customers still look to LD for simplicity, largely for ease of maintenance.
“That visual nature is really nice and especially good for when you start playing back recorded data, where you can start to see ‘this is normally open, and it’s closed, or ‘this is normally closed, and it’s open,’” says Thomas Kuckhoff, senior product manager at Omron. “It can help people troubleshoot really nicely.”
The choice of programming language can depend on how the PLC is being used in the application. “You’ll see some PLCs that are locked away behind a ton of firewalls, a separate network,” explains Kuckhoff. “No one touches it for years, and it’s doing the same thing all the time. But then you see some that are not on open networks, but larger factory networks that are required to comply with strict cybersecurity requirements.” This means updates and version control are needed. With all that involved, it’s time to pause and evaluate which way is best for everyone to interact with the code.
“How does this PLC integrate into the entire ecosystem?” asks Kuckhoff. “What's the complexity of this program? What's this skill set of the team that's going to be, of course, developing it, but primarily the maintenance team? And when it comes to that maintenance and those production engineers, what also are they familiar with?”
Newer programming tools and methods are also altering how engineers use LD. “LD is often considered easier to read and troubleshoot, though it may not scale as efficiently as other languages. However, modern programming features such as labels, label groups, program organization units (POUs), and function blocks make it possible to structure and scale applications effectively, even when using LD,” says Tim Hider, industry marketing manager for smart manufacturing and digital solutions at Mitsubishi Electric Automation.
Get your subscription to Control Design’s daily newsletter.
The industrial workforce is also changing, as younger engineers are bringing new skill sets to controls, at the same time as industry is embracing new technology, which is often influenced by the software world and text-based languages like structured text (ST). “It is also important to know your audience,” says Casey Taylor, software product manager at Beckhoff Automation. “Who will need to read and support your code? What will be the easiest for them to understand? Don’t assume this will always be ladder. More of the workforce has been exposed to text-based programming of various types than ever before, and this shift makes them more comfortable with a wider range of languages.”
Taylor also reminds programmers not to forget about code management. Tools for version control are often built around text-based languages. Ultimately, Beckhoff sees the human-machine interface (HMI) as the best diagnostic tool for troubleshooting and maintenance of complex systems. “This is the first and best place for maintenance teams to troubleshoot a system. If you can avoid having maintenance staff get into the code, you should. That said, the programming language inside the system will matter if changes are made in the future,” Taylor says.
“The choice of programming language also relies on the OEM’s support model,” explains Mohamed. “Some OEMs expect the end user to take full ownership of the machine’s source code and modify the program in the field as needed. However, not all OEMs or end users operate this way. In some cases, OEMs retain ownership of the source code and version control to ensure consistency across multiple plants operating in different geographic locations.”
The more complex the machine, the less the knowledge of the maintenance staff matters, Mohamed says, and less of that work may be done by maintenance crews in the future. “Even if a maintenance technician is familiar with a programming language, it doesn’t necessarily mean they understand how the software works,” Mohamed explains. “There is always a tradeoff between the risks and outcomes associated with allowing code edits on a production line. It’s the responsibility of the developer to carefully assess these risks and outcomes before committing to a particular language for a project.”