PLC Programming Instruction List
Introduction
Instruction List (IL) is a low-level programming language used in programmable logic controllers (PLCs). It consists of a series of instructions executed in sequence.
Steps
- Read about Instruction List (IL) programming.
- Understand the basic IL commands for logic gates and mathematical operations.
Writing Simple IL Programs
Logic Gates
- AND Gate: Y = A AND B
LD A ; Load A
AND B ; AND with B
ST Y ; Store result in Y
- OR Gate: Y = A OR B
LD A ; Load A
OR B ; OR with B
ST Y ; Store result in Y
- NOT Gate: Y = NOT A
LD A ; Load A
NOT ; NOT operation
ST Y ; Store result in Y
Mathematical Operations
- Addition: Y = A + B
LD A ; Load A
ADD B ; Add B
ST Y ; Store result in Y
- Subtraction: Y = A – B
LD A ; Load A
SUB B ; Subtract B
ST Y ; Store result in Y
- Multiplication: Y = A * B
LD A ; Load A
MUL B ; Multiply with B
ST Y ; Store result in Y
- Division: Y = A / B
LD A ; Load A
DIV B ; Divide by B
ST Y ; Store result in Y
Complex IL Programs
Examples
- IL Program for the logical expression Y = (A AND B) OR (C AND D)
LD A ; Load A
AND B ; AND with B
OR ( ; Begin OR operation
LD C ; Load C
AND D ; AND with D
) ; End OR operation
ST Y ; Store result in Y
- IL Program for the mathematical expression Y = (A + B) * (C – D)
LD A ; Load A
ADD B ; Add B
MUL ( ; Begin multiplication operation
LD C ; Load C
SUB D ; Subtract D
) ; End multiplication operation
ST Y ; Store result in Y
Practice Exercises
Exercises
Write an IL program for the logical expression Y = NOT(A OR B) AND C.
LD A
OR B
NOT
AND C
ST Y
Write an IL program for the mathematical expression Y = (A * B) + (C / D).
LD A
MUL B
ST P1
LD C
DIV D
ST Y2
LD P1
ADD P2
ST Y