Introduction
Using the Instruction list programming language (IL), you can call function blocks and functions conditionally or unconditionally, perform assignments and make jumps conditionally or unconditionally within a section.
Instructions
An instruction list is composed of a series of instructions.
Each instruction begins on a new line and consists of:
Should several operands be used, they are separated by commas. It is possible for a Label to be in front of the instruction. This label is followed by a colon. A Comment can follow the instruction.
Example:

Structure of the Programming Language
IL is a so-called accumulator orientated language, i.e. each instruction uses or alters the current content of the accumulator (a form of internal cache). IEC 61131 refers to this accumulator as the "result".
For this reason, an instruction list should always
begin with the LD
operand ("Load in accumulator command").
Example of an addition:
Command |
Meaning |
---|---|
|
Load the value 10 into the accumulator. |
|
"25" is added to the contents of the accumulator. |
|
The result is stored in the variable The content of the variable |
Compare operations likewise always refer to the accumulator. The Boolean result of the comparison is stored in the accumulator and therefore becomes the current accumulator content.
Example of a comparison:
Command |
Meaning |
---|---|
|
The value |
|
10 is compared with the contents of the accumulator. |
|
The result of the comparison is
stored in the variable If |
Section Size
The length of an instruction line is limited to 300 characters.
The length of an IL section is not limited within the programming environment. The length of an IL section is usually limited by the size of the PLC memory.
Syntax
Identifiers and Keywords are not case sensitive.
Spaces and tabs have no influence on the syntax and can be used as and when required,
Exception: Not allowed - spaces and tabs
keywords
literals
values
identifiers
variables and
limiter combinations [e.g.
(*
for comments)]
Execution Sequence
Instructions are executed line by line, from top to bottom. This sequence can be altered with the use of parentheses.
If, for
example, A
, B
, C
and D
have the values 1, 2, 3 and 4, and are calculated
as follows:
LD A
ADD B
SUB C
MUL C
ST E
the result in E
will be 0.
In the case of the following calculation:
LD A
ADD B
SUB(
LD C
MUL D
)
ST E
the result in E
will be -9.
Error Behavior
The following conditions are handled as an error when executing an expression:
Attempting to divide by 0.
Operands do not contain the correct data type for the operation.
The result of a numerical operation exceeds the value range of its data type
IEC Conformity
For a description of IEC conformity for the IL programming language, see IEC Conformity.