Basics
Syntax of the language
Syntax example
CoDesys v.2.3 example
Operators
Operators
Operators
Example
Рахмет!
120.14K
Категория: ПрограммированиеПрограммирование

Controller programming methods and tools

1.

BAISHEV UNIVERSITY
Department of «Engineering and transport services»
Dayev Zh.A.
"Controller programming methods and
tools"
for students of the specialty
"5B070200 – Automation and Control"
Language of Instruction List (IL language). The format of the instruction, the
accumulator, the transition to the label.
2020
1

2. Basics

• Instruction list (IL) is one of the 5 languages
supported by the initial versions of IEC 61131-3
standard, and subsequently deprecated in the third
edition.
• It is designed for programmable logic controllers
(PLCs).
• It is a low level language and resembles assembly.
• All of the languages share IEC61131 Common
Elements. The variables and function call are defined
by the common elements so different languages can be
used in the same program.
2

3. Syntax of the language

• Each statement begins on a new line and contains an operator
and, depending on the type of operation, one or more operands
separated by commas.
• The operand can be preceded by a label ending with a colon (:).
• The comment must be the last item in the line. There may be
empty lines between instructions.
• This language is a typical assembler with a accumulator and
label transitions.
3

4. Syntax example


LD 17
ST lint (*comment*)
GE 5
JMPC next
LD idword
EQ istruct.sdword
STN test
next:
4

5. CoDesys v.2.3 example

5

6. Operators

• The following operators and modifiers can be
used in IL:
• Modifiers:
• C with JMP, CAL, RET: the instruction is
executed only when the result is TRUE.
• N with JMPC, CALC, RETC: the instruction is
executed when the accumulator result is
FALSE.
• N in other cases: negate on of the operand.
6

7. Operators

Below is a table of all IL operators with explanations and valid modifiers:
Operator
LD
ST
S
R
AND
OR
XOR
ADD
SUB
MUL
DIV
GT
GE
EQ
NE
LE
LT
JMP
CAL
RET
)
Modifier
N
N
N,(
N,(
N,(
(
(
(
(
(
(
(
(
(
(
CN
CN
CN
Explanation
Assigning an operator value to the accumulator
Assigning the value of the accumulator to the operand
Set the logical operand to TRUE if the value is true
Set the Boolean operand to FALSE
Bitwise And
Bitwise OR
Bitwise exclusive OR
Addition
Subtraction
Multiplication
Division
>
>=
=
<>
<=
<
Go to the label
Calling a function block
Exit the POU and return to the calling program.
Calculating a delayed operation
7

8. Operators

Other operators also use the usual type names, as in the
CFC language:
SIN
COS
MOD
ABS
LIMIT
etc.
8

9. Example

LD
TRUE
(* load the TRUE value to the battery*)
ANDN BOOL1 (*execute And with the inverse VALUE of the bool1
variable*)
JMPC mark
(*if the battery value is TRUE, go to the "mark" label"*)
LDN
BOOL2 (*if the battery value is TRUE, go to the "mark" label")
ST
ERG
label:
(*BOOL2 in ERG*)
LD
BOOL2 (*save the accumulator value in ERG*)
ST
ERG
*BOOL2 to ERG*)
9

10. Рахмет!

10
English     Русский Правила