What Is Ladder Logic?
Ladder Diagram (LD) — commonly called ladder logic — is the most widely used PLC programming language. It was designed to resemble relay logic schematics, making it familiar to electricians transitioning to programmable controllers. A ladder logic program consists of rungs (like the rungs of a ladder) that are evaluated sequentially from top to bottom. Each rung contains contacts (inputs) on the left and coils (outputs) on the right, connected by power rails representing DC power.
Ladder logic is one of five IEC 61131-3 standard languages. The others are: Function Block Diagram (FBD), Sequential Function Chart (SFC), Structured Text (ST), and Instruction List (IL). Most PLCs support multiple languages, and complex programs often use several.
Contacts: Reading Inputs
A normally open (NO) contact is represented by two vertical lines (——| |——). It passes power (logic true) when the referenced bit is 1. This is the most common contact type, used to read push buttons, limit switches, proximity sensors, and internal logic bits.
A normally closed (NC) contact (——|/|——) passes power when the referenced bit is 0. Used to implement stop buttons, safety interlocks, and "not" logic. Important: a physical normally closed pushbutton connected to a PLC input will hold the bit at 1 when unpressed — use a NO instruction to read a NC physical switch.
Coils: Controlling Outputs
An output coil (——( )——) turns on a physical output (motor starter coil, solenoid valve, indicator light) or sets an internal bit when the rung evaluates as true. A set (latch) coil turns a bit on and holds it on even if the rung goes false. A reset (unlatch) coil turns the bit off. Set/reset pairs are used to implement push-on/push-off control or to capture momentary events.
Timers
Timers are among the most-used PLC instructions. The three main types:
- TON (Timer On Delay): Starts timing when the rung goes true. The output (.DN) bit turns on after the preset time. Used for starting delays, conveyor sequencing, and process timing.
- TOF (Timer Off Delay): Starts timing when the rung goes false. The output stays on for the preset time after the rung drops out. Used for pump cool-down timers and conveyor runout.
- RTO (Retentive Timer): Accumulates time across multiple rung-true intervals. Must be reset explicitly. Used for runtime hour meters.
Counters
CTU (Count Up): Increments the accumulated count each time the rung transitions from false to true. The .DN bit sets when accumulated value reaches the preset. Used for part counting, batch control, and production totals.
CTD (Count Down): Decrements from the preset value. Used for material allocation and inventory control.
A Simple Motor Start/Stop Circuit
The classic ladder logic motor start/stop: Rung 1 — Start button NO contact (I:0/0) in parallel with Motor Run bit (B3:0/0), in series with Stop button NC contact (I:0/1), driving Motor Run coil (B3:0/0). Rung 2 — Motor Run bit (B3:0/0) driving Motor Output coil (O:0/0). The parallel Start/Run contact is the "seal-in" circuit — once started, releasing the start button keeps the motor running through the parallel path.
Best Practices
Use descriptive tag names (not I:0/3 but PUMP_1_START). Comment every rung. Keep rungs simple — one action per rung. Use subroutines (JSR/RET) to organize large programs. Implement safety interlocks in hardware in addition to the PLC logic — never rely solely on ladder logic for life-safety functions.