116
4
4 Instructions4.4.2 Logical Operations
◆
Application
WOR D 20
S1 .
D 22 D 24
S2 . D .
0 10110100 0 1 0 0 0 1 1
0 11110010 1 0 1 0 0 1 0
0 11110110 1 1 1 0 0 1 1
D20
D22
D24
Logical OR
M20
WXOR: Binary number logical XOR
◆
Overview
When driving conditions are met, the WXOR instruction performs a logical XOR on S1 and S2 bit by bit.
The result is stored in D.
WXOR S1 S2 D
Binary number
logical XOR
Applicable model:
H3U
S1 Data 1
Data in an XOR operation, or address of the word
element that stores the data
16-bit instruction
(7 steps)
WXOR:
Continuous
execution
WXORP: Pulse
execution
32-bit instruction
(13 steps)
DXOR: Continuous
execution
DXORP: Pulse
execution
S2 Data 2
Data in an XOR operation, or address of the word
element that stores the data
D
Operation
result
Address of the word element that stores the
operation result
◆
Operands
Operand
Bit Element Word Element
System·User System·User Bit Designation Indexed Address Constant
Real
Number
S1 X Y M T C S SM D R T C SD KnX KnY KnM KnS KnSM
V,Z
Modication K H E
S2 X Y M T C S SM D R T C SD KnX KnY KnM KnS KnSM
V,Z
Modication K H E
D X Y M T C S SM D R T C SD KnX KnY KnM KnS KnSM
V,Z
Modication K H E
Note: The elements in gray background are supported.
◆
Function
The bit patterns of the BIN values in S1 and S2 are analyzed. The result of the logical XOR analysis is
stored in the variable D.
The result is 0 if S1 and S2 are the same; if they are different, the result is 1.
1
1 = 0 1
0 = 1 0
1 = 1 0
0 = 0