Ladder Logic (Ladder Diagram, LD)
Ladder logic is a graphical PLC programming language, standardised as ladder diagram in IEC 61131-3, that represents control logic as rungs of contacts and coils between two vertical power rails, mirroring the relay circuit diagrams it replaced.
A ladder program consists of horizontal rungs placed between a left and a right power rail. Each rung combines contacts, which test the state of a Boolean variable such as an input or internal bit, in series for AND logic and in parallel branches for OR logic. When a continuous logical path exists, power flow energises the coil on the right, setting an output or memory bit. Rungs can also call timers, counters, comparisons, maths and function blocks, and are generally evaluated from top to bottom during each scan.
Because it resembles electrical relay schematics, ladder logic is readable by electricians and maintenance technicians, which has made it one of the most widely used PLC languages, particularly for discrete machine control and interlocking. Online monitoring displays live power flow on each rung, which helps fault-finding on the shop floor.
Ladder suits Boolean logic but becomes unwieldy for complex arithmetic, string handling, data structures or long sequences, where structured text, function block diagram or sequential function chart are clearer. Good practice includes consistent tag naming, comments, avoiding duplicate coils for the same output and structuring code into routines. Changing logic on a running machine can create unsafe states, so edits follow site change control and OEM guidance.
Key points
- Standardised as ladder diagram (LD) in IEC 61131-3
- Series contacts form AND logic; parallel branches form OR logic
- Mirrors relay schematics, so electricians can read and troubleshoot it
- Live power-flow display aids online fault-finding
- Less suited to complex maths, data handling and long sequences
Where AiVibe comes in
AiVibe designs and manufactures the AiAmbA AI Factory, whose edge devices and AI agents let people talk to PLC, CNC and robot controllers in plain language. Agents only propose changes, a trained operator confirms each one, and the AI Factory never replaces a machine's control or safety systems.
Related terms
- IEC 61131-3PLC & Industrial Control
- Programmable Logic Controller (PLC)PLC & Industrial Control
- Structured Text (ST)PLC & Industrial Control
- Function Block Diagram (FBD)PLC & Industrial Control
- PLC Scan CyclePLC & Industrial Control
- InterlockPLC & Industrial Control