Third year Lesson 8 of 13 · about 16 min
Intro to PLCs: from relays to ladder logic
What you’ll learn
- What a PLC is physically: power supply, CPU, input cards and output cards.
- The scan cycle — read inputs, solve the program, write outputs — and why it matters.
- How a hard-wired start/stop with a seal-in becomes a few rungs of ladder logic.
- Why an NC-wired Stop button uses an examine-if-closed instruction, and the safety line a PLC must not cross.
Before this: Reading a ladder diagram · Start/stop and the seal-in
A PLC (programmable logic controller) is an industrial computer that replaces the relays and timers in a control panel with a program. Field devices — pushbuttons, limit switches, sensors — are wired to its inputs; coils, lights and valves are wired to its outputs; and the logic that joins them lives in software. Change the logic and you change the program, not the wiring.
Physically it is a rack or a strip of modules: a power supply, a CPU that holds and runs the program, input cards that turn 24 V DC or 120 V AC from field devices into bits (1 or 0), and output cards — relay, transistor or triac — that switch loads on when the program sets a bit. Every input and output point has a little status light. Those lights are the most useful troubleshooting tool you have.
The scan cycle
Two consequences follow. First, the program sees the world only once per scan: an input that pulses on and off faster than one scan can be missed (fast counting uses special high-speed inputs for that reason). Second, rung order matters — a rung lower down sees the results of the rungs above it in the same scan, but the outputs do not change on the terminals until the whole program is finished.
From a relay rung to a program rung
Take the start/stop circuit from the seal-in lab: Stop (NC) in series with Start (NO), a seal-in contact from the starter in parallel with Start, and the overload contact in series, all feeding the starter coil M. In a PLC panel, the buttons and the overload contact are wired to inputs, and the coil M is wired to an output. The logic moves into the program:
The NC stop-button trap
A contact in a program is not a contact — it is a question about a bit. The two basic instructions are examine-if-closed (XIC, drawn like a normally open contact: “true if the bit is 1”) and examine-if-open (XIO, drawn like a normally closed contact: “true if the bit is 0”).
The Stop button is wired normally closed to its input, so a broken wire acts like a press and stops the machine. That means the Stop input bit is 1 at rest. To let the rung through at rest you want “true if the bit is 1” — an XIC. Beginners see the word Stop, reach for the normally-closed-looking XIO, and the rung is false at rest: the motor never starts. Rule: choose the instruction from the state of the bit, not the name of the button.
Worked: trace the rung through one start
- At rest: Stop bit = 1 (NC closed), Start bit = 0, OL bit = 1 (NC closed), M = 0. Rung: XIC Stop true, Start false, M branch false → M stays off.
- Press Start: next scan reads Start = 1. Stop true, Start true, OL true → rung true → M bit set to 1; at the end of the scan the output turns on and the starter pulls in.
- Release Start: Start = 0, but the M branch is now true (M = 1) → sealed in.
- Press Stop: Stop bit = 0, XIC Stop false → rung false → M = 0 → motor stops; the seal-in drops with it.
- If the Stop wire breaks, the input goes to 0 exactly as if pressed — the machine stops. That is the reason for wiring it NC.
Inputs, outputs and what to wire where
Match the device to the card: a 24 V DC sensor on a 24 V DC input, a 120 V AC limit switch on an AC input. DC cards come as sinking or sourcing, and the field device has to be the opposite kind so current has a path. Output cards have limits too: a transistor output switches small DC loads, a relay output switches AC or DC but wears and is slow, and a big contactor coil may need an interposing relay. The card’s data sheet gives the ratings.
The line a PLC must not cross. Emergency stops and guard interlocks are built with hard-wired or safety-rated devices (a safety relay or a safety PLC) that remove power whatever the standard program is doing. A standard PLC can be told the e-stop was pressed; it should never be the only thing that stops the machine.
On the job
Tips
- Use the I/O lights as a first meter: input light on means the card sees voltage; output light on means the program turned it on.
- Input light wrong? The problem is in the field wiring or the device. Output light on but the load is off? Look past the terminal — fuse, wiring, coil, common.
- Go online and watch the rung: the software highlights true instructions, so you can see which one is holding the rung false.
- Label every force you apply and remove it before you leave. Log it if the site has a force log.
- Keep a current copy of the program off the machine, with the date.
Common mistakes
- Using an XIO for an NC-wired stop — the motor never starts.
- Wiring a sinking sensor to a sinking card (or sourcing to sourcing), then blaming the sensor.
- Driving a large coil straight off a small transistor output.
- Assuming a rung lower in the program has already changed a real output this scan.
- Relying on the program for an emergency stop.
- Leaving a force on.
Check yourself
-
1.In what order does a PLC do its work on every scan?
The classic scan is: read every input into an input image, solve the program rung by rung using that image, then update every output at once, then do housekeeping and start again. That is why an input that flickers faster than one scan can be missed entirely.
-
2.A Stop button is wired NORMALLY CLOSED into a PLC input, as it should be. With nobody touching it, the input light on the card is…
An NC button passes voltage when it is NOT pressed, so the input is ON at rest and goes OFF when someone presses Stop — or when the wire breaks. That fail-safe behaviour is exactly why stops are wired NC.
-
3.Following on: which instruction should the program use for that NC-wired Stop input in the run rung?
The program instruction asks a question about the input BIT, not the button. The bit is ON at rest, so an examine-if-closed instruction is true at rest and goes false when Stop is pressed. Using an XIO (the "it is a stop so draw it NC" instinct) makes the rung false at rest and the motor will never start — the classic first-PLC trap.
-
4.What is the PLC's "input image"?
The program never looks at the terminals directly during a normal scan; it reads the snapshot taken at the start. That keeps one scan consistent — every rung sees the same inputs.
-
5.In a hard-wired start/stop circuit, the seal-in is an auxiliary contact on the starter. In the usual PLC version, the seal-in is…
The output coil bit can be used as a contact anywhere in the program. Putting it in parallel with the Start instruction holds the rung true after Start is released — the same logic as the hard-wired seal-in. (Some designs also bring the starter aux contact back to an input so the program knows the starter actually pulled in.)
-
6.A PLC output light is ON but the contactor it drives has not pulled in. The best next check is…
The output light tells you the program turned the output on. Everything after the terminal — output fuse, field wiring, a failed output point, the coil itself, the common — is now the suspect. A meter at the terminal and at the coil splits the problem in half.
-
7.Why should an emergency stop not rely only on a PLC input and the program?
A standard PLC output can fail on, and software can be wrong. Emergency stop and other safety functions are built with hard-wired or safety-rated circuits (a safety relay or safety PLC) that drop power no matter what the standard program is doing. The program may also be told about the stop, but it is not the only thing standing between a person and the machine.
-
8.A two-wire, 24 V DC proximity sensor is wired to a "sinking" input card. What does sinking describe?
A sinking input sinks current to the DC common, so the device feeding it must be a sourcing device that switches the positive. Mix sinking with sinking and nothing flows. Matching the two is a wiring detail that catches everyone once.
Questions people ask
Is ladder logic the same as a ladder diagram?
It looks the same on purpose. PLC ladder logic was designed so electricians who read relay ladder diagrams could read programs on day one. The difference is that a relay ladder shows real wires and real contacts; ladder logic shows instructions that test bits in memory. A contact in the program is a question ("is this bit on?"), not a piece of metal.
Do I need to know a particular brand?
Not to understand them. Allen-Bradley (Rockwell), Siemens, Omron, Schneider and others all read inputs, solve logic and write outputs; they differ in addressing, software and names for the same instructions. Learn the idea on one, and a second brand takes days, not months.
Can I change a running program?
Many PLCs allow online edits, and forcing an input or output on or off from the laptop. Both change what a real machine does while people may be near it. Treat an online edit or a force like any other energised work: know exactly what it will move, tell the operators, and follow the site's procedure. Forces left on are a well-known cause of machines behaving "impossibly" weeks later.
Related
- Reading a ladder diagram — the relay version this lesson starts from
- Start/stop and the seal-in (lab) — the circuit we convert below
- Rusty on PLCs? — the one-page refresher
- Troubleshooting industrial controls — I/O lights as a meter
- How to read a schematic
Spot something wrong on this page? Report it
Thanks — your report was sent.
That didn’t send. Please try again later.
A heads-up on tools that fit — by email, optional
Leave your email and tick the box for a short heads-up, at most every two weeks, about tools, drills and diagrams that fit what you've been working through — here and on bentright.com and fieldcalc.net. One list across the three, one click to leave, and nothing is sent until you confirm from your inbox.