Complement Of 2 Of Bin 16-Bit Data (Sign Inversion); Dneg, Dnegp - Mitsubishi MELSEC-Q/L Programming Manual

Table of Contents

Advertisement

NEG, NEGP, DNEG, DNEGP
DGBIN
Converts Gray code data at device designated by
b31
S
Gray code 305419896 0
0
0 1 1 0 1 1 0 0 1 0 1 1 1 0 0 1 1 1 1 1 0 1 0 1 0 0 0 1 0 0
b31
D
0
0
0 1 0 0 1 0 0 0 1 1 0 1 0 0 0 1 0 1 0 1 1 0 0 1 1 1 1 0 0 0
BIN 305419896
Operation Error
(1) In any of the following cases, an operation error occurs, the error flag (SM0) turns ON, and an error code is stored into
SD0.
Error
code
The data of
is other than 0 to 32767 when the GBIN instruction is
S
4100
executed.
The data of
is other than 0 to 2147483647 when the DGBIN
S
4100
instruction is executed.
Program Example
(1) The following program converts the Gray code data at D100 when X10 is ON to BIN data, and stores the result at D200.
[Ladder Mode]
(2) The following program converts the Gray code data at D10 and D11 to BIN data when X1C is ON, and stores the result
at D0 and D1.
[Ladder Mode]
6.3.11
NEG, NEGP

Complement of 2 of BIN 16-bit data (sign inversion)

6.3.11

DNEG, DNEGP

Complement of 2 of BIN 32-bit data (sign inversion)
NEG, NEGP, DNEG, DNEGP
NEG, DNEG
NEGP, DNEGP
: Head number of the devices where the data for which complement of 2 is performed is stored (BIN 16/32 bits)
D
Setting
Internal Devices
Data
Bit
Word
D
246
to BIN 32-bit data and stores at device designated by
S
S
+1 (Upper 16 bits)
b16
b15
D
+1
b16
b15
Error details
[List Mode]
Step
[List Mode]
Step
Command
Command
J
\
R, ZR
Bit
S
(Lower 16 bits)
b0
D
b0
Q00J/
Q00/
QnH
Q01
Instruction
Device
Device
Instruction
High
Basic
performance
indicates an instruction symbol of
U
\G
Word
.
D
QnPH QnPRH
QnU
LCPU
Process
Redundant Universal
LCPU
NEG/DNEG.
D
P
D
Zn
Constants
Other
––

Advertisement

Table of Contents
loading

Table of Contents