![SEW-Eurodrive IPOS plus Скачать руководство пользователя страница 304](http://html1.mh-extra.com/html/sew-eurodrive/ipos-plus/ipos-plus_manual_1250042304.webp)
304
Manual – IPOSplus®
23
Arithmetic commands
Assembler – Commands
MOD/MODULO
The command supplies the integer remainder when a variable has been divided by a
variable or a constant. The sign of the result is the same as the sign of the first variable.
23.3.3 Logical operations AND/OR/XOR
AND
The AND command performs a bit-by-bit AND operation between a variable and a sec-
ond variable or a hexadecimal constant.
OR
The OR command performs a bit-by-bit OR operation between a variable and a second
variable or a hexadecimal constant.
Command structure
Mxxx MOD X1 mod X2
Mxxx: Label (optional)
X1: Variable (dividend and remainder of division)
X2: Variable or constant (divisor)
MOD HXX mod HYY
Variable HXX is the integer remainder after division of variables HXX and
HYY.
MOD HXX mod K
Variable HXX is the integer remainder after division of variable HXX and a
constant K.
Example 1
SET H01 = -17SET H02 = -
5MOD H01 mod H02
SET H01 = -17SET H02 =
+5MOD H01 mod H02
After the MOD command, H01 = -2.
Example 2
SET H01 = +17SET H02 =
+5MOD H01 mod H02
SET H01 = +17SET H02 = -
5MOD H01 mod H02
After the MOD command, H01 = +2.
Command structure
Mxxx AND X1 & X2
Mxxx: Label (optional)
X1: Variable (result and output value)
X2: Variable or constant (output value)
AND HXX & HYY
Variable HXX is the bit-by-bit AND operation of variables HXX and HYY.
AND HXX & K
Variable HXX is the bit-by-bit AND operation of variable HXX and a con-
stant K.
Example 1
SET H01 = 12SET H02 = 5AND
H01 & H02
[0b0000000000001100][0b000
0000000000101][0b000000000
0000100]
After the AND command, H01 = 4.
Example 2
The position within a motor revolution is to be determined from the posi-
tion of the motor encoder.
SET H01 = H511AND H01 & 0xFFF
After the AND command, H01 has a value between 0 and 4095.
Command structure
Mxxx OR X1 ¦ X2
Mxxx: Label (optional)
X1: Variable (result and output value)
X2: Variable or constant (output value)
OR HXX ¦ HYY
Variable HXX is the bit-by-bit OR operation of variables HXX and HYY.
OR HXX ¦ K
Variable HXX is the bit-by-bit OR operation of variable HXX and a constant
K.
Example
SET H01 = 12SET H02 = 1OR
H01 ¦ H02
[0b0000000000001100][0b000
0000000000001][0b000000000
0001101]
After the OR command, H01 = 13.
P
i
f
kVA
Hz
n
P
i
f
kVA
Hz
n