A Programmable Logic Controller replaces hard-wired relay logic with software. Field devices still wire to it, but the "rungs" live in the program.
The scan cycle
- Read all inputs into memory
- Solve the ladder program top to bottom, left to right
- Write results to the outputs
- Repeat (every few milliseconds)
Core instructions
| Instruction | Symbol | True when… |
|---|---|---|
| XIC Examine If Closed | -] [- | bit = 1 |
| XIO Examine If Open | -]/[- | bit = 0 |
| OTE Output Energize | -( )- | sets bit = rung condition |
| OTL / OTU Latch / Unlatch | -(L)- -(U)- | set / clear and hold |
| TON Timer On-Delay | [TON] | .DN after PRE time with rung true |
| CTU Count Up | [CTU] | counts false→true transitions; .DN at PRE |
| TOF / RTO Off-delay / Retentive timer | [TOF] [RTO] | TOF keeps .DN on for PRE after the rung drops; RTO keeps its time until RES |
| CTD Count Down | [CTD] | subtracts 1 per false→true transition |
| ONS One-Shot | -[ONS]- | true for exactly one scan on a rising edge |
| EQU NEQ GRT LES GEQ LEQ Compare | [GRT] | compares two values (e.g. a counter ACC to 5) |
| MOV / ADD / SUB Math | [ADD] | moves or calculates into an N7 integer, timer or counter word |
Troubleshooting with I/O LEDsField device on but input LED off → input wiring/sensor problem. Output LED on but device not running → output fuse, wiring or the device itself. LEDs right but machine wrong → look at the logic. Practice this in the simulator's 🔧 Troubleshoot tab.
Addressing in this simulator
I:0/0–I:0/7 inputs · O:0/0–O:0/7 outputs · B3:0/0 internal bits · T4:0 timers · C5:0 counters.
Key ideaXIC/XIO examine the bit in memory, not the physical button type. A NC stop button holds its input ON, so you program it with XIC.
🔧 Field ProTroubleshooting with a PLC: check the input LED first (is the field device actually turning on the input?), then the logic online (which instruction on the rung is false?), then the output LED and the field wiring to the load. That splits the problem into "field input," "logic," and "field output."