Understanding Rungs and Rails: The Foundation of PLC Ladder Logic

Especially in industrial automation, the Ladder Diagram (LD) is among the most often used programming languages in Programmable Logic Controllers (PLCs). It is meant to be identical to the electrical relay control circuits electricians are already familiar with. This makes it perfect for managing automation systems, processes, and machines.

A ladder diagram consists of vertical and horizontal lines, much like the sides and steps of a physical ladder. Understanding the idea of rungs and rails is absolutely necessary if one is to properly design or evaluate ladder logic; similarly, as is knowledge of other basic building blocks.

  1. Branches: Used to generate parallel routes inside a rung, branches
  2. PLC Inputs and Outputs: These are the outside devices linked to the PLC.
  3. Instructions and Addressing: Commands deciding the logical behaviour are instructions and addressing.
  4. Rungs and Rails: The structural framework of the ladder diagram.
  5. In this section, we’ll focus on rungs and rails and how they form the backbone of ladder logic programming.

Rungs in ladder logic are horizontal lines on the ladder diagram that represent logical control statements.

A Rung is a horizontal line in the ladder diagram representing a logical control statement. Typically, each rung finishes with an output instruction (such a coil); every rung has one or more logical instructions (like input conditions).

The PLC scans rungs one by one from top to bottom throughout each cycle; rungs are assessed left to right. The output instruction at the ending of a rung is run if the logic in a rung evaluates as true.

What is a Rung in Ladder Logic?

Withe reference the ladder diagram in above picture

  • [ I1 ]: Represents an input condition (like a push-button).
  • [ Q1 ]: Represents an output device (like a lamp or motor).
  • This rung means: “If I1 is ON, then turn ON Q1.”

Every rung functions as a single logical command or rule in your control system. Depending on the amount of processes and control logic in your project, you may have as many rungs as required.

Learn about ladder diagram: Understanding Basic Parts of Ladder Diagram (LD) in PLC Programming

Referring to the above digram, Rails are the two vertical lines flanking the ladder diagram. They represent the power supply lines; all reasoning has to run between these rails.

  • The left rail represents the positive or active line (L+ or Phase).
  • The right rail represents the negative or neutral line (L- or Ground).

Starting from the left rail and ending at the right rail, every rung in the ladder diagram creates a logical flow of “current” from left to right. This design mimics the idea of current flow in a real electrical circuit.

The program runs on constant rails. Acting as set limits for every rung, they provide form to the whole ladder logic diagram.

Explore PLC logic gates: Logic Gates in PLC Programming: A Guide with Truth Tables and Ladder Logic Diagrams 

Ladder logic programming uses unique symbols to show inputs and outputs. These symbols mimic how real-world electrical circuits’ physical components, such switches and coils, function. 

The image that follows illustrates the ladder digram with input contact and output coil symbol.

Input and Output Representations in Ladder Logic

Normally Open (NO) Contact: –[ ]–

  • This contact allows current (logic) to pass only when the input is ON.

Normally Closed (NC) Contact: –[\]–

  • This contact allows current (logic) to pass only when the input is OFF.

These inputs denote field devices such as switches, sensors, or push-buttons linked to the input terminals of the PLC.

Understand PLC redundancy types: Understanding PLC Redundancy: Cold, Warm & Hot Redundancy

Output Coil (NO): –( )–

  • This activates the output device when the logic path is true.

Output Coil (NC): –(\)–(Negated coil)

  • This turns OFF the output device when the logic path is true (inverted logic).

Usually, outputs are actuators like relays linked to the PLC‘s output terminals, lamps, buzzers, or solenoids.

Explore PLC hardware types: PLC Hardware: Modules,Types, Functions, and Applications

Let’s understand how the logic in a rung actually controls the output devices by simulating two basic cases.

How PLC Rungs Work: Explained with Simple Cases

Based on the electrical circuit design displayed in the above image

  • A push-button switch (NO) is wired in series with a lamp.
  • When the switch is open (not pressed), the lamp remains OFF.

Troubleshoot PLC digital outputs: Step-by-Step Procedure for Troubleshooting PLC Digital Outputs

How does Rung work in NO contact?  in plc ladder diagram

The above picture depicts a comparable Ladder Logic diagram circuit showing the two possible states of an input/output relationship in a programmable logic controller (PLC) system.

The ladder diagram illustrates:

  • I1: Input from NO push-button
  • Q1: Output coil controlling a lamp
  • The top portion shows the input I1 in a “False” state
  • The simulation window shows input 1 is 0 (off)
  • The output Q1 lamp is shown as “False” and “Not Active”
  • The circuit is not completing the logical connection
  • The bottom portion shows the input I1 in a “True” state
  • The simulation window shows input 1 is 1 (on)
  • The output Q1 lamp is shown as “True” and “Active” (appearing green)
  • The circuit is completing the logical connection

The simulation windows in the middle show the status of inputs and outputs, therefore verifying the logical connection between the input state and the final output state.

Implement SR flip flop: Implementing SR Flip Flop in PLC Ladder Logic

Case 2: Normally Closed (NC) Contact

Based on the electrical circuit design displayed in the above image, 

  • A push-button switch (NC) is wired in series with a lamp.
  • The lamp is normally ON and turns OFF when the button is pressed.
How does Rung work in NC contact? in plc ladder diagram

This image shows a Ladder Logic diagram circuit demonstrating a Normally Closed (NC) Contact configuration in a PLC system.

The ladder diagram illustrates:

  • I1: Input from NC push-button
  • Q1: Output coil
  • The top portion shows the input I1 in a “False” state (Not ON)
  • The symbol used is for a Normally Closed contact (indicated with a slash through the contact)
  • The simulation window shows input 1 is 0 (off)
  • Interestingly, the outputQ1 lamp is shown as “True” and “Active” (illuminated green)
  • This demonstrates the NC contact’s behavior: when the input is FALSE, the contact allows power to flow

Explanation: When Input I1 is Active (True/ON):

  • The bottom portion shows the input I1 in a “True” state (ON)
  • The simulation window shows input 1 is 1 (on)
  • The output Q1 lamp is shown as “False” and “Not Active” (not illuminated)
  • This again demonstrates the NC contact’s behavior: when the input is TRUE, the contact blocks power flow

This illustrates the fundamental principle of Normally Closed contacts in ladder logic – they conduct power when their associated input is OFF, and block power when their input is ON. This is essentially the inverse operation of the Normally Open (NO) contact shown in the previous image.

NC contacts are commonly used for safety circuits, indicating faults, or creating inverse logic operations in PLC programming.

Here’s a basic diagram to illustrate the structure:

Simple Visual Representation of a Rung and Rail
  • The current or logic flows from left rail to right rail.
  • If the input I1 condition is met, the output Q1 is energized.
  • Rung after rung, top to bottom, the PLC scans the program continually.
  • Every rung is assessed left to right. The rung is active if all conditions are true.
  • An active rung causes the output coil to energize; for example, a motor begins or a light turns on.
  • The output is de-energized if a rung condition is untrue.

Active rungs in simulation software are sometimes indicated in color (e.g., red or green) to show logical flow.

ConceptDescription
RungHorizontal line in ladder logic representing a control statement.
RailVertical power lines on the sides, like phase and neutral in circuits.
NO InputAllows current when the condition/input is ON (closed).
NC InputAllows current when the condition/input is OFF (open).
OutputDevice controlled by logic (e.g., motor, light, relay).
ExecutionRungs are evaluated top-down, left-to-right in every PLC scan cycle.

Read More

Recent