Guide · 3 min read · Free to try
Ladder logic for beginners: a free tutorial you can run
Ladder logic is the language most PLCs are programmed in. It reads like an electrical drawing: power flows from the left rail, through contacts, to a coil on the right. This tutorial covers the first ideas in order, each with a rung you can run.
Free in FORGE, the online PLC simulator. No install, and no account to start.
What ladder logic is
A ladder program is a list of rungs between two rails. Each rung is one rule: if the conditions on the left are true, turn on the output on the right.
- A normally open contact passes power while its tag is on: a button that is pressed, a sensor that sees a part.
- A normally closed contact passes power while its tag is off.
- An output coil turns its tag on while power reaches it, and off when it does not.
- Contacts in series must all pass power. Contacts on parallel branches need only one.
| Tag | Value |
|---|---|
| StartPB | 1 |
| StopPB | 0 |
| Motor | 1 |
| RunLamp | 1 |
Each OTE writes its tag every scan. RunLamp follows Motor.
How the controller runs it
A PLC does not run a rung once. It repeats the same three steps, called a scan, many times a second: read every input, solve every rung from top to bottom, then write every output.
Because the outputs are written at the end, every rung in one scan sees the same inputs. Most beginner surprises come from forgetting that. The scan cycle lesson shows it step by step.
Free preview: the first lesson
The opening of the first Beginner lesson, word for word. Both of the first two lessons are free.
Inputs and outputs
An input is a signal the controller reads, like Pushbutton. An output is a command it sends, like Lamp.
A contact reads a tag
A Normally Open Contact passes power while its tag is on. It tests the Pushbutton tag, not the button itself.
One scan: read, decide, write
Each scan reads the inputs, runs the rung, then writes the outputs. With Pushbutton on, power flows and Lamp turns on.
The next ideas, in order
Each Beginner lesson adds one idea. Open any of them to see what it builds.
- Series and parallel contacts in ladder logicContacts in series mean both signals must be on; contacts in parallel mean either one. Wire a door switch and a Start button to a lamp.Free
- NOT logic with a normally closed contactA normally closed contact passes power while its tag is off. Use one to light a lamp while a path is clear.Pro
- Normally open and normally closed field devices, and a fail-safe StopWhy a Stop button is wired normally closed, how the ladder reads it, and a seal-in where a broken wire stops the motor.Pro
- The seal-in circuit in ladder logicKeep a motor running after Start is released with the output's own feedback contact, and drop it with a normally closed Stop.Pro
- Latch and unlatch coilsA latch coil sets an output that stays on with nothing holding it, and an unlatch coil clears it. How that differs from a seal-in circuit.Pro
- Edge detection with a one-shotAct on the moment a signal turns on, not the whole time it stays on: a rising-edge one-shot pulses an output for exactly one scan.Pro
- PLC tags: global and programA tag is a named value in the controller. Create global and program tags, name them clearly, and use them in a rung.Pro
The circuit every beginner builds: the seal-in
A Start button is only pressed for a moment, but the motor must keep running. The seal-in solves it: the motor’s own contact sits in parallel with Start, so once the motor is on it holds itself on. Stop sits in series and breaks the rung.
| Tag | Value |
|---|---|
| StartPB | 0 |
| StopPB | 1 |
| Motor | 0 |
StopPB was pressed. XIO StopPB stopped passing power and Motor turned off.
The seal-in technique in the Wiki steps through it press by press.
Practise each idea
Free exercises that open in FORGE and check your rungs in simulation.
- Light the lampMake a pushbutton input drive a lamp output so the lamp is on only while the button is held.Free
- On until pressedUse a normally closed contact so the lamp stays on until the pushbutton is pressed, then goes off while it is held.Free
- Read the scan orderGiven a rung and a set of inputs, predict the output value after exactly one scan.Free
- Latch the alarmLatch an alarm lamp on when a fault appears, and keep it on until Reset is pressed.Free
- Seal in the motorBuild start and stop logic where the motor keeps running after Start is released, and Stop breaks it.Free
Questions
Is ladder logic hard to learn?
The first ideas are small: a contact, a coil and the scan. Most people build a working start and stop circuit in their first hour. What takes practice is reading a live rung and predicting the next scan.
Can I learn ladder logic for free?
Yes. The first two Beginner lessons, the editor, the simulator and many practice exercises are free in your browser, with no install.
Do I need a PLC to learn ladder logic?
No. FORGE runs your rungs one scan at a time in the browser, with live tag values and machine scenes to drive.
What should I learn after ladder logic basics?
Timers and counters come next, then compares and math, sequences and the other languages: function block diagram, sequential function chart and Structured Text.
Run your first rung now.
Wire a pushbutton to a lamp in the first lesson. It takes about twenty minutes.