- Home
- English lessons
- PLC Automation
- Ladder basics
// Chapter 22.3 · PLC · Ladder Basics
Ladder Logic Basics: NO and NC Contacts, Coils, AND, OR, Latching, SET/RESET, Edge Detection and Boolean Algebra
Ladder logic was designed so that an electrician who can read relay circuits can read a program straight away. The left rail is the “positive supply”, the right rail is “zero”, and each rung is a path along which power can reach the coil if all its contacts are closed. The one thing you must rethink is that a contact in the program tests a bit value, not a button.
- ─┤ ├─ NO: conducts when bit = 1 · ─┤/├─ NC: conducts when bit = 0 · ─( )─ coil: writes the result to a bit
- Series = AND · parallel = OR · NC = NOT · every rung is one Boolean equation
- STOP button wired NC → use NO in the program (broken wire = stop)
- Each coil is written in one place only · P/N edge contacts conduct for one scan
The elements of ladder logic Basic
B1 AND (series)
B2 OR (parallel)
B3 NOT (NC contact)
| A | B | A·B | A+B | Ā | A⊕B |
|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 1 | 0 |
| 0 | 1 | 0 | 1 | 1 | 1 |
| 1 | 0 | 0 | 1 | 0 | 1 |
| 1 | 1 | 1 | 1 | 0 | 0 |
B4 De Morgan
B4 is needed whenever you want “not both” in ladder, because basic ladder has no NOT in front of a bracket. The simulator on this page uses this rule to convert equations into NO/NC contacts automatically.
B5 XOR (exclusive OR, two-way switch)
A STOP button wired NC and the contact in the program Basic
B6 Motor latch in a PLC
In the simulator, inputs with a dashed border are NC buttons: the green light on I0.0 is already lit without pressing anything. Try pressing START, then STOP, and press the overload button to simulate a trip.
SET, RESET and edge detection Intermediate
A SET coil (─(S)─) makes its bit 1 when the rung is true and holds that value even after the rung goes false. A RESET coil (─(R)─) makes it 0. Used as a pair, they replace a seal-in circuit. A rising-edge contact P conducts for just one scan when its bit changes 0→1; a falling-edge contact N conducts for one scan on 1→0. Use them for counting, toggling a state or issuing a command once per press.
B7 Set/Reset with reset priority (R rung below)
B8 Rising edge (one-shot)
One button: press for on, press again for off (toggle / flip-flop)
Create a one-scan pulse:
If it is off, turn it on: · if it is on, turn it off:
— note that both conditions read the old value of Q0.1 from the previous scan, so it does not switch on and off in the same scan. Try it with the “SET/RESET and edges” example in the simulator.
Programming rules that prevent bugs Intermediate
- Write each coil in one place only — if it is written on two rungs, the lower rung overwrites the upper one (double coil)
- Use internal memory (M) as an intermediary and write the real outputs (Q) at the end of the program; this makes maintenance easier
- Give every bit a symbolic name (tag), e.g.
M1_RunPB_Stop_NC, instead of a bare address - Comment every rung with “why”, not “what” (the ladder already shows what it does)
- Put safety conditions (STOP, OL, E-stop status) at the far left of the rung, where they are read first
Frequently asked questions
Is an NC contact in the program the same as an NC button wired in the field?
No. A contact in the program tests a “bit value”, not the state of the button. An NO contact in the program conducts when the bit is 1; an NC contact conducts when the bit is 0. A STOP button wired NC makes its bit 1 in the normal state, so the program must use an NO contact for the rung to work normally and stop when the button is pressed.
Should I use SET/RESET instead of a seal-in circuit?
You can, and it reads well in sequential logic, but watch two things: if SET and RESET are both true at once, whichever is on the lower rung wins; and a SET bit may keep its value through a power failure if it is retentive memory, so the machine restarts by itself when power returns. For ordinary motor control the classic seal-in circuit is safer because it drops out by itself on STOP.