Rungs and Power Flow
Learn how Ladder Logic rungs evaluate power flow between two rails in rungs.dev — series ANDs, parallel ORs, and how outputs are energized scan by scan.
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.
0
Switch1
Switch2
Lamp
1
DoorSensor
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.
Practice
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.
What is Ladder Logic?
Ladder Logic (LD) is a visual rung-based PLC programming language that mirrors relay wiring diagrams. Learn the basics and run examples in the rungs.dev simulator.
Branches and OR Logic
Use parallel branches in Ladder Logic to express OR conditions in rungs.dev. Series contacts AND together; parallel branches OR — combine them for any boolean rule.