7-20
7.1 Logical Operation Instructions
7.1.6 Exclusive OR operation on block data
BKXOR
O
peration Error
In any of the following cases, an operation error occurs, the error flag (SM0) is turned ON, and
the corresponding error code is stored to SD0.
• The range of n points from the device specified for
,
or
exceeds the
corresponding device.
(Error code: 4101)
• The device range of n points from the device specified for
overlaps with the device
range of n points from the device specified for
. (Except when the same device is
specified for
and
)
(Error code: 4101)
• The device range of n points from the device specified for
overlaps with the device
range of n points from the device specified for
. (Except when the same device is
specified for
and
)
(Error code: 4101)
Program Example
In the following program, the exclusive OR operation is performed on the data in the devices
from D100 to D102 and the data in the devices from R0 to R2 when X20 turns ON, and the
results are stored to D200 and the following devices.
[Structured ladder]
[ST]
Var_D0:=3;
BKXORP(X20,D100,R0,Var_D0,D200);
[Operation]
s
1
s
2
d
s
1
d
s
1
d
s
2
d
s
2
d
X
OR
b15
b8
1 0 1 0 1 0 1 0 0 1 0 1 0 1 0 1
b7
b0
0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1
0 1 0 1 0 0 0 0 0 0 0 0 0 1 0 1
D
201
D
202
D
200
b15
b8
0
0
0
0
0
0
0
0
b7
b0
0
0
1
1
1
1
0
0
0 1 0 1 1 1 1 1 1 1 1 1 0 1 0 1
D
101
D
102
D
100
b15
b8
1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0
b7
b0
0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1
0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0
R1
R2
R0
Var_D
0
3
1
1
1
1
1
1
1
1
0
0
1
1
1
1
0
0
Summary of Contents for MELSEC Q Series
Page 1: ...Structured Programming Manual Mitsubishi Programmable Controller QCPU Common Instructions ...
Page 2: ......
Page 14: ...A 12 MEMO ...
Page 340: ...6 178 MEMO MTR ...
Page 708: ...7 368 MEMO ...
Page 776: ...8 68 MEMO ...
Page 796: ...9 20 MEMO ...
Page 804: ...App 8 MEMO ...
Page 812: ...Index 8 MEMO ...
Page 815: ......