If you program PLCs, sooner or later you will ask yourself: should I write this in Ladder Logic or in Structured Text? Both languages are part of the IEC 61131-3 standard, and most modern PLC software supports them. They can control the same machine, but they feel very different to write and to maintain. In this post we compare them with a real example and give you a simple rule for choosing.
What Is Ladder Logic?
Ladder Logic (LD) is a graphical language that looks like an electrical relay diagram. Two vertical rails represent the power supply, and each horizontal rung holds contacts (inputs) and coils (outputs). When the contacts on a rung form a complete path, the coil turns on.
It was designed so that electricians and technicians could move from relay panels to PLCs without learning a programming language. That is still its biggest strength: almost anyone with an electrical background can read a ladder program.
What Is Structured Text?
Structured Text (ST) is a text-based, high-level language similar to Pascal. It uses assignments, IF/THEN, CASE, and loops such as FOR and WHILE. Instead of drawing the logic, you write it. Siemens calls its version of this language SCL.
ST fits best when a program needs math, data handling or complex decisions, because the code stays compact and is easy to copy, search and reuse.
The Same Logic in Both Languages
The classic example is a motor start/stop circuit with a seal-in (latching) contact. Pressing Start turns the motor on, the motor’s own contact holds it on, and pressing Stop (a normally closed contact) breaks the circuit.

In Structured Text, the whole rung becomes one line:
Motor := (Start OR Motor) AND NOT Stop;For simple on/off logic like this, Ladder is just as short and arguably easier to understand at a glance. A technician can watch the rung light up online and find the missing condition in seconds.
Where Structured Text Wins
Now imagine you need the average of ten analog samples. In ST this takes only a few lines:
sum := 0.0;
FOR i := 0 TO 9 DO
sum := sum + Samples[i];
END_FOR;
Average := sum / 10.0;In Ladder, the same job usually needs many rungs or a ready-made function block, and it gets harder to read as it grows. The same is true for scaling analog values, recipe handling, string operations and state machines with many states.
Side-by-Side Comparison
| Feature | Ladder Logic (LD) | Structured Text (ST) |
|---|---|---|
| Style | Graphical | Text-based |
| Best for | Discrete I/O, interlocks, sequences | Math, loops, arrays, algorithms |
| Learning curve | Easy for electricians | Easier if you know programming |
| Online troubleshooting | Power flow is visible on screen | You read values and code |
| Size of complex logic | Grows quickly | Stays compact |
| Copy and reuse | More manual work | Easy, it is just text |
Which One Should You Choose?
Use Ladder Logic for discrete control and for any part of the program that maintenance technicians will read and troubleshoot. Use Structured Text for calculations, data handling and anything that would take dozens of rungs to express.

You do not have to pick only one. Many platforms, including CODESYS and Siemens TIA Portal, let you mix languages in the same project. A common approach is to keep the machine’s I/O logic and interlocks in Ladder, and call function blocks written in ST for the calculations.
Final Thoughts
Neither language is better in every case. Choose by the task and by who will maintain the program later. If you only know Ladder, try moving one calculation into Structured Text. If you come from a programming background, spend time with Ladder, because that is what you will often find on the shop floor. Knowing both makes you a faster and more flexible PLC programmer.