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

  1. Read about Instruction List (IL) programming.
  2. Understand the basic IL commands for logic gates and mathematical operations.

 

Writing Simple IL Programs

Logic Gates

  1. AND Gate: Y = A AND B

LD A               ; Load A

AND B            ; AND with B

ST Y   ; Store result in Y

 

  1. OR Gate: Y = A OR B

LD A               ; Load A

OR B               ; OR with B

ST Y   ; Store result in Y

 

  1. NOT Gate: Y = NOT A

LD A               ; Load A

NOT                ; NOT operation

ST Y   ; Store result in Y

 

Mathematical Operations

  1. Addition: Y = A + B

LD A               ; Load A

ADD B            ; Add B

ST Y   ; Store result in Y

 

  1. Subtraction: Y = A – B

LD A               ; Load A

SUB B             ; Subtract B

ST Y   ; Store result in Y

 

  1. Multiplication: Y = A * B

LD A               ; Load A

MUL B            ; Multiply with B

ST Y   ; Store result in Y

 

  1. Division: Y = A / B

LD A               ; Load A

DIV B             ; Divide by B

ST Y   ; Store result in Y

 

 

 

 

 

Complex IL Programs

Examples

  1. 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

 

  1. 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

 

Leave a Comment

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

Scroll to Top