Rungs and Power Flow
A Ladder Logic program is a stack of horizontal rungs drawn between two vertical power rails. Each rung represents one logical condition-and-action pair.
XIC(Switch1)XIC(Switch2)OTE(Lamp);XIC(DoorSensor)OTE(Alarm)
The left rail is the "power source". The right rail is "ground". The instructions between them decide whether power reaches the output on the right.
How a Rung Evaluates
- Instructions are read left to right.
- Contacts in series are ANDed together — power only flows if all are true.
- Contacts in parallel branches are ORed — power flows if any branch is true.
- If the rung is true, the output coil on the right is energized.
Rung 0 energizes Lamp only when Switch1 AND Switch2 are both 1 — contacts in series are ANDed. Rung 1 is independent: Alarm follows DoorSensor.
Try it in the Two-Button Lamp exercise — light a lamp only while two buttons are pressed together (series AND).
Rungs run every scan
The PLC re-evaluates your whole program — every rung, top to bottom — over and over in a loop called the scan, so an output always reflects the latest inputs. That ordering has consequences beyond logic: it sets the timing of your outputs, and when two rungs drive the same output the lower one wins. Both are covered in The Scan Cycle and Scan Order and One-Scan Delays.
Adding a Rung in Rungs Studio
The Ladder Logic toolbar sits at the top of the editor. Use the rung tool to insert a new rung. Click it to add a rung below the currently selected rung, or drag it onto the program to drop a rung where you want it.
Summary
- Rungs evaluate left-to-right, top-to-bottom, every scan.
- Series = AND. Parallel = OR.
- Outputs re-energize every scan based on current conditions.
- Each output should be driven by a single rung.