Instruction List PLC Programming: Examples & Calculator

Share:
PLC
Instruction List PLC Programming: Operators, Ladder to IL Examples and Scan Time

Instruction List is the assembly style text language of IEC 61131 3, where every line works on one current result. We cover the operators, convert real ladder rungs into IL, call timers and estimate scan time.

IEC 61131 3 LD, AND, OR, ST Ladder to IL TON in IL Scan Time Calculator

Instruction List looks old fashioned, yet many running machines and Siemens STL blocks still use it. Here you will learn to read, write and convert it.

Hello everyone, today we are going to learn instruction list plc programming from the accumulator idea to real ladder conversions, timers, counters and a scan time estimate.
instruction list plc programming
Quick Answer

What is instruction list PLC programming and how does it work?

Instruction list PLC programming is a low level text language from IEC 61131 3 in which each line holds one operator and one operand acting on a single register called the current result. For example, LD Start, OR Motor, ANDN Stop and ST Motor build a complete start stop seal in circuit in four lines. IL was deprecated in the 2013 third edition, so new projects normally use ladder or structured text.

What Is Instruction List in PLC?

Instruction list plc programming means writing PLC logic as a column of short mnemonic commands, one per line, very much like microprocessor assembly. Each command reads or changes one hidden register, the current result, so the order of lines decides the logic.

Key Facts
  • IL is one of the five original IEC 61131 3 languages.
  • Every operator works on the current result (CR), also called the accumulator.
  • Core operators: LD, ST, S, R, AND, OR, ADD, GT, JMP and CAL.
  • IL was marked deprecated in the third edition of IEC 61131 3 published in 2013.
  • Siemens STL (AWL in German) is a close relative.

If you know basic ladder logic, instruction list plc programming feels like reading the same rung aloud from left to right. The IEC 61131 3 language family treats IL as the textual twin of ladder, so many older editors switch a rung to IL with one click.

Do You Know?

Wikipedia notes that Siemens users know IL as STL in English or AWL in German. The Siemens editor even lets you choose German or international mnemonics.

Advertisement

How Does the Current Result (Accumulator) Work?

The current result is a single working register that every IL line either loads, modifies or copies out. The PLCopen text of the standard describes most operators as result := result OP operand, so the CR is always the hidden left side of the operation.

Think of the CR as a calculator display: LD puts a new value on it, AND and OR combine it with the operand, and ST copies it into a variable. A Boolean rung therefore starts with LD and ends with ST, S or R.

The CR can also hold an INT or REAL, so ADD, SUB, MUL and DIV do the jobs of PLC math instructions in ladder. Types must match, so adding an INT to a loaded REAL is a compile error.

LD 2
MUL( 2
ADD 3
)
ST Result
Result = 2 × (2 + 3) = 10

Beckhoff documents this example for TwinCAT: the bracket defers MUL until 2 + 3 is evaluated. Without the bracket the same lines give 2 × 2 + 3 = 7.

Instruction List Operators and Modifiers

IL operators fall into load and store, Boolean logic, arithmetic, comparison and program flow groups. Three modifiers change them: N negates the operand, C makes a jump or call conditional, and a bracket defers the operation.

OperatorModifiersWhat it does to CRExample
LDNCR = operandLD Start
STNoperand = CRST Motor
S / RnoneSet or reset BOOL if CR is TRUES Pump
AND / OR / XORN, (CR = CR op operandANDN Stop
ADD SUB MUL DIV(Arithmetic on CRADD 3
GT GE EQ NE LE LT(CR becomes BOOL resultGT 80
JMPC, NJump to labelJMPC Skip
CALC, NCall function blockCAL T1

A common trap is the N modifier. Beckhoff states that in LDN, ANDN and ORN the N negates the operand and not the accumulator, so ANDN Stop means CR AND NOT Stop.

Quick Tip

Write one comment per block of lines saying which rung it replaces. IL has no graphics, so a single line like Motor start interlock saves the next engineer a lot of decoding.

How to Convert Ladder Logic to Instruction List?

Convert a rung by walking it from the left rail to the coil: the first contact becomes LD, series contacts become AND, parallel branches become OR, and the coil becomes ST. Normally closed contacts use the N form, so they become LDN, ANDN or ORN.

instruction list plc programming ladder rung converted to IL lines diagram
Diagram by Instrumentation Blog showing a start stop seal in ladder rung and the four matching IL lines with the current result after each line.
1
First contact
LD for normally open, LDN for normally closed.
2
Series contacts
Each becomes AND or ANDN.
3
Parallel branches
One contact is OR; several need OR( and a closing bracket.
4
Output
Coil is ST, latch is S, unlatch is R.

The classic motor start stop rung is the best first example. In ladder, Start and the Motor seal in contact sit in parallel, followed by a normally closed Stop button, which you can compare with more rungs in our ladder logic examples.

LD Start
OR Motor
ANDN Stop
ST Motor
Motor = (Start OR Motor) AND NOT Stop

Next, a lamp glows when A and B are on, or when C and D are on. The second pair is a parallel branch, so it needs the OR( bracket.

LD A
AND B
OR( C
AND D
)
ST Lamp
Lamp = (A AND B) OR (C AND D)

Latching is just as short: LD Fill_PB then S Pump sets the pump, and LD High_Level then R Pump resets it. The pair acts like ladder latch and unlatch coils, a memory element in Boolean algebra terms.

Siemens STL writes the same seal in with its own mnemonics: A( O Start O Motor ) AN Stop = Motor. Siemens calls the current result the RLO, the result of logic operation, but the idea is identical to IEC instruction list plc programming.

Advertisement

How to Use Timers and Counters in IL?

Timers and counters are function blocks, so in IL you call them with CAL and then read their outputs with LD. You can pass inputs inside the CAL brackets, or store them into the instance first and call it afterwards.

CAL T1(IN := Delay_Req, PT := T#5S)
LD T1.Q
ST Horn
Horn turns on 5 s after Delay_Req

This is the IL form of the on delay explained in TON, TOF and RTO timer instructions. T1 must be declared as a TON instance, and the call must run every scan or the elapsed time will freeze.

CAL C1(CU := Box_Eye, R := Reset_PB, PV := 12)
LD C1.Q
ST Carton_Full
Carton_Full = TRUE after 12 boxes

CTU detects the rising edge of CU internally, as in CTU and CTD counter instructions. LD Tank_Level, GT 80, ST High_Alarm builds an alarm like ladder compare instructions.

Do You Know?

The PLCopen copy of the IL clause lists input operators such as IN, PT, CU and PV for blocks like TON and CTU. You can load a value and send it straight to one block input.

How Does a PLC Execute Instruction List Code?

The CPU executes IL strictly top to bottom, one line at a time, updating the current result after each line until it reaches the end of the POU. Only jumps and calls change that order, and the whole program then repeats in the next scan.

The flowchart below follows a single line through the CPU. Read it together with how the PLC scan cycle works, because IL only covers the logic solving part of the scan.

flowchart of PLC executing instruction list lines with current result
Diagram by Instrumentation Blog showing a flowchart of how the CPU reads each IL line, updates the current result by operator type and loops until outputs are written.

Jumps are where instruction list plc programming becomes powerful and risky. JMPC Skip jumps only when CR is TRUE, and JMPCN jumps when it is FALSE, which works like the jump and label pair in JSR and JMP subroutine instructions.

Advertisement

Is Instruction List Still Used in PLC Programming?

Yes, IL is still found in many installed machines and older Siemens projects, but it is deprecated and not a good choice for new code. IEC marked it deprecated in the 2013 third edition, and the 2025 fourth edition lists structured text as its only textual language.

Today, instruction list plc programming mostly means maintaining S7 300 or S7 400 STL blocks and old CODESYS projects. In TIA Portal, STL is offered for S7 1500 but not for S7 1200, as our S7 1200 vs S7 1500 comparison explains.

PointInstruction List (IL)Ladder (LD)Structured Text (ST)
StyleText, one operator per lineGraphic contacts and coilsText, Pascal like
IEC statusDeprecated in 2013CurrentCurrent
Best forShort, fast Boolean logicInterlocks, electriciansMath, loops, data

For new work, structured text programming gives you the same compact text style with IF, CASE and FOR statements that IL never had. A one line ST statement, Motor := (Start OR Motor) AND NOT Stop;, replaces the four IL lines and reads far more clearly.

Advantages of IL
  • Very compact code and small memory footprint
  • Shows how the CPU solves logic
  • Fast execution on older processors
  • Close match to Siemens STL used in many plants
Limitations of IL
  • Deprecated in IEC 61131 3 edition 3
  • Hard to debug in long programs
  • No IF, CASE or loops, only jumps
  • Easy to break by changing line order
Myth: IL is faster than every other language on modern CPUs.
Fact: On modern controllers, ladder, FBD and ST are compiled to native code too, so any speed difference is usually small.
Myth: ANDN inverts the whole result built so far.
Fact: N negates only the operand, so ANDN Stop means CR AND NOT Stop.
Myth: Deprecated means IL code stops running.
Fact: It only means not recommended for new work; existing IL keeps running.

How to Estimate Scan Time for an IL Program?

Multiply the instruction count by the datasheet time per instruction, convert to ms, and add the fixed overhead for I/O and housekeeping. The result shows whether logic or overhead decides the cycle time.

Scan time (ms) = (N × t) ÷ 1000 + overhead
N = 4000, t = 0.08 µs, overhead = 0.5 ms
Logic = 4000 × 0.08 ÷ 1000 = 0.32 ms
Scan = 0.32 + 0.5 = 0.82 ms
IL Scan Time Estimator
Estimated scan time
0.82 ms total (logic 0.32 ms + overhead 0.5 ms)
scan time formula infographic for an instruction list PLC program
Diagram by Instrumentation Blog showing the scan time formula card with the 4000 instruction solved example and a bar chart of logic versus overhead time.

Datasheets quote separate times for bit, word and floating point instructions, so use a weighted average for t. Compare the result with the cycle time limit set by the PLC watchdog timer.

Quick Tip

Count steps, not rungs. One CAL to a timer instance may cost far more than a single bit instruction.

Common Instruction List Mistakes and Troubleshooting

Most faults in instruction list plc programming come from line order: a new LD silently overwrites the current result, and a missing bracket changes the logic without any error. The table lists the symptoms you will see online and how to fix each one.

SymptomLikely causeFix
Output follows only the last contactSecond LD started a new CRUse AND or OR instead of LD
Logic correct only for one branchMissing OR( bracketAdd OR( and the closing )
Timer never finishesCAL skipped by a jumpCall the TON every scan
Output stays on after stopS used without matching RAdd R or use ST
Stop button works backwardsAND used for NC wiringCheck field contact and use ANDN
  • Every block starts with LD or LDN after the previous store
  • Each opening bracket has a matching closing bracket
  • Each output is written by only one ST, or one S and R pair
  • Timer and counter instances are called every scan
  • Jump labels are unique and jumps never skip a CAL by accident

When you migrate old instruction list plc programming, rewrite it block by block and test each one in a simulator first. Our list of free PLC programming software includes editors with IL and ST support that run on a normal laptop.

PDF
PLCopen: Instruction List (IL) clause of IEC 61131 3
Operators, modifiers, function block calls and input operators from the standard text

Instruction List PLC Programming FAQ

What is instruction list plc programming in simple words with an example?

It is a text language where each line has one operator, such as LD, AND or ST, working on a single current result. For example, LD Start, ANDN Stop, ST Motor turns the motor on while Start is pressed and Stop is not pressed.

What is the difference between instruction list and ladder logic in a PLC?

Ladder draws contacts and coils graphically, while IL writes the same logic as text lines such as LD, AND and ST. Ladder is easier to troubleshoot online, but IL is more compact.

A four contact rung usually becomes four or five IL lines.

How do you convert a ladder rung into instruction list step by step?

Start with LD for the first contact, use AND for series contacts and OR for parallel ones, then end with ST for the coil. Normally closed contacts take the N form, so a Stop button becomes ANDN Stop.

Branches with two or more contacts need OR( and a closing bracket.

Why was instruction list deprecated in IEC 61131 3 third edition?

IEC deprecated IL in the 2013 edition because structured text covers the same textual role with far better readability and structure. IL has no IF, CASE or loops, so large programs become hard to maintain.

The 2025 edition lists ST as its only textual language.

Which mistakes cause wrong outputs in an instruction list PLC program?

The most common mistake is a second LD in the middle of a rung, which throws away the result built so far. Missing brackets, timers skipped by jumps and two ST lines writing one output also cause wrong or flickering outputs.

Advertisement

Related Articles

External References

What We Learn Today

  • Instruction list plc programming uses one operator per line acting on a current result, so LD, AND, OR and ST build any Boolean rung.
  • Ladder rungs convert by walking from left rail to coil, using N forms for normally closed contacts and brackets for parallel branches.
  • IL was deprecated in the 2013 edition of IEC 61131 3, so use it for maintenance and choose ladder or structured text for new work.
I hope you like above blog. There is no cost associated in sharing the article in your social media. Thanks for reading!! Happy Learning!!
Sunayana Gadepatil, author at Instrumentation Blog
Author · instrumentationblog.in
Ms. Sunayana Gadepatil is an instrumentation professional, technical writer, and the author behind Instrumentation Blog. With a strong interest in industrial instrumentation, process measurement, and automation, she specializes in simplifying complex technical concepts into clear, practical, and easy to understand insights. Through her articles, Ms. Sunayana shares valuable knowledge on flow, pressure, level, temperature, control systems, and industrial automation for engineers, students, technicians, and industry professionals.
Technically reviewed on

Leave a Reply

Your email address will not be published. Required fields are marked *

Support free learning

Help keep every guide, calculator and tool 100% free

Hosting, software and hours of research go into every article. Even a small contribution helps us publish more in-depth guides for students, technicians and engineers.

  • No paywalls
  • No sign up
  • Free for everyone