Instruction List (IL) is a list of instructions, similar to assembly language, that are run in order.
Instruction List is one of the five programming languages defined the IEC 61131-3 standard.
The Instruction List uses this syntax:
instruction-list ::= { instruction-item }
instruction-item ::= [ label | instruction ]
label ::= identifier ':'
instruction ::= <See table below>
Fernhill SCADA supports these types of instruction:
These load and store instructions are supported:
Instruction | Comment |
---|---|
LD Expression |
Sets the current result to the value of Expression.
For example:
LD 1 LD X LD X[0] |
ST Variable Reference |
Stores the current result to a variable.
For example:
ST X ST X[0] |
S Variable Reference |
If the current result is TRUE, sets Variable Reference to TRUE.
For example:
S X |
R Variable Reference |
If the current result is TRUE, resets Variable Reference to FALSE.
For example:
R X |
These logical instructions are supported:
Instruction | Comment |
---|---|
AND Expression |
Sets the current result to: Current Result AND Expression.
For example:
AND 16#FF |
ANDN Expression |
Sets the current result to: Current Result AND NOT( Expression ).
For example:
ANDN 16#FF |
OR Expression |
Sets the current result to: Current Result OR Expression.
For example:
OR 16#80 |
ORN Expression |
Sets the current result to: Current Result OR NOT( Expression ).
For example:
ORN 16#80 |
XOR Expression |
Sets the current result to: Current Result XOR Expression.
For example:
XOR 16#F |
XORN Expression |
Sets the current result to: Current Result XOR NOT( Expression ).
For example:
XORN 16#F |
NOT |
Sets the current result to: NOT Current Result.
For example:
NOT |
These arithmetic instructions are supported:
Instruction | Comment |
---|---|
ADD Expression |
Sets the current result to: Current Result + Expression.
For example:
ADD 1 |
SUB Expression |
Sets the current result to: Current Result - Expression.
For example:
SUB 1 |
MUL Expression |
Sets the current result to: Current Result * Expression.
For example:
MUL 5 |
DIV Expression |
Sets the current result to: Current Result / Expression.
For example:
DIV 10 |
MOD Expression |
Sets the current result to: Current Result MOD Expression.
For example:
MOD 7 |
These comparison instructions are supported:
Instruction | Comment |
---|---|
GT Expression |
Sets the current result to: Current Result > Expression.
For example:
GT 7 |
GE Expression |
Sets the current result to: Current Result >= Expression.
For example:
GE 7 |
EQ Expression |
Sets the current result to: Current Result = Expression.
For example:
EQ 7 |
NE Expression |
Sets the current result to: Current Result <> Expression.
For example:
NE 7 |
LT Expression |
Sets the current result to: Current Result < Expression.
For example:
LT 7 |
LE Expression |
Sets the current result to: Current Result <= Expression.
For example:
LE 7 |
After a comparison instruction the current value will be either TRUE or FALSE.
These control flow instructions are supported:
Instruction | Comment |
---|---|
JMP Label |
Jump to Label.
For example:
JMP Start |
JMPC Label |
Jump to Label if the current value is TRUE.
For example:
JMPC Found |
JMPNC Label |
Jump to Label if the current value is FALSE.
For example:
JMPNC Error |
In Fernhill SCADA you can use Instruction List code in:
IEC 61131-3 Second Edition: Table 52.
IEC 61131-3 Third Edition: Table 68.
To learn about IEC 61131-3 Common Elements you can use in IL programs and functions.
For the meaning of terms used in Fernhill SCADA.