Automation Systems · ASP ENGINEERING LIBRARY

IEC 61131-3: PLC Programming Languages

In this article 10 sections

The IEC 61131-3 standard is the international benchmark for programmable logic controller (PLC) and distributed control system (DCS) programming. Published by the International Electrotechnical Commission, the current fourth edition (2025) defines the software architecture and programming languages used to develop industrial control applications. Understanding IEC 61131-3 is essential for any automation engineer, as it governs how control logic is structured, executed, and maintained across virtually every major PLC and DCS platform.

Conceptual control-system layers. Safety functions, communication paths, and redundancy must be designed for the application; the diagram is not a wiring or safety design.
Conceptual control-system layers. Safety functions, communication paths, and redundancy must be designed for the application; the diagram is not a wiring or safety design. View full size

Programming Languages Defined

The current edition of IEC 61131-3 defines three graphical and one textual programming language. A fifth language — Instruction List (IL) — was deprecated in the 2013 edition and removed entirely in 2025.

LanguageTypeAbbreviationBest Suited For
Ladder DiagramGraphicalLDDiscrete logic, relay-replacement, maintenance-friendly
Function Block DiagramGraphicalFBDContinuous control, signal flow, complex algorithms
Structured TextTextualSTData processing, loops, conditional logic, calculations
Sequential Function ChartGraphicalSFCBatch processes, state machines, sequential operations
Instruction List (removed)TextualILDeprecated — low-level assembly-like operations

Ladder Diagram (LD)

Ladder Diagram is the most widely recognized PLC programming language, originating from relay-based control panels. Programs are represented as rungs on a vertical power rail, with contacts (inputs) on the left and coils (outputs) on the right. LD is intuitive for electricians and maintenance technicians because it visually resembles electrical schematics.

Key elements:

  • Normally Open (NO) contact — Passes power when the associated bit is TRUE.
  • Normally Closed (NC) contact — Passes power when the associated bit is FALSE.
  • Coil (output) — Energized when power flows through the rung from left to right.
  • Set/Reset (latch) — Retains state after a momentary input condition.
  • Function blocks on rungs — Timers, counters, and comparison operations embedded within ladder logic.

Function Block Diagram (FBD)

Function Block Diagram represents control logic as interconnected blocks where data flows from left to right. Each block performs a specific function (AND, OR, PID, timer, counter, arithmetic). FBD is the preferred language for process control applications because it clearly shows signal flow and is well-suited to continuous control strategies.

IEC 61131-3 defines standard function blocks including:

  • Bistable elements — SR (set-dominant) and RS (reset-dominant) flip-flops.
  • Edge detection — R_TRIG (rising edge) and F_TRIG (falling edge).
  • Counters — CTU (up-counter), CTD (down-counter), CTUD (up/down counter).
  • Timers — TON (on-delay), TOF (off-delay), TP (pulse).
  • Communication — SEND and RECEIVE blocks for network messaging.

Structured Text (ST)

Structured Text is a high-level textual language with syntax similar to Pascal and BASIC. It is the most powerful of the IEC 61131-3 languages for complex mathematical operations, data manipulation, and algorithmic control. ST excels in applications requiring loops, conditional branching, array operations, and string handling.

Core language constructs:

// Conditional execution
IF temperature > high_alarm THEN
    valve := FALSE;
    alarm_active := TRUE;
ELSIF temperature > warning_limit THEN
    alarm_active := FALSE;
ELSE
    valve := TRUE;
END_IF;

// Iteration
FOR i := 0 TO 9 DO
    avg_sum := avg_sum + tank_levels[i];
END_FOR;
average_level := avg_sum / 10;

// Function block instantiation
timer_01(IN := start_signal, PT := T#5S);
IF timer_01.Q THEN
    motor_running := TRUE;
END_IF;

Sequential Function Chart (S2)

Sequential Function Chart organizes control logic into a series of steps connected by transitions. Each step represents a stable state of the process (with associated actions), and each transition defines the condition that must be met to move to the next step. SFC is the natural choice for batch processes, state machines, and any application with clearly defined operational phases.

SFC supports two divergence types:

  • Sequential divergence — Steps execute one after another in order.
  • Parallel divergence (AND) — Multiple step sequences execute simultaneously, synchronizing at the join.
  • Alternative divergence (OR) — Only one branch executes based on transition conditions.

Program Organization Units (POUs)

IEC 61131-3 structures programs into three types of Program Organization Units:

POU TypeDescriptionExecution
FunctionStateless computation returning a single value. Examples: SQRT, SIN, ADD, custom scaling functions.Called by other POUs; same inputs always produce same outputs.
Function Block (FB)Reusable block with internal state (memory). Each instantiation maintains its own data. Examples: TON, PID, custom equipment modules.Instantiated as variables; retains state between calls.
ProgramTop-level POU that is assigned to a task for execution. Contains the main control logic.Executed by a task according to its scheduling configuration.

Data Types

IEC 61131-3 defines a comprehensive type system to ensure portability across vendors:

  • 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.
  • User-defined types — Enumerated types, subrange types (e.g., INT(0..100)), arrays, structures, and references.
  • Generic types — ANY, ANY_NUM, ANY_REAL, ANY_INT, ANY_ELEMENTARY for interface definitions.

Vendor Implementation Notes

While IEC 61131-3 defines the standard, each automation vendor implements it with platform-specific extensions:

  • Siemens (TIA Portal) — Implements all five original languages (still supports IL). SCL is Siemens' version of Structured Text. Graphical languages: LAD, FBD, GRAPH (SFC equivalent).
  • ABB (Ability Builder / Control Builder Plus) — Full IEC 61131-3 compliance with five languages plus Continuous Function Chart (CFC). Used in AC 800M and Freelance controllers.
  • Rockwell Automation (Studio 5000) — Supports Ladder Logic (LD), Function Block Diagram (FBD), Structured Text (ST), and Sequential Function Chart (SFC).
  • Schneider Electric (EcoStruxure Control Expert) — Implements all five languages plus the proprietary Sequential Function Chart variant.

ASP OTOMASYON provides PLC/DCS programming services; confirm the required platform and project scope with the engineering team. We develop reusable function block libraries that reduce engineering time and ensure consistent control strategies across your facilities.

Apply this to your project

  • Define the process states, timing requirements, and permitted behavior after a controller or communication failure.
  • List controller, I/O, network, software, and license dependencies before choosing an architecture.
  • Record acceptance results and prove that the delivered configuration can be restored from the handover package.

Follow an ASP project guide to connect the fundamentals with implementation and acceptance.

Engineering review sequence: Requirements → Engineering → Acceptance → Handover. Keep the recorded evidence with the accepted configuration.
Engineering review sequence: Requirements → Engineering → Acceptance → Handover. Keep the recorded evidence with the accepted configuration. View full size

Primary references and further reading

Use the original specifications and product documentation for implementation details. The examples in this guide are illustrative engineering scenarios, not published project results.

Use this guide in context. Examples are engineering starting points. Confirm device documentation, site requirements, and acceptance criteria before implementation. How this library is maintained · Suggest a correction

FROM REFERENCE TO REAL PROJECT

Bring your next automation challenge.

PLC and DCS engineering, OPC connectivity, and digital transformation. Start with your installed systems, your constraints, and what you need to achieve.

Talk to ASP OTOMASYON