Glossary · PLC and control programming
Structured text (ST)
Also known as: ST, Structured Text language
German: Strukturierter Text (ST)
In IEC 61131-3, structured text (ST) is a high-level textual programming language with a syntax similar to Pascal, providing assignments, IF and CASE statements, loops, and calls of functions and function blocks.
- PLC programming
- Standards
In one sentence
Structured text (ST) is the Pascal-like textual language of IEC 61131-3 for calculations, loops and complex logic.
Example
A CASE statement in ST implements the eight states of a labeling machine, and a FOR loop averages the last ten weight measurements.
How it applies
- Engineering: ST is the preferred language for calculations, data handling, string processing, loops and state machines. It is also used inside SFC actions and transitions and for IEC 61499 algorithms. Object-oriented features of IEC 61131-3 are mostly used through ST.
- Tooling: As text, ST works well with version control, diff tools, static analysis and code generation. AI coding assistant tools can produce ST code, which then needs review and testing like any other code.
- Timing: Loops in ST run within one PLC cycle. Unbounded or very long loops can exceed the cycle time and trigger the watchdog.
- Documentation: ST code can be commented thoroughly, and documentation generators can extract comments into reference documentation. Agree on a comment convention so the extraction produces usable text.
ST vs. graphical languages
ST expresses complex logic compactly but is less visual for technicians who troubleshoot online. Many projects write data processing in ST and interlocks in Ladder diagram (LD) or Function block diagram (FBD).