Single Push Button Toggle
One momentary push button toggles the output between ON and OFF on every press. The R_TRIG function block fires Q for a single scan on the rising edge of I0.0; that one-scan pulse XORs the output bit, so every press flips it. The industrial-standard "edge → toggle" pattern.
TRY ITPress I0.0 four times. The output flips once per press, not once per scan — that is the edge doing its job.
AND Logic Gate
Both inputs must be TRUE before the output energizes: contacts in series are an AND. Machines are built out of this — a press cycles only when the guard is closed AND the operator presses the button — and adding one more condition means adding one more contact in the line.
TRY ITTurn on I0.0 alone, then I0.1 alone, then both. Only the last case lights the coil.
OR Logic Gate
Either input on its own energizes the output: parallel branches are an OR. This is how a machine gets two ways to do one thing — a panel button and a foot switch, or a local start and a remote one.
TRY ITSwitch on either input alone and watch the power take that branch. Turning the second one on changes nothing: an OR is satisfied once.
Seal-In (Latch) Circuit
A momentary START button latches the motor ON through a parallel seal-in contact. STOP is a series NC contact, so it always breaks the latch. The most fundamental PLC pattern.
TRY ITTap START and let go. The motor stays on because the coil now feeds its own rung through the seal-in contact. Press STOP to break it.
Set / Reset Coils — Latch Without a Seal-In
The same latch as the seal-in rung, built from a set coil and a reset coil instead of a feedback contact. A set coil writes TRUE and walks away; a reset coil writes FALSE. Two short rungs replace one rung with a seal, and the intent reads straight off the page — but the output is now written from two places, so the rung the scan reaches last is the one that wins a tie.
TRY ITTap START and let go: the motor stays on with no seal-in contact anywhere. Then tap STOP. Now turn both on at once and see which rung wins.
Safety Interlock
The run request passes through a chain of safety conditions, and each of those conditions is wired as a normally-closed contact. That is deliberate: an NC chain reads a cut wire or a dead sensor as "not safe", so the failure lands on the safe side. Wire the interlocks as NO contacts instead and a broken wire looks exactly like a closed guard.
TRY ITTurn on I0.0 to request the start, then toggle either interlock (I0.1 or I0.2) to simulate that guard opening. One is enough to drop the permit — that is what a chain is for.
TON Timer — On-Delay Motor Start
The motor starts only after the request has been held for five continuous seconds. TON accumulates while its input stays TRUE and drops ET straight back to zero when it goes FALSE, which makes it an on-delay rather than a stopwatch. Warn-before-start horns, pump prime times and filter purges are all this rung.
TRY ITGo online, hold I0.0 and watch ET climb. Let go before five seconds and ET snaps to zero — you start again from nothing.
CTU Counter — Part Counter
A proximity sensor pulses once per part and the counter adds them up, energizing an output when the batch reaches its preset of ten. Counters count edges, not time, so a sensor left blocked adds one — not one per scan. Every packaging line runs on this rung.
TRY ITToggle I0.0 on and off ten times and watch CV climb, then press the reset and watch it drop to zero.
R_TRIG — Rising Edge Detection
A button held for a second is TRUE for hundreds of scans; R_TRIG turns that into a single TRUE scan at the moment of the press. That one-scan pulse is what lets you count a press once, advance one step, or latch a value once instead of continuously.
TRY ITHold I0.0 down. The output pulses once and goes out while you are still holding — that is an edge, not a level.
TOF Timer — Off-Delay Fan Cooldown
The fan keeps running for ten seconds after the motor stops. TOF holds its output TRUE while the input is TRUE and only begins timing when the input drops, which is the classic run-on. Extraction fans, spindle brakes and lubrication pumps all work this way.
TRY ITSwitch I0.0 on, then off, and watch the output stay energized while ET counts up to the preset.
CTUD Counter — Bi-directional Parking Counter
Counts cars entering on CU (I0.0) and exiting on CD (I0.1). R (I0.2) resets the count to zero — reset has priority over CU/CD per IEC 61131-3. QU rises when CV ≥ PV (lot full); CV clamps at PV and never wraps around. QD rises when CV ≤ 0 (lot empty).
TRY ITCount a few cars in on I0.0 and back out on I0.1 to see CV move both ways. Then hold the reset while pressing count-up: nothing moves, because reset wins.
Timer + Counter — Timed Batch with Auto-Reset
One block drives the next: the timer runs a fixed dwell and its Q feeds the counter, so the counter tallies completed cycles rather than parts. Counters step on a rising edge, which is why a timer that stays done adds one and then stops. The lesson is that a block output is just another rung condition — chaining them is how real logic gets built.
TRY ITHold the input and watch CV step up once each time the timer finishes, not once per scan. Drop the input to rearm the timer for the next cycle.
F_TRIG — Falling Edge Detection
The mirror of R_TRIG: one TRUE scan at the moment a signal goes away. Falling edges catch the release of a button, the trailing edge of a part passing a sensor, or the loss of a permit — anything where the interesting moment is the drop rather than the level.
TRY ITPress and hold I0.0 and nothing happens. Release it and the output pulses once.
TP Timer — Pulse Generator
One rising edge produces a pulse of exactly three seconds, however briefly the input is pressed and however many times it is pressed while the pulse runs. TP is the fire-and-forget timer — a glue shot, a stamp, a horn blast, an air blast that has to last the same time every cycle.
TRY ITTap I0.0 and release at once: the pulse still runs its full length. Tap it again mid-pulse and nothing restarts.
CTD Counter — Countdown Dispenser
A dispenser loaded with a batch size counts down as it dispenses and signals when it reaches zero. CTD is the counter for when the interesting number is what remains rather than what has passed — doses left, labels left, retries left.
TRY ITPress the load input first to fill CV with the preset, then count down to zero and watch the output energize.
GT Comparison — Over-Temperature Alarm
An analog reading is compared against a limit and the alarm energizes above it. Comparison blocks are how analog values reach ladder logic at all: the rung stays boolean, so the comparison is what turns degrees into a yes or no. Note there is no hysteresis here — a value hovering on the limit will chatter.
TRY ITWhile online, set the register just below the setpoint, then just above it, and watch the alarm follow.
ADD — Speed Offset Calculation
A trim value is added to a base speed and the result written to an analog output word. Math blocks work on words rather than bits, so the block sits on the rung as a step in the calculation while the rung itself decides whether that calculation runs at all.
TRY ITChange the trim register while online and watch the output word track it.
MOV — Register Transfer
Copies a value from one register into another while the rung has power — how a recipe value, a setpoint or a preset reaches the register a block reads. MOV computes nothing; it moves, which makes it the plainest way to select between prepared values.
TRY ITToggle the enable and watch the destination register take the source value only while the rung is powered.
SUB + LT — Low Level Detection
Two blocks on one rung: a subtraction works out what is left in the tank and a comparison decides whether that is too low. This is the everyday shape of analog logic — compute, then judge — and it shows a value handed from one block to the next inside a single rung.
TRY ITRaise the consumption register until the computed level crosses the threshold and the low alarm energizes.
MUL — Speed Scaling
A speed setpoint is scaled by a gear ratio before it reaches the drive. Scaling is the most common arithmetic on a machine: converting between engineering units, applying a ratio, or turning a percentage into a raw output value.
TRY ITChange the ratio register while online and watch the scaled result move with it.
DIV — Flow Rate Calculation
Divides total volume by elapsed time to compute flow rate. Per IEC 61131-3, when the divisor IN2 is zero the DIV block sets ENO = FALSE and the downstream coil drops — toggle MW22 to non-zero with the data editor to see CALC DONE energize. Never assume IN2 ≠ 0 without a guard.
TRY ITSet MW22 to zero with the data editor: the calculation faults and CALC DONE drops. Set it back to a non-zero value and the rung recovers.
EQ — Setpoint Match
The output energizes only while the process value equals the setpoint exactly. Equality is the right test for discrete things — a recipe number, a step number, a position index — and the wrong test for an analog measurement, which rarely lands on an exact value.
TRY ITSet the process register one count away from the setpoint and the output drops. Exactly equal is a narrow target.
NE — Recipe Change Detect
The output energizes while the running recipe number differs from the one selected on the panel — the cue to reload parameters, or to block a start until the operator confirms the change. NE is the comparison to reach for when "anything but this" is the interesting case, and it is the only one of the six that is TRUE most of the time.
TRY ITSet both registers to the same number and the mismatch clears. Change either one and it comes straight back.
GE — Minimum Pressure Guard
The permit is given at or above a minimum pressure, not merely above it. GE and GT differ by exactly one value, and on a threshold a machine can sit on, that one value decides whether it runs or waits.
TRY ITSet the reading exactly equal to the threshold. GE energizes where GT would not.
LE — Temperature Limit
The run permit holds while temperature stays at or below the safe limit. Written this way the rung states the safe condition rather than the fault, which is how it should read inside an interlock chain: every condition TRUE means the machine may run.
TRY ITRaise the temperature register past the limit and watch the permit drop the moment it exceeds it.
SR — Set-Dominant Latch
Set-dominant flip-flop: when both S1 and R are TRUE simultaneously, output stays TRUE. Used for safety interlocks where the SET condition must win.
TRY ITTurn S1 and R on together. The output stays on: the set input wins, which is what set-dominant means.
RS — Reset-Dominant Latch
Reset-dominant flip-flop: when both S and R1 are TRUE simultaneously, output goes FALSE. Used where safety reset must override set.
TRY ITTurn S and R1 on together. The output goes off: reset wins, the safer default when the reset is a stop.