NORD Drivesystems BU0550 User Manual
Page 25

3 AWL (Instruction List, IL)
BU 0550 GB-0813
25
3.2.2.2
ADD and ADD(
Adds the variables and constants together with the correct prefixes. The first value for addition is in the
AE/accumulator, the second is loaded with the ADD command or is inside the bracket. Several variables or
constants can be added to the ADD command.
For bracket addition, the accumulator is added to the result of the expression in brackets. Up to 6 bracket
levels are possible.
The values to be added must belong to the same type of variable.
BOOL
BYTE
INT
DINT
Possible data types
X
X
X
Commands
Explanation
LD 10
ADD 204
Addition of two constants
LD 170
Addition of a constant and 2 variables.
ADD Var1, Var2
170
dec
+ Var1 + Var2
LD Var1
ADD( Var2
SUB Var3
Var1 + ( Var2 - Var3 )
)
Table 12 ADD and ADD(
3.2.2.3
DIV and DIV(
Divides the accumulator by the operands. For divisions by zero, the maximum possible result is entered into
the accumulator, e.g. for a division with INT values, this is the value 0x7FFF or the value 0x8000 if the
divisor is negative.
For bracket division, the accumulator is divided by the result of the expression in brackets. Up to 6 bracket
levels are possible.
The values to be divided must belong to the same type of variable.
the part of the result following the decimal point are cut off. If places after the decimal point are required, the
remainder from the division can be determined with the Modulus operation (MOD) and further calculation
can be performed with this.
BOOL
BYTE
INT
DINT
Possible data types
X
X
X
Commands
Explanation
LD 10
DIV 2
Division of two constants
LD 170
Division of a constant and 2 variables.
DIV Var1, Var2
(170
dec
: Var1) : Var2
LD Var1
Divide Var1 by the contents of the brackets
DIV( Var2
Var1 : ( Var2 - Var3 )
SUB Var3
)
Table 13 DIV and DIV(