Instruction List (IL) in PLC Programming
Instruction List (IL) is the assembly-like programming language defined in IEC 61131-3 — terse mnemonic instructions executed top-to-bottom, similar to writing assembly for a stack-based virtual machine. The 2013 revision of IEC 61131-3 deprecated IL in favour of Structured Text. New projects use ST; you only encounter IL when maintaining legacy Siemens STL code or older Mitsubishi/Allen-Bradley projects from the 1990s and early 2000s.
Important context: IL is deprecated
The IEC 61131-3 standard deprecated Instruction List in the 2013 revision. The successor is Structured Text. New projects should use ST; modern PLCs (Siemens S7-1500, Allen-Bradley ControlLogix 5580, Beckhoff CX) still compile IL for backward compatibility, but tooling support is being phased out. Siemens TIA Portal still includes STL (their IL-equivalent) for migrating S7-300/400 code to S7-1500. Beyond migration, there is no reason to write new IL.
IL syntax
IL operates on a single "current result" (CR) — equivalent to the accumulator on a stack-based CPU. Each instruction either loads a value, modifies the CR, or stores it.
(* Boolean rung: Out := A AND NOT B *)
LD A (* load A into CR *)
ANDN B (* AND CR with NOT B *)
ST Out (* store CR to Out *)
(* Arithmetic: result := (a + b) * c *)
LD a
ADD b
MUL c
ST result
(* Conditional: jump if zero *)
LD counter
EQ 0
JMPC TARGET
LD counter
SUB 1
ST counter
TARGET:
LD counter
ST outputInstruction reference
| Group | Instructions | Purpose |
|---|---|---|
| Load/Store | LD, LDN, ST, STN | Move data into/out of current result |
| Set/Reset | S, R | Latch and unlatch booleans |
| Boolean | AND, ANDN, OR, ORN, XOR, XORN, NOT | Boolean operators on CR |
| Arithmetic | ADD, SUB, MUL, DIV, MOD | Math on CR |
| Comparison | GT, GE, EQ, NE, LE, LT | Compare and store boolean in CR |
| Jump/Call | JMP, JMPC, JMPCN, CAL, CALC | Control flow (conditional based on CR) |
| Return | RET, RETC, RETCN | Return from POU |
Why IL was deprecated
- Hard to read. Each line is one operation; even simple expressions span 4-5 lines. Code review and maintenance are slow.
- No standard data types beyond basics. Strings, structures, arrays are awkward to manipulate.
- Vendor variants diverge. Siemens STL, Mitsubishi MELSAP, Allen-Bradley legacy IL — all looked similar but compiled differently.
- Modern CPUs don't need it. ST compilers produce machine code as efficient as hand-written IL on modern 32-bit ARM/x86 PLC CPUs.
- OOP extensions don't fit. The 2013 revision added classes, inheritance and methods to ST — IL syntax couldn't support them cleanly.
When you'll still see IL
- Legacy Siemens S7-300/400 STL code. Siemens STL is functionally equivalent to IL. TIA Portal still compiles it for S7-1500 backward compatibility, and migrations from S7-300 to S7-1500 typically preserve STL blocks rather than rewriting them.
- Older Mitsubishi MELSEC Q/L series projects in industrial Asia.
- Allen-Bradley legacy SLC-500 / PLC-5 code compiled before Studio 5000 — pure ladder, but with SCP / structured equivalents that read like IL.
- Pulse-by-pulse motion code — some older servo controllers expose IL-style microcode for tight motion loops.
If you encounter IL today, treat it as legacy code: read it, document it, but don't extend it. Convert to Structured Text when you next have to make significant changes.