Move/Logical Instructions (MOV, MVM, BTD, MVMT, BTDT, CLR, SWPB, AND, OR, XOR, NOT, BAND, BOR, BXOR, BNOT)
Example 1:
This example performs an exclusive OR on bool_in1 and bool_in2 and places the result in
value_result_xor.
Structured Text
value_result_xor := bool_in1 XOR bool_in2;
Function Block
Example 2:
In this example, light1 is set (on) if :
Otherwise, light1 is cleared (off ).
Structured Text
IF bool_in1 XOR bool_in2 THEN
light1 := 1;
ELSE
light1 := 0;
END_IF;
Rockwell Automation Publication 1756-RM003N-EN-P - October 2011
If BOOL_IN1 is
If BOOL_IN2 is
0
0
0
1
1
0
1
1
· Only bool_in1 is set (true)
· Only bool_in2 is set (true)
Then VALUE_RESULT_XOR is
0
1
1
0
Chapter 7
339