Ladder logic is the graphical PLC programming language that looks like a relay wiring diagram: two vertical power rails, horizontal rungs between them, contacts that test conditions and coils that switch outputs. In this ladder logic tutorial you will learn the symbols you will use most, how a PLC actually reads a ladder program, and how to build and test your first working program, a start/stop motor circuit with a seal-in contact.
You do not need a PLC to follow along. Every example here runs in the free Ladder Lab simulator on this site.
What is ladder logic?
Ladder logic, also called ladder diagram or LD, is one of the five programming languages defined in IEC 61131-3, the international standard for PLC programming. The others are function block diagram (FBD), structured text (ST), instruction list (IL) and sequential function chart (SFC).
It was designed to replace hard-wired relay control panels. Ladder diagram has its roots in the United States and is based on the graphical presentation of relay ladder logic, so an electrician who could read a relay schematic could read the PLC program too. That is still its biggest strength: a maintenance technician can open the program, watch the rungs go green, and find which sensor is stopping the machine.
Every major PLC brand supports it: Siemens (TIA Portal), Rockwell/Allen-Bradley (Studio 5000), Mitsubishi (GX Works), Delta (ISPSoft/WPLSoft), Omron and Schneider, plus open platforms such as CODESYS and OpenPLC. The symbols look slightly different between brands, but the logic is the same.
How a PLC reads a ladder program: the scan cycle
Before you write a single rung, understand how the PLC executes it. A PLC does not run your program once. It runs it in an endless loop called the scan cycle.

- Read inputs. The PLC copies the state of every input terminal into memory (the input image).
- Run the program. It solves rung 0, then rung 1, and so on to the last rung. Within a rung it works left to right.
- Write outputs. It copies the output image to the physical output terminals.
- Housekeeping. Communications and diagnostics, then the cycle starts again.
A full scan usually takes a few milliseconds. Three practical consequences follow:
- Order matters. A coil written on rung 5 can be read on rung 6 in the same scan, but rung 4 only sees it on the next scan.
- The last write wins. If two rungs drive the same coil, the lower rung decides the output. This is the classic “double coil” bug.
- Very short pulses can be missed. A signal shorter than one scan may never be seen. Fast counting needs high-speed counter inputs, not ordinary contacts.
Ladder logic symbols you will use most
About ninety percent of beginner programs use just eight symbols. Learn these and you can read most ladder programs.

| Symbol | Name | What it does | Rockwell | Mitsubishi |
|---|---|---|---|---|
| -| |- | Normally open contact | Passes power when the bit is 1 | XIC | LD / AND / OR |
| -|/|- | Normally closed contact | Passes power when the bit is 0 | XIO | LDI / ANI / ORI |
| -|P|- | Rising-edge contact | Passes power for one scan when the bit goes 0 to 1 | ONS / OSR | LDP |
| -|N|- | Falling-edge contact | Passes power for one scan when the bit goes 1 to 0 | OSF | LDF |
| -( )- | Output coil | Writes the rung result to a bit | OTE | OUT |
| -(S)- | Set (latch) coil | Sets the bit to 1 and leaves it there | OTL | SET |
| -(R)- | Reset (unlatch) coil | Clears the bit to 0 | OTU | RST |
| [TON] | On-delay timer | Output turns on after the preset time | TON | OUT T |
Timers and counters are drawn as boxes rather than contacts. They have their own guides: PLC on-delay timers (TON) and PLC counters: CTU, CTD and CTUD.
The idea that confuses every beginner: contacts test bits, not buttons
A ladder contact does not represent a physical switch. It asks a question about a bit in memory.
- A normally open contact asks: “Is this bit 1?”
- A normally closed contact asks: “Is this bit 0?”
So the contact you draw depends on what the input bit is doing, not on the type of push button. Most stop buttons, emergency stops and overload relays are wired normally closed in the field. While everything is healthy the circuit is closed, so the input bit reads 1. Pressing the button opens the circuit and the bit drops to 0.
That means a normally closed stop button is programmed with a normally open contact. It looks backwards the first time, but it is the safe way to do it: if the wire breaks or a terminal works loose, the input drops to 0 and the machine stops, exactly as if someone pressed Stop.
AND, OR and NOT in ladder logic
Every rung is a Boolean expression. You build it from three patterns:
- AND: contacts in series. Power reaches the coil only if every contact passes it.
- OR: contacts in parallel (a branch). Power reaches the coil if any branch passes it.
- NOT: a normally closed contact. It inverts the bit it tests.
For example, “run the pump if the level is low AND the auto mode is on, OR if the manual button is pressed” is one series pair with a parallel branch around it. If you want the theory behind this, read Boolean algebra and logic gates in PLCs.
Your first program: a start/stop seal-in circuit
The start/stop circuit is the “hello world” of PLC programming. It turns a motor on with a momentary Start button and keeps it running after you let go, until Stop is pressed or the overload trips.
Step 1: Write the I/O list
Always list your inputs and outputs before you program. Addresses below use Siemens style; the table after shows the equivalents on other brands.
| Tag | Address | Device | Field wiring |
|---|---|---|---|
| Start | I0.0 | Green push button | Normally open |
| Stop | I0.1 | Red push button | Normally closed |
| Overload | I0.2 | Thermal overload auxiliary contact | Normally closed |
| Motor | Q0.0 | Motor contactor coil | 24 V DC output |
| Brand | First input | First output |
|---|---|---|
| Siemens S7-1200 | %I0.0 | %Q0.0 |
| Rockwell CompactLogix (local I/O) | Local:1:I.Data.0 | Local:2:O.Data.0 |
| Mitsubishi FX | X0 | Y0 |
| Delta DVP | X0 | Y0 |
Step 2: Draw the rung

Read the rung as one sentence: Motor = (Start OR Motor) AND Stop AND Overload.
- Start is a normally open contact on I0.0.
- Motor (seal-in) is a normally open contact on the motor’s own output bit, Q0.0, placed in parallel with Start.
- Stop and Overload are normally open contacts on I0.1 and I0.2, because those devices are wired normally closed.
- Motor is an output coil on Q0.0.
Step 3: Walk through what happens
| Action | Start | Stop | Overload | Motor |
|---|---|---|---|---|
| Machine idle | 0 | 1 | 1 | 0 |
| Press Start | 1 | 1 | 1 | 1 |
| Release Start | 0 | 1 | 1 | 1 (held by seal-in) |
| Press Stop | 0 | 0 | 1 | 0 |
| Overload trips while running | 0 | 1 | 0 | 0 |
When you press Start, the rung goes true and Q0.0 turns on. On the next scan the seal-in contact on Q0.0 is also true, so the rung stays true after you release Start. Pressing Stop breaks the series path, Q0.0 turns off, and the seal-in contact opens with it.
Step 4: Test it before you trust it
Open the Ladder Lab simulator and load the start/stop with seal-in example. Toggle each input in the order of the table above and check the motor bit does exactly what the table says. Then try to break it: hold Start and Stop together. The motor must stay off, because Stop is in series after the Start branch. That is called stop priority, and it is what you want on real machines.
When you move to real hardware, test with the motor disconnected or the contactor’s power isolated first, and watch the bits in online monitoring mode before you let anything turn.
Seal-in or set/reset: which latch should you use?
You can build the same behaviour with a set coil on the Start rung and a reset coil on a Stop rung. Both work, but they behave differently:
| Seal-in contact | Set/reset coils | |
|---|---|---|
| After a power cut | Motor stays off until Start is pressed again | Depends on whether the bit is retentive; it may restart on its own |
| Stop priority | Built in by the series contact | Depends on rung order; the lower rung wins |
| Reading the program | Whole logic on one rung | Spread over two or more rungs |
For motors and anything that moves, I recommend the seal-in circuit. It fails safe after a power cut and keeps the logic on one rung. Set/reset coils are useful for alarms, mode selection and sequence steps, where you want a bit to remember an event.
Five beginner mistakes to avoid
- Driving the same coil on two rungs. Only the last rung counts, so the first one appears to “do nothing”. Combine the conditions on one rung, or use set and reset deliberately.
- Using a normally closed contact for a normally closed stop button. The motor will only run while Stop is pressed. Remember: the contact tests the bit, not the button.
- Forgetting the scan order. Logic that depends on a bit written further down the program will be one scan late. Usually harmless, sometimes the cause of a missed pulse.
- No tag names or comments. “I0.3” means nothing six months later. Name every tag and comment every rung.
- Putting the emergency stop only in the PLC. An emergency stop must cut power through a hard-wired safety circuit or a safety relay. The PLC can monitor it, but should not be the only thing stopping the machine.
Where to go next
Once the seal-in circuit makes sense, build on it in this order:
- PLC data types: BOOL, INT, REAL and structures, so you know what you are storing.
- On-delay timers (TON), then a full PLC timer loop sequence.
- Counters: CTU, CTD and CTUD.
- Structured text for PLCs, for maths and logic that is awkward in ladder.
If you have a Mitsubishi FX, see how to read and write ladder programs to an FX PLC.
Frequently asked questions
Is ladder logic still used in 2026?
Yes. Ladder logic is still the most common language for discrete machine control, especially where maintenance staff need to troubleshoot online. Newer projects often mix it with structured text for calculations and data handling.
Is ladder logic hard to learn?
The basics are not. If you understand series and parallel circuits, you can write useful programs within a few days. The harder part is learning to structure larger programs and to think in terms of the scan cycle.
What is the difference between ladder logic and structured text?
Ladder logic is graphical and suits on/off logic, interlocks and machine sequences. Structured text is a text language, similar to Pascal, and suits maths, loops and data handling. Both are defined in IEC 61131-3 and most modern PLCs let you use both in one project.
Can I learn ladder logic without a PLC?
Yes. Start in a simulator such as Ladder Lab, or the simulator in your vendor’s software (for example PLCSIM for Siemens). A cheap PLC or trainer becomes useful once you want to wire real sensors and outputs.
What do XIC and XIO mean?
They are Rockwell/Allen-Bradley names. XIC means “examine if closed” and is the normally open contact: true when the bit is 1. XIO means “examine if open” and is the normally closed contact: true when the bit is 0.
Keep going
Want the next tutorial in your inbox? Join the newsletter, one practical tutorial a week, or download the free eBook Introduction to Ladder Logic Programming and I/O Configuration from the resources library.
