While ladder diagram (LD) reigns supreme among IEC 61131-3 languages, especially in the United States, in part due to its wide use and recognition, structured text (ST) is finding more room in industrial applications. ST is also more widely used in Germany and across Europe and Asia.
A growing number of engineers and integrators everywhere are making the case for ST, particularly for applications that demand more complex data handling and modularity at scale. LD won’t be replaced anytime soon, but ST is gaining momentum, helping engineers take on more software-centric tasks and embrace flexibility for array manipulation, loop and algorithms.
As an integrator, DMC prioritizes programming that is accessible and modifiable by its customers. “As such, we typically default to ladder logic, as it’s the industry standard in our main service area of the United States,” says Patrick Smith, senior project engineer at DMC, a CSIA-certified system integrator. “We then identify any logic that would be best served by structured text. In particular, we focus on logic that either would be excessively hard to read in ladder or is self-contained enough that it should not have to be frequently investigated as part of troubleshooting.” DMC uses ST for functionality that leverages its strengths, such as working with arrays and other complex structures.
ST shines for data handling. “It can be written compactly, which is helpful when working with a large amount of data,” explains Smith. “It has built-in support for control structures like for loops that make working with large datasets, such as arrays, much easier.” Because it is text-based, programmers can more easily use other development tools like integrated development environments (IDEs) to quickly generate large amounts of repetitive code.
“Over time, structured text is seeing more usage due to how flexible it is, and how it can integrate with other tools,” Smith continues. “In particular, startup companies that are often coming from a traditional tech background usually prefer structured text, as it looks more familiar and can better integrate with tools they are experienced with.”
Get your subscription to Control Design’s daily newsletter.
Structured text is better suited for implementing loops, algorithms and other computationally demanding tasks,” agrees Imran Mohamed, motion control application engineer at Yaskawa America. “Among the IEC 61131-3 programming languages, structured text offers the greatest flexibility for data-handling tasks, particularly when performing operations such as array manipulation and nested loops capabilities that are essential for data parsing and to establish communication interfaces,” he explains.
An array is a powerful type of data structure, used to store and manage similar types of data, such as sensor readings or status flags. An array is a structured list of elements, all the same data type, organized by index. Think of a row of mailboxes, each one numbered and holding a specific piece of mail, or value. Arrays are efficient for data handling because they manage multiple inputs or outputs of the same data type and store a history of readings.
“Arrays are best handled through structured text,” says Ken Crawford, senior director of automation at Weidmuller. “The least capable data-handling language would be ladder.”
In ST, arrays can simplify repetitive logic and enable more dynamic programming. The indexes can be variables, so arrays support flexible logic, which is great for test sequences. Arrays also support modular programming and can handle structured, repeatable and dynamic data.
Casey Taylor, software product manager at Beckhoff Automation, says it’s important to provide the option to program in all languages of the IEC standard, but ST is the most commonly used language among Beckhoff’s customer base. “Once a programmer learns how to create code in structured text, it typically becomes the language of choice,” Taylor says. “Other languages do have their strengths depending on the use case.”