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

LanguageKindStrengths
ST (Structured Text)textual, Pascal-likecalculations, loops, arrays, algorithms
LD (Ladder Diagram)graphical, relay logicdiscrete logic, familiar to electricians, easy online diagnostics
FBD (Function Block Diagram)graphical, blocks and wirescontrol loops, analog processing, interlocks
SFC (Sequential Function Chart)structuring elementstep 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-3Siemens TIA PortalCODESYS / TwinCAT 3
STSCLST
LDLADLD
FBDFBDFBD / CFC (free layout)
SFCGRAPHSFC
ILSTL (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

Loading the map…

Sources

  1. IEC 61131-3:2025 Programmable controllers — Part 3: Programming languages — IEC
  2. PLCopen — IEC 61131-3 — PLCopen
  3. CODESYS Standard library documentation — CODESYS GmbH

Updated 2026-10-01