Ladder Logic.
Ladder logic, LD is a PLC programming language that represents control logic as rungs of a virtual ladder, with input contacts on the left and output coils on the right. It originated in the 1970s as a direct visual analogue of relay-logic schematics, easing the transition for electricians moving from hardwired relay panels to programmable controllers. It remains the most widely-used PLC language in industry.
Three drawings included on a new account.
What Ladder Logic means.
Ladder logic is the oldest of the IEC 61131-3 controller languages and still the most widely used, because it was designed in the 1970s to look exactly like the relay schematics the electricians of the day already read. Input contacts down the left, output coils on the right, current flowing across each rung. That heritage is the whole explanation for its staying power. Ladder is poor at arithmetic, awkward for long sequences, and clumsy for reusable code, but it is unmatched at letting a maintenance technician stand in front of a running machine in the middle of the night and trace why an output is not energizing, contact by contact, the same way they would trace a relay panel. Decades on, the workforce that maintains and modifies plant logic is still trained ladder-first, and that troubleshooting accessibility is a real operational asset rather than nostalgia. Modern practice does not write ladder-only. It writes ladder-mostly, mixing structured text for the math, function block for control loops, and sequential function chart for state machines, while keeping the I/O handling and the simple interlocks in ladder where the maintainer can read them. Safety-rated variants exist on most platforms, restricted to a certified subset of instructions. The connection to the controls dataset is direct on import. A clean I/O list with correct signal classes is what populates the controller tag database that the ladder program addresses, and a tag imported as the wrong class is a rung that will never behave as drawn.
Why ladder won and stayed won
Electricians in 1975 already read relay-ladder schematics. Allen-Bradley's PLC-2 let them write the same diagram on a CRT and execute it in a controller. Forty years on, the workforce that maintains and modifies machine and process logic still leans heavily on people whose first PLC training was in ladder. Ladder is bad at math, bad at sequencing, bad at large state machines, but extraordinarily good at letting a maintenance technician trace a wire-and-relay-equivalent at 2 AM. That troubleshooting accessibility is the durable advantage.
Where ladder breaks down
Complex math, PID tuning, scaling, filtering is awkward in ladder. Structured text or function block is better. Multi-step sequences get unreadable in ladder past a certain length. SFC is better. Reusable code blocks are clumsier in ladder than in structured text. Modern projects mix languages. Ladder for I/O handling and simple interlocks, structured text for math and parsing, function block for control loops, SFC for state machines. Ladder-only is a legacy pattern. Ladder-mostly is current good practice.
Worked example, reading a start and stop rung.
The most common rung in any plant is the motor seal-in. Read left to right. The rung starts with two contacts in parallel: a normally open contact on the start pushbutton, and a normally open contact on the motor run coil itself. Those two in parallel feed a series string of normally closed contacts: the stop pushbutton, the overload, and any permissive interlocks. The string ends at the motor run coil. Pressing start closes the first contact, power reaches the coil, the coil energises, and its own normally open contact in the parallel branch closes. Release the start button and the coil stays energised through its own contact, which is the seal-in. Pressing stop opens the normally closed contact, the string breaks, and the coil drops out along with its seal-in, so the motor stays stopped when the button is released. Two points are worth noting, because they are where the intent lives rather than the drawing. The stop button is wired normally closed and appears as a normally closed contact, so a broken wire stops the motor rather than disabling the stop. And the coil is evaluated once per scan at the end of the rung, so two rungs writing the same coil do not fight: the last one in the scan wins, which is a defect rather than a design.
IEC 61131-3 ladder diagram elements
A rung is read left to right. Power flows from the left rail through the contacts, and whatever reaches the right hand element is written to it at the end of the scan.
| Element | Written as | What it does |
|---|---|---|
| Normally open contact | A pair of upright bars | Passes power when the referenced boolean is TRUE |
| Normally closed contact | A pair of upright bars with a slash | Passes power when the referenced boolean is FALSE |
| Positive transition contact | A contact marked P | Passes power for one scan when the reference changes FALSE to TRUE |
| Negative transition contact | A contact marked N | Passes power for one scan when the reference changes TRUE to FALSE |
| Coil | A pair of parentheses | Writes the rung result to the referenced boolean every scan |
| Negated coil | Parentheses with a slash | Writes the inverse of the rung result |
| Set coil | Parentheses marked S | Sets the boolean TRUE and leaves it set until something resets it |
| Reset coil | Parentheses marked R | Sets the boolean FALSE and leaves it |
| On delay timer, TON | A block marked TON | Output goes TRUE once the input has been TRUE for the preset time |
| Off delay timer, TOF | A block marked TOF | Output stays TRUE for the preset time after the input goes FALSE |
| Pulse timer, TP | A block marked TP | Output goes TRUE for exactly the preset time on a rising input |
| Counters, CTU, CTD and CTUD | A block marked with the counter type | Counts rising edges up, down, or both, against a preset |
The five IEC 61131-3 languages, and what each is for
A controller project normally mixes them. Choosing badly is how a plant ends up with a calculation written as two hundred rungs nobody will touch.
| Language | Short form | Form | Best suited to |
|---|---|---|---|
| Ladder diagram | LD | Graphical rungs of contacts and coils | Discrete interlocks and motor control, and anything a technician has to read at three in the morning |
| Function block diagram | FBD | Graphical blocks wired together | Regulatory control, signal conditioning, and reusable control modules |
| Structured text | ST | Pascal like text | Calculations, loops, arrays and string handling |
| Instruction list | IL | Assembler like mnemonics | Legacy code only; deprecated in the third edition of the standard |
| Sequential function chart | SFC | Steps, transitions and branches | Sequences, batch phases, start-up and shutdown procedures |
Common questions
Is ladder logic the same across all PLC vendors.
Do safety PLCs use ladder.
What is the difference between ladder logic and relay logic.
Run it on your drawings.
Upload a drawing set, get every document populated and classified, export to the format your team uses.