IMDHMIControls LibraryShop main store

Explainer

Ladder logic symbols and what each one does in a rung

PLC programming Published 8 min read

Short answer

A rung is true when continuity from the left rail reaches the coil or instruction at its right end. Contacts pass or block that continuity, coils write outputs, seal-in and set/reset hold state, timers and counters qualify it over time, edge contacts fire once per transition, and math, comparison and function blocks handle data. X, Y, T, C and FB are generic labels for the element classes.

On this page
  1. How a rung is read
  2. The symbol set at a glance
  3. Contacts: normally open and normally closed
  4. Coils, seal-in and set/reset
  5. Timers and counters
  6. Edge contacts
  7. Math, comparison and function blocks
  8. A start-stop rung, scan by scan
  9. Which symbol for the job
  10. Questions asked

Ladder logic is read one rung at a time: a rung is true when continuity from the left power rail reaches the coil or instruction at its right end, and every rung is evaluated again on every scan. The symbols fall into a handful of classes — contacts, coils, seal-in, set/reset, timers, counters, edge contacts, math, comparison and function blocks — and each class answers one question about that continuity. IEC 61131-3, the standard that defines PLC programming languages, makes Ladder Diagram one of its languages, with contacts and coils as the basic elements and function blocks as boxed additions; the choice between the languages is covered in which IEC 61131-3 PLC language to use for each control task. The standard fixes what the elements mean, while each vendor draws and labels them its own way, so this reference uses generic labels: X for input conditions, Y for outputs, T for timers, C for counters and FB for function blocks.

How a rung is read #

The two vertical lines are the rails; everything between them is evaluated left to right. Contacts in series are AND logic — every one must pass. Contacts in parallel are OR logic — any one passing is enough. The last element on the right is what the rung writes: usually a coil, sometimes a timer, counter or function block. The rung's result lands in the output image during the output phase of the scan, which what the PLC scan cycle does in each pass breaks down step by step.

The symbol set at a glance #

Each row answers two questions: what the element examines, and what it does when it passes.

Symbol Label Passes or runs when What it does
Normally open contact X the address is TRUE passes continuity
Normally closed contact X the address is FALSE passes continuity; drawn with a slash
Output coil Y continuity reaches it writes the output TRUE for that scan
Seal-in contact Y the output is already on holds the rung without the start condition
Set coil S its rung is true latches the output on
Reset coil R its rung is true latches the output off
Timer T its rung holds true for the preset done bit passes after the delay
Counter C its input steps count moves up or down; done at the preset
Rising-edge contact ↑ the address steps FALSE to TRUE true for exactly one scan
Falling-edge contact ↓ the address steps TRUE to FALSE same one-scan pulse, on the fall
Math element + - * / its rung is true writes the computed value
Comparison contact > < = the relation holds passes continuity like a contact
Function block FB the rung reaches it runs its packaged logic, updates its outputs

Contacts: normally open and normally closed #

A normally open contact is drawn as a break in the rung — two short upright strokes with a gap — and it passes when its address is TRUE. The normally closed version adds a slash across the strokes and passes when its address is FALSE. Nothing else is encoded: the symbol describes what the logic examines, not what the field device looks like.

That distinction matters most on stop buttons. Wire the stop chain normally closed and the input is TRUE while the button sits healthy, FALSE when pressed or when a wire breaks; examine that input with a normally open contact and the rung dies on a press or on a broken wire alike. That wiring is fail-safe control practice, not a safety function — an emergency stop still belongs in hardwired or safety-rated devices, never in a ladder contact.

Coils, seal-in and set/reset #

A coil writes its output to the state of the rung: continuity present, output TRUE that scan. To make the output survive the release of a momentary button, put the coil's own normally open contact in a parallel branch around the start contact — the seal-in. Once the coil has been on, that branch holds the rung without the start condition, while the series stop chain still kills it. The whole pattern is built end to end in how to program a sealed motor starter rung in STEP 7 ladder.

Set and reset coils take the other approach to memory: a set coil latches the output on, a reset coil latches it off, and there is no holding branch anywhere. If both could be true in the same scan, which one wins is a property of the instruction — so write the logic so they never are, set and reset from mutually exclusive rungs. Choosing between the two styles changes how the circuit fails and how it resets; when to use set/reset or seal-in logic for a latching output goes deeper on that trade.

Timers and counters #

A timer passes its done bit only after its rung has held continuity for the preset time, and the delay is preset multiplied by time base. On a timer with a 100 ms time base, a preset of 50 gives 50 × 100 ms = 5000 ms, so 5 s of continuous rung truth before done. An on-delay timer of the TON kind clears its elapsed value the moment its rung drops, so a flickering input never accumulates toward the preset. If a timer output seems to outlive its rung, the usual cause is a second write to that same output elsewhere in the program; why a CODESYS TON output stays on after its rung goes false traces one such case.

A counter steps its stored count on each false-to-true transition of its input, up or down depending on its type, and its done bit passes when the count reaches the preset. With a preset of 12 and a current count of 9, it needs 12 - 9 = 3 more pulses. Programming a two-pump station with flowmeter pulses on an FX3U shows a counter fed from a real pulse train.

Edge contacts #

The rising-edge contact, marked ↑ in most editors (one common lettering is |P|), passes for exactly one scan when its address steps from FALSE to TRUE; the falling-edge contact, ↓, does the same on the step down. At a 10 ms scan time that one-scan pulse is 10 ms wide — enough for exactly one evaluation of every rung that reads it, and far too short for an operator or a slow polling client to notice. Use an edge contact when the action must happen once per press or once per transition — stepping a sequence, capturing a value, firing a one-shot — and never when the action must persist for as long as the condition holds.

Math, comparison and function blocks #

Math elements (+, -, *, /) run when their rung is true and write the result to a register; scaling a raw analog count into engineering units is the everyday case. Comparison contacts (>, <, =) sit in the rung like contacts and pass continuity while the relation holds, so a tank alarm rung is just a > contact of the level against its trip value feeding a coil. A function block is the boxed element: it packages internal logic behind named inputs and outputs, runs when the rung reaches it, and updates its outputs from its inputs. Continuity reaching the box tells you it executed, not what it did — read its inputs and outputs, not its name; writing a PLC function block for gripper open and close control shows that packaging from the inside.

A start-stop rung, scan by scan #

Take the standard circuit with generic addresses: X0 is the start pushbutton, wired normally open; X1 is the stop pushbutton, wired normally closed; Y0 is the motor contactor coil.

   X0        X1              Y0
--| |----+---| |-------------( )
         |
   Y0    |
--| |----+
  • Scan 1, nobody touching anything: X0 is FALSE, so the left branch blocks, and the Y0 seal-in contact is FALSE because the coil has never been on. No continuity: Y0 is written FALSE.
  • Scan 2, start pressed: X0 TRUE opens the left branch, X1 TRUE (stop healthy) passes its contact, and Y0 is written TRUE at the output write.
  • Scan 3, start released: X0 is FALSE again, but Y0's own contact now reads the TRUE value written in scan 2, the parallel branch passes, and Y0 holds. At a 10 ms scan the button only needed to be closed for one scan for the seal to catch.
  • Scan n, stop pressed: X1 goes FALSE, its series contact opens, Y0 is written FALSE. On scan n + 1 the seal-in contact reads FALSE, so letting the stop back out does not restart the motor — only a fresh press of X0 will.

Which symbol for the job #

  • A momentary button must start something that keeps running: normally open start contact, normally closed-wired stop examined with a normally open contact, the coil, and the coil's own contact in a seal-in branch.
  • The action must happen once per press or per transition: rising-edge contact, ↑.
  • The action must wait: on-delay timer, T, with delay equal to preset times time base.
  • Events must be counted to a target: counter, C, with a preset and a reset rung.
  • State is set in one place and cleared in another: set and reset coils, on mutually exclusive rungs.
  • The rung must decide on a value: comparison contact; it must produce one: math element.
  • The same logic serves several rungs or several machines: a function block.

Whatever the symbol, the read is the same every time: find the condition contacts on the left, note which are in series and which in parallel, follow continuity to the last element, and name what that element writes.

Questions asked

Why don't real PLC programs use X, Y, T and C addresses?

The single letters are a teaching convention for the element classes. Every PLC family has its own address notation, with prefixes or tag names that its programming manual defines, and timers and counters often reserve their own numbered memory. When you move a rung onto a real controller, keep the structure — series, parallel, seal-in branch — and re-enter the addresses in that controller's format; the logic itself does not change.

Can one rung drive more than one coil?

It depends on the editor. Some let you hang several coils off one rung in parallel branches or in series at the right end; others enforce one output coil per rung. Even where it is allowed, keep one coil per rung whenever the outputs could ever need to disagree, because a later edit that breaks the shared branch takes every output down with it.

What does a plain coil do when its rung goes false?

It writes its output FALSE on every scan that continuity is absent. An ordinary coil therefore holds nothing: the moment the conditions drop, the output drops. Memory needs the coil's own contact in a seal-in branch, or a set coil that stays latched until a reset coil runs. That is why a motor started through a plain coil stops as soon as you release the button.

Does a rising-edge contact keep firing while its input stays on?

No. It arms on the false state and produces a single pulse on the false-to-true step, so a held input gives one pulse, not a train. To fire again, the input must drop out and come back. If an action must repeat while a condition holds, generate the repeats with a self-resetting timer and trigger from the timer's edge, not from the raw input.

Keep reading

  • How-to

    How to program a sealed motor starter rung in STEP 7 ladder

    Program the rung as Q0.0 = I0.1 AND I0.2 AND (I0.0 OR Q0.0): Start I0.0 in parallel with a seal-in contact on the output, Stop I0.1 and overload I0.2 in series, both normally closed field contacts sitting at logic 1. The seal-in contact holds Q0.0 on from the scan after Start is released; pressing Stop drops I0.1 to 0 and de-energizes the coil.

    PLC programming

  • How-to

    How to learn Siemens ladder logic programming step by step

    Learn Siemens ladder logic as two skills, not one tutorial: read LAD contacts, coils and boxes through the PLC scan cycle, and turn the controlled process into an I/O list plus a stopped, running and faulted operating table before writing networks. Practice each skill one instruction at a time in a simulator or on an isolated training PLC, with manuals for the exact controller and STEP 7 you run.

    PLC programming

  • Selection guide

    Choosing a PLC ladder logic simulator for practice

    Choose the vendor's own simulator when you must practice that PLC's workflow; otherwise a CODESYS-based soft PLC gives generic IEC 61131-3 practice. An unlicensed CODESYS runtime exits after 2 hours, and TwinCAT 3 needs Windows 10 or 11 and at least 4 GB RAM, so pick by target platform, not by a 'best' label.

    PLC programming