IEC 61131-3 and PLC programming languages
What IEC 61131-3 standardises, the ST, LD, FBD and SFC languages, how they are named in TIA Portal, CODESYS and TwinCAT, and when to use which.
What IEC 61131-3 is
Part 3 of IEC 61131 defines the syntax and semantics of PLC programming languages and a common program model: data types, variables, program organisation units (POUs), configurations, resources and tasks. The current edition is IEC 61131-3:2025 (4th); the previous one is from 2013. Among other things the new edition adds UTF-8 strings.
The standard provides a common vocabulary, not full portability: each environment has extensions, its own libraries and project formats. PLCopen XML is used for exchange.
Languages
| Language | Kind | Strengths |
|---|---|---|
| ST (Structured Text) | textual, Pascal-like | calculations, loops, arrays, algorithms |
| LD (Ladder Diagram) | graphical, relay logic | discrete logic, familiar to electricians, easy online diagnostics |
| FBD (Function Block Diagram) | graphical, blocks and wires | control loops, analog processing, interlocks |
| SFC (Sequential Function Chart) | structuring element | step sequences: steps, transitions, actions |
IL (Instruction List) was declared deprecated in the 2013 edition and is not among the languages listed in the 2025 edition. New projects are not written in IL.
Names in different environments
| IEC 61131-3 | Siemens TIA Portal | CODESYS / TwinCAT 3 |
|---|---|---|
| ST | SCL | ST |
| LD | LAD | LD |
| FBD | FBD | FBD / CFC (free layout) |
| SFC | GRAPH | SFC |
| IL | STL (S7-300/400/1500, not identical to IL) | IL (deprecated) |
SCL is close to ST but differs in details: local variables accessed with #, instance DB calls, its own system functions. See the Function Block Generator, which renders the same block for different platforms.
ST example
IF StartCmd AND NOT Fault THEN
Run := TRUE;
ELSIF StopCmd OR Fault THEN
Run := FALSE;
END_IF;
FOR i := 1 TO 10 DO
Sum := Sum + Values[i];
END_FOR;
Choosing a language
- Discrete logic that commissioning engineers and electricians will read — LD or FBD.
- Maths, strings, arrays, protocols — ST.
- Process sequences — SFC or a state machine in ST (
CASE State OF). - Languages mix freely in one project: an FB written in ST is called from an LD program.
Tools
- Function Block Generator — motor and valve blocks for Generic IEC, Siemens SCL, CODESYS and TwinCAT.
- PLC Code Reviewer — static analysis of ST/SCL.
- PLC Project Diff — ST/SCL and PLCopen XML.
Connections
Open in Knowledge Graph →Loading the map…
Sources
Updated 2026-10-01