Performing An Xor Operation On 16-Bit Data - Mitsubishi Electric MELSEC iQ-R Series Programming Manual

Motion module instructions, standard functions/ function blocks
Hide thumbs Also See for MELSEC iQ-R Series:
Table of Contents

Advertisement

Performing an XOR operation on 16-bit data

WXOR
This instruction performs an XOR operation on the two sets of 16-bit binary data specified.
ST
ENO:=WXOR(EN,s1,s2,d);
■Execution condition
Instruction
WXOR
Setting data
■Description, range, data type
Operand
Description
(s1)
Exclusive OR data or the device where exclusive OR data is stored
(s2)
Exclusive OR data or the device where exclusive OR data is stored
(d)
Device for storing the operation result
EN
Execution condition
ENO
Execution result
■Applicable devices/labels
Operand
Bit
SB
(s1)
(s2)
(d)
Processing details
• This instruction performs an XOR operation (bit-by-bit) on the 16-bit binary data in the device specified by (s1) and the 16-
bit binary data in the device specified by (s2), and store the operation result in the device specified by (d).
b15
∙∙∙
(s1)
0
0
0
0
1
∙∙∙
b15
(s2)
0
1
0
1
0
∙∙∙
b15
(d)
0
1
0
1
1
• When a bit device is specified, the instruction performs an operation by assuming that the ones after the number of digit-
specified points are 0.
Operation error
There is no operation error.
6 BASIC INSTRUCTIONS
80
6.2 Logical Operation Instructions
Execution condition
RX, RY, LB
b8
b7
∙∙∙
1
1
1
1
1
1
1
0
XOR
∙∙∙
b8
b7
1
0
1
0
1
0
1
0
∙∙∙
b8
b7
0
1
0
1
0
1
0
0
Range
-32768 to 32767
-32768 to 32767
Word
SW
b0
0
0
0
b0
1
0
1
b0
1
0
1
Data type
ANY16
ANY16
ANY16
BOOL
BOOL
Constant
G, RWw, RWr, LW
K, H

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents