EasyManua.ls Logo

Mitsubishi MELSEC iQ-F FX5 series - Twos Complement of 16-Bit Binary Data (Sign Inversion)

Mitsubishi MELSEC iQ-F FX5 series
888 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
282
6 BASIC INSTRUCTIONS
6.5 Data Conversion Instructions
Two's complement of 16-bit binary data (sign inversion)
NEG(P)
These instructions invert the sign of the 16-bit binary data in the device specified by (d), and store the resultant data in the
device specified by (d).
Setting data
Descriptions, ranges, and data types
Applicable devices
Processing details
These instructions invert the sign of the 16-bit binary data in the device specified by (d), and store the resultant data in the
device specified by (d).
They are used when a positive or negative sign is to be inverted.
Precautions
Note that data is inverted in every operation cycle in a continuous operation type (NEG) instruction.
Operation error
There is no operation error.
Ladder diagram Structured text
ENO:=NEG(EN,d);
ENO:=NEGP(EN,d);
Operand Description Range Data type Data type (label)
(d) Head device for storing the data that performs two's
complement
-32768 to +32767 16-bit signed binary ANY16
Operand Bit Word Double word Indirect
specification
Constant Others
X, Y, M, L,
SM, F, B, SB
U\G T, ST,
C, LC
T, ST, C, D,
W, SD, SW, R
U\G Z LC LZ K, H E $
(d) 
(d)
1
(d)
(d)
···b15 b0
101 10 0101 10 01010
···b15 b0
010 01 1 010 01 10110
101 10 0101 10 01010
000 00 0000 00 00000
-
··· -21846
··· 21846
Before execution
Sign conversion
After execution
16 bits

Table of Contents

Related product manuals