IEC 61131-3: PLC Languages, POUs, Tasks and Edition 4
A source-backed guide to the current IEC 61131-3 PLC programming standard and how vendor implementations differ.
IEC 61131-3 is the international standard that defines PLC programming-language syntax and semantics. The current publication is IEC 61131-3:2025, Edition 4, released on 22 May 2025. Its suite consists of Structured Text (ST), Ladder Diagram (LD) and Function Block Diagram (FBD), with Sequential Function Chart (SFC) elements for structuring programs and function blocks. Instruction List (IL), which appeared in Edition 3, is no longer part of the current suite.
Edition and source check (reviewed 25 July 2026): This guide follows the official IEC catalogue record for IEC 61131-3:2025 Edition 4. The IEC catalogue is the authority for the current edition and scope. Vendor support statements below are implementation notes, not claims that every listed tool implements every optional element identically.
What IEC 61131-3 Defines
The standard specifies five core elements:
- The current language suite — Structured Text (ST), Ladder Diagram (LD), Function Block Diagram (FBD), and Sequential Function Chart (SFC) structuring elements.
- A common data model — Elementary types (BOOL, INT, REAL), derived types, and structured types (ARRAY, STRUCT).
- Software organisation units (POUs) — Programs (PROGRAM), function blocks (FUNCTION_BLOCK), functions (FUNCTION).
- Task model — How POUs are assigned to tasks with priorities and cycle times.
- Configuration elements — Resources, tasks, global variables, and access paths.
Vendor tools implement IEC 61131-3 with different levels of fidelity and vendor-specific extensions. CODESYS-based tools generally expose the IEC model directly, while Siemens TIA Portal, Rockwell Studio 5000, Mitsubishi GX Works and Omron Sysmac Studio use their own naming, libraries and project conventions.
The Edition 4 Language Suite
1. Ladder Diagram (LD)
Visual language that mirrors relay-logic electrical diagrams. Contacts (input conditions) are drawn on the left; coils (outputs) on the right. The power flow from left rail to right rail represents the logic.
Best for binary logic, simple interlocks, maintenance-readable code. Most widely used language globally. Becomes unwieldy for complex math, loops, and data manipulation.
2. Function Block Diagram (FBD)
Graphical language that connects function blocks with wires. Each block performs a function (logic gate, timer, comparison, custom FB). Best for signal flow, control loops, filters, modular reusable code. Popular in process industries.
3. Structured Text (ST)
Text-based language resembling Pascal. Full support for IF/ELSE, FOR, WHILE, CASE, functions, and mathematical expressions. Best for complex algorithms, data manipulation, mathematical calculations, and string handling. Increasingly common in modern PLC projects. Version-control-friendly, diff-able, reviewable, searchable.
4. Sequential Function Chart (SFC) Elements
Graphical language for sequential processes. Steps (states) connected by transitions (conditions). Each step may have actions associated with entry, while-active, and exit. Best for batch sequences, startup/shutdown sequences, state machines. Dominant in process-industry recipe handling (ISA-88 aligned).
Legacy Note: Instruction List (IL)
Instruction List is an assembly-like textual language found in older PLC projects. Edition 3 included IL and marked it deprecated; the valid Edition 4 publication no longer lists IL in the language suite. Learn it only when maintaining legacy IL/STL-style code, and distinguish a vendor's legacy mnemonic language from current IEC compliance.
The Common Data Model
Every IEC-compliant PLC supports:
- Elementary types: BOOL, BYTE, WORD, DWORD, LWORD, SINT, INT, DINT, LINT, USINT, UINT, UDINT, ULINT, REAL, LREAL, TIME, DATE, TIME_OF_DAY, DATE_AND_TIME, STRING, WSTRING.
- Arrays: ARRAY [1..100] OF INT.
- Structures: Custom STRUCT definitions with named fields.
- Derived types: TYPE / END_TYPE declarations for reusable data shapes.
This common model is why logic written in one IEC-compliant vendor can transfer conceptually to another.
Software Organisation Units (POUs)
Three POU types:
Functions (FUNCTION) — Stateless. Input parameters and a return value. No internal memory between calls. Classic example: MAX (IN1, IN2) returns the larger of two values.
Function Blocks (FUNCTION_BLOCK / FB) — Stateful. Maintains internal memory between calls. You declare instances of FBs (similar to objects). Classic examples: TON (on-delay timer), CTU (counter), PID.
Programs (PROGRAM) — Top-level. Usually one program per task. May instantiate FBs, call functions, and manipulate global variables.
The Task Model
An IEC configuration has:
- Resources — Usually one per CPU.
- Tasks — Periodic or event-triggered execution contexts. Typical tasks: Main (every 10-100 ms), Fast (every 1-10 ms), EventTask (on specific interrupt).
- Programs assigned to tasks — Each task runs one or more programs per its cycle.
- Priorities — Higher-priority tasks preempt lower ones (vendor implementations vary).
This model is the reason "scan cycle" conversations become nuanced. Different logic runs on different tasks at different cycles. A well-designed PLC project splits logic intentionally across tasks rather than putting everything in one.
Variable Scopes
IEC defines several variable scopes:
- VAR — Local to a POU.
- VAR_INPUT — Input parameter.
- VAR_OUTPUT — Output.
- VAR_IN_OUT — Passed by reference.
- VAR_GLOBAL — Accessible across all POUs in a resource.
- VAR_EXTERNAL — Import of a VAR_GLOBAL into a POU.
- VAR_TEMP — Non-persistent between scan cycles.
Scope discipline matters for large projects. Abuse of VAR_GLOBAL is a leading cause of hard-to-maintain PLC code.
Standard Function Blocks
The standard defines common FBs every implementation must provide:
- Timers: TON (on-delay), TOF (off-delay), TP (pulse).
- Counters: CTU (up), CTD (down), CTUD (up/down).
- Triggers: R_TRIG (rising edge), F_TRIG (falling edge).
- Bistable: SR (set-dominant), RS (reset-dominant).
Vendors extend these with additional libraries (motion, safety, communication).
Vendor Compliance in Practice
Fully compliant: Codesys, Beckhoff TwinCAT, ABB Automation Builder, Bosch ctrlX, WAGO e!COCKPIT, Phoenix Contact PLCnext, Festo CECC, Eaton XSoft.
Mostly compliant with extensions: Siemens TIA Portal (S7-1200/1500). It uses Siemens-specific conventions such as SCL for structured text; legacy STL is a Siemens mnemonic language and should not be presented as a current Edition 4 IEC language.
Partially compliant: Rockwell Studio 5000. The tag-based Logix model is proprietary; ladder, ST, FBD, and SFC are supported but with Rockwell conventions that do not directly map to strict IEC syntax.
Vendor-specific: Mitsubishi GX Works2/3, Omron CX-Programmer (legacy), AutomationDirect Productivity. These use proprietary addressing and conventions.
Evolution: OOP Extensions
The 2013 revision of IEC 61131-3 added object-oriented extensions: classes and inheritance, interfaces and polymorphism, methods on function blocks. Beckhoff TwinCAT 3, B&R Automation Studio, and Codesys 3.5+ support these features fully. Siemens and Rockwell have limited OOP support.
Why IEC Fluency Matters
An engineer who truly understands IEC 61131-3 can switch between Siemens, Rockwell, Beckhoff, and Codesys projects with proportional effort, read and critique code across vendors, design reusable libraries that work across brands, and make informed decisions when a vendor extension is worth the lock-in and when it is not.
An engineer who only knows one vendor's dialect is more constrained in career moves and less valuable to employers with mixed fleets.
Conclusion
IEC 61131-3 is the reference framework every PLC programmer should understand, even if you spend your day-to-day in Siemens or Rockwell specifically. Learning the common data model, POU organisation, task model, and scope rules — once — makes every future platform easier. For language-specific tutorials, see our guides on ladder logic, structured text, and function block programming.
Continue Learning
Language Deep-Dives
Concepts and Patterns
Frequently Asked Questions
Do all PLC vendors follow IEC 61131-3?
To varying degrees. CODESYS-based platforms expose much of the IEC model directly. Siemens TIA Portal uses SCL and other Siemens conventions; Rockwell Studio 5000 uses its own tag-based Logix conventions; Mitsubishi, Omron and AutomationDirect also add vendor-specific syntax and project structures. Confirm feature support against the exact vendor and software version rather than assuming every IEC element is portable.
What is the difference between a function, a function block, and a program?
Functions are stateless (inputs and return values, no memory between calls — like MAX or ABS). Function blocks are stateful (they maintain internal memory — TON timer, CTU counter, PID). Programs are top-level and usually one per task, instantiating FBs and calling functions.
Why are there so many data types in IEC 61131-3?
The type system is strict to catch errors at compile time rather than runtime. Separating INT (16-bit), DINT (32-bit), LINT (64-bit), UINT (unsigned), REAL (32-bit float), and LREAL (64-bit float) lets the compiler enforce correct sizing and avoid the implicit-conversion bugs common in weakly typed languages.
What are the OOP extensions in IEC 61131-3?
The 2013 revision added classes and inheritance, interfaces and polymorphism, and methods on function blocks. Beckhoff TwinCAT 3, B&R Automation Studio, and Codesys 3.5+ support them fully. Siemens and Rockwell have limited OOP support. OOP is primarily adopted in machine-builder contexts where reusable libraries across machine families justify the complexity.
What is a POU?
POU stands for Program Organisation Unit. It is the IEC 61131-3 term for any callable code container — functions, function blocks, and programs are all POUs. A project typically has dozens of POUs organised in folders by purpose (motion, safety, HMI integration, fault handling).
Is Siemens SCL the same as IEC Structured Text?
Very close but not identical. SCL (Structured Control Language) is Siemens's implementation of structured text with Siemens-specific extensions and data types (DB addressing, POINTER types). Pure IEC ST code compiles in TIA Portal; SCL-specific code typically does not compile directly in Codesys without rework.
Which is the preferred programming language for today's PLCs?
Ladder logic remains the most-used PLC programming language globally — every major vendor IDE supports it, and electrical maintenance staff can read it. Structured text is the second most-used and is preferred for math, loops and string handling where ladder is awkward. Function block diagram (FBD) is common for control loops and signal flow. Most modern projects mix all three: ladder for discrete logic, structured text for calculations, FBD for PID and analog. Sequential function charts (SFC) are used for batch processes and recipe sequencing.
What is structured text in Siemens?
In Siemens TIA Portal, structured text is implemented as SCL (Structured Control Language). It is Siemens's superset of IEC 61131-3 structured text — it includes the standard IEC syntax plus Siemens-specific extensions for DB addressing, POINTER types and S7-specific instructions. SCL is the most commonly used non-ladder language on Siemens S7-1500, particularly for math-heavy logic, recipe handling, and complex algorithms. Pure IEC structured text written for Codesys generally compiles in SCL with minor adjustments; SCL-specific code typically does not port cleanly to other vendors.