Data Conversion Instructions; Two's Complement Of 16-Bit Binary Data (Sign Inversion) - 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

6.3

Data Conversion Instructions

Two's complement of 16-bit binary data (sign inversion)

NEG
Invert the sign of 16-bit binary device.
ST
ENO:=NEG(EN,d);
■Execution condition
Instruction
NEG
Setting data
■Description, range, data type
Operand
Description
(d)
Device where the data subjected to two's complement is stored
EN
Execution condition
ENO
Execution result
■Applicable devices/labels
Operand
Bit
SB
(d)
Processing details
• This instruction inverts the sign of the 16-bit binary data in the device specified by (d) and store the inverted data in the
device specified by (d).
• The instructions are used to invert positive and negative signs.
b15
Before execution
(d)
1
1
0
Sign conversion
1
-
b15
After execution
(d)
0
Operation error
There is no operation error.
6 BASIC INSTRUCTIONS
84
6.3 Data Conversion Instructions
Execution condition
RX, RY, LB
∙∙∙
0
1
0
1
0
1
0
1
0
0
0
0
0
0
0
0
0
1
0
1
0
1
0
1
∙∙∙
1
0
1
0
1
0
1
0
Range
Word
SW
b0
0
1
0
1
0
1
0
∙∙∙ -21846
0
0
0
0
0
0
0
0
1
0
1
0
1
0
b0
∙∙∙ 21846
1
0
1
0
1
1
0
Data type
ANY16
BOOL
BOOL
Constant
G, RWw, RWr, LW
K, H

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents