4 bit operations – NORD Drivesystems BU0550 User Manual
Page 31
3 AWL (Instruction List, IL)
BU 0550 GB-0813
31
3.2.4
Bit Operations
Operator
Explanation
AND
AND
ANDN
AND with negated operand
NOT
Negation
OR
OR
ORN
OR with negated operand
ROL
Rotate left
ROR
Rotate right
SHL
Shift left
SHR
Shift right
S and R
Set and Reset
XOR
Exclusive OR
XORN
Exclusive OR with negated operand
Table 27 Overview of Bit operations
3.2.4.1
AND and AND(
Bit-wise AND linking of the AE/accumulator with one or two variables or constants.
Bit-wise AND(...) linking with the AE/accumulator and the AE/accumulator which was previously formed in
the bracket. Up to 6 bracket levels are possible.
All values must belong to the same type of variable.
BOOL
BYTE
INT
DINT
Possible data types
X
X
X
X
Commands
Explanation
LD 170
AND 204
AND link between 2 constants
Accu = 136 (See example under the table)
LD 170
Link between a constant and 2 variables.
AND Var1, Var2
Accu = 170
dec
AND Var1 AND Var2
LD Var1
AND ( Var2
AE/Accu = Var1 AND ( Var2 OR Var3 )
OR Var3
)
Table 28 AND and AND(
Example: 170
dec
(1010 1010
bin
) AND 204
dec
(1100 1100
bin
) = (1000 1000
bin
) 136
dec
AE/Accu
Operand
Result
0
0
0
0
1
0
1
0
0
1
1
1