Tiza Group

Home / Guides / Industry and automation

IEC 61131-3: The Five PLC Programming Languages

The five IEC 61131-3 languages (LD, FBD, ST, IL, and SFC): what each one is for, when to use it, and how to combine them in a single project.

By Shadai García, CEO and protection engineer at Tiza Group.

LD · ladder diagramI0.0Q0.0I0.1I0.2Q0.0ST · structured textkm1 := (start OR km1) AND stop_ok AND thermal_ok;FBD · IEC 60617-12 gates (right view)FBD · the same start-stopstart≥1stop_okthermal_ok&km1S1 and F2 are NC: the signal is 1 at rest and needs nonegation; when they open or the wire fails, it drops to 0the three languages give the same resultLanguagesLDSTFBDSame output© tizagrp.comLD · ladder diagramI0.0Q0.0I0.1I0.2Q0.0ST · structured textkm1 := (start OR km1) AND stop_ok AND thermal_ok;FBD · IEC 60617-12 gates (right view)FBD · the same start-stopstart≥1stop_okthermal_ok&km1S1 and F2 are NC: the signal is 1 at rest and needs nonegation; when they open or the wire fails, it drops to 0the three languages give the same resultLanguagesLDSTFBDSame output© tizagrp.com
IEC 61131-3: the same start-stop in ladder, structured text, and function blocks. Location in the system and operating principle. Illustrative: real values come from the nameplate and the manufacturer's manual.
Short answer

IEC 61131-3 defines five programming languages for controllers: ladder diagram (LD), function block diagram (FBD), structured text (ST), instruction list (IL), and sequential function chart (SFC). Each one solves a certain kind of problem better, and a single project usually combines them.

Short answer

Part 3 of the IEC 61131 standard defines the programming languages for programmable controllers. There are five: two graphical (logic; LD, ladder diagram, and FBD, function block diagram), two textual (ST, structured text, and IL, instruction list), and one for organizing sequences (SFC, sequential function chart). The standard is paid; this guide describes the languages in its own words, without reproducing the text. To test a program without a physical PLC, using OpenPLC and other simulators, see free PLC simulation and tools.

The five languages in one table

LanguageFormBest forWeak point
LD, ladder diagramGraphical, similar to a relay schematicDiscrete logic, interlocks, maintenance by electriciansBecomes unreadable with calculations and large data
FBD, function block diagramGraphical, blocks joined by linesControl loops, signal flows, analog processingLarge diagrams take up a lot of screen
ST, structured textTextual, similar to PascalCalculations, arrays, loops, communication, algorithmsRequires programmer training
IL, instruction listTextual, assembler styleLegacy codeDeprecated, hard to read and maintain
SFC, sequential function chartGraphical, steps and transitionsStaged processes and sequential startupsDescribes the order, not the internal logic of each step

How each language thinks

Ladder. The program reads like a ladder: two rails on the left and right, and between them rungs with contacts (conditions) and coils (results). A contact in series with another acts as AND; contacts in parallel act as OR. It is the common language between whoever programs and whoever maintains, because it mirrors the relay control schematic. It is developed in the series guide on ladder: contacts, coils, and seal-in.

Function block diagram. Each block (timer, comparator, controller, scaling) has inputs on the left and outputs on the right; the programmer joins them with lines. It comes naturally to anyone from instrumentation, because the diagram resembles a loop diagram.

Structured text. A high-level language with assignments, conditionals (IF, CASE), and loops. When logic has to operate on data, walk through a table, or implement a formula, text is shorter and clearer than any graphic.

Instruction list. One instruction per line, with an implicit accumulator. It is compact and very close to the machine. The third edition of the standard left it deprecated; it shows up in old programs that must be maintained.

Sequential function chart. It does not describe how an output is calculated, but what stage the machine is in and which condition takes it to the next one. Each step contains actions written in one of the other languages. Its origin is the French GRAFCET; the GRAFCET and SFC guide covers it separately.

Program organization: program organization units

The standard does not only define languages, it also defines a way to structure the project. The pieces are:

  • Program: the main unit the controller runs in a task.
  • Function block: a unit with its own memory; each use creates an instance with its internal data (a timer is the classic example).
  • Function: a unit without memory; for the same inputs it always returns the same result.
  • Global and local variables, with declared data types.
  • Tasks and resources: decide when and at what priority each program runs.

This separation lets you write a function block once for a motor and reuse it for every motor in the plant. It is the basis of what is explained in PLC programming best practices.

How to choose a language by type of problem

Which language fits?
  • Is the problem a staged sequence (startup, filling, machine cycle)?
    • Yes: SFC for the sequence, and ladder or structured text inside each step
    • No: Is it discrete interlock logic that electrical staff must maintain?
      • Yes: Ladder
      • No: Is it a control loop or a flow of analog signals?
        • Yes: Function blocks
        • No: Structured text

Illustrative example: the 15 kW motor in three languages

Assumed data: 15 kW, 400 V motor, with a start pushbutton, a stop pushbutton, and the thermal overload relay contact.

  • In ladder, the start contact and the coil’s own contact in parallel, in series with the stop and the overload, form the classic start-stop seal-in.
  • In structured text, the same logic is written as an assignment: the output is true if there is a start or it was already active, and there is neither a stop nor an overload trip.
  • In function blocks, a stop-dominant latch block receives the start and the stop condition.

All three versions do the same thing. Which is better depends on who will maintain it: ladder in a plant where electrical staff do the maintenance; in a system with many identical motors, a function block in structured text instantiated for each motor.

What each brand brings and what it does not

The standard fixes the languages, but each manufacturer offers its own environment, with its own extensions, instruction names, and limitations. Some environments use proprietary names (for example, SCL for structured text at one manufacturer, or languages with no exact equivalent elsewhere). That is why a program does not move from one brand to another without work; the guide on PLC brand equivalences lists the names that correspond to each other. The PLCopen organization publishes supporting documents and defines an XML exchange format that some environments support for moving programs between tools.

Reuse and maintenance: what the standard makes easier

Beyond the languages, Part 3 of the standard brings a project discipline that pays off after years in service:

  • Declared data types. The compiler warns when incompatible types are mixed, which prevents silent errors.
  • Explicit interfaces. A function block shows its inputs and outputs; nobody needs to read its internals to use it.
  • Separation between logic and signal assignment. The logic works with named variables, and the mapping to physical addresses is done separately, in the hardware configuration.
  • Libraries. Proven blocks are grouped and reused across projects.

A maintenance team that receives a plant programmed with this structure can work on one motor without walking through the whole program. A program written without it forces you to trace every signal by hand. So when specifying a control system, require four things by contract: use of the standard, the accepted languages, delivery of the source code, and documentation of the variables.

Common mistakes

  • Choosing the language out of habit rather than for the problem. Long calculations in ladder, or simple interlocks in text without need.
  • Mixing languages without criteria. A readable project assigns languages by layer: SFC for the sequence, ladder for interlocks, text for calculations.
  • Not using function blocks. Copying and pasting the logic of each motor instead of creating a reusable block.
  • Assuming everything converts. An automatic conversion between languages can produce code that is correct and unreadable.
  • Using instruction list in new projects.
  • Assuming a language implies different performance. Execution time depends on the compiler and the hardware, not on the language used to draw it.

Checklist

  • The manual confirms which languages the controller model supports.
  • Each layer of the program has a defined and documented language.
  • The staff who will maintain the plant can read the chosen language.
  • Repeated logic lives in reusable function blocks.
  • Variables are declared with a type and a meaningful name.
  • There is no instruction list in new code.
  • The project has a backup in the tool’s native format.

Frequently asked technical questions

  • Is there a faster language? Not by itself; the compiler converts all of them to machine code.
  • Can ladder and text be mixed in the same task? Yes, as separate units of the same project, within what the manufacturer’s environment allows.
  • What is PLCopen? An association that promotes use of the standard and publishes guides and an exchange format.
  • Does the standard cover communication between PLCs? Part 3 covers programming; networks and protocols are handled separately, as in Modbus RTU and TCP.

How we help

Defining the program structure, the languages per layer, and the project conventions keeps a control system from becoming impossible to maintain. At Tiza Group we do the control engineering and related studies, then test and commission the system. See engineering design and studies and testing and commissioning, or write to us through contact.

References

  • IEC 61131-3, programming languages for programmable controllers (paid standard).
  • PLCopen, introductory material on IEC 61131-3.
  • OpenPLC, project documentation on the five supported languages.

Frequently asked questions

Which PLC language should I learn first?

Ladder diagram, because it is the most widespread in power panels and maintenance work and looks like a relay schematic. Structured text comes next, since it covers calculations, arrays, and complex logic.

Is instruction list still current?

It is kept in existing equipment, but the third edition of the standard marked it as deprecated and manufacturers have stopped promoting it. Structured text is preferred in new projects.

Do all PLCs support the five languages?

No. Each manufacturer implements a subset, sometimes with variants. A controller may offer ladder and structured text but not instruction list, so check the model's manual before choosing.

Can a program written in one language be converted to another?

Some tools convert between ladder, blocks, and text, but the conversion is not always possible or readable. It is better to decide the language for each part at design time.

WhatsApp