246
NEG, NEGP, DNEG, DNEGP
DGBIN
Converts Gray code data at device designated by to BIN 32-bit data and stores at device designated by .
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.
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] [List 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] [List Mode]
: Head number of the devices where the data for which complement of 2 is performed is stored (BIN 16/32 bits)
Error
code
Error details
Q00J/
Q00/
Q01
QnH QnPH QnPRH QnU LCPU
4100
The data of is other than 0 to 32767 when the GBIN instruction is
executed.
4100
The data of is other than 0 to 2147483647 when the DGBIN
instruction is executed.
6.3.11 NEG, NEGP Complement of 2 of BIN 16 -bit data (sign i nversion)
DNEG, DNEGP Complement of 2 of BIN 32-bit data (sign inversion)
6.3.11
NEG, NEGP, DNEG, DNEGP
Setting
Data
Internal Devices
R, ZR
J\
U\G
Zn Constants Other
Bit Word Bit Word
––
S
D
+1 (Upper 16 bits) (Lower 16 bits)
+1
0
BIN 305419896
00
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 00
0
Gray code 305419896
001 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 00
b31 b16 b0b15
b31 b16
b0b15
S
D
S
D
S
D
S
S
Step
Instruction
Device
Step
Instruction
Device
Basic
Process
High
performance
Redundant
Universal
LCPU
Command
Command
P
NEG, DNEG
NEGP, DNEGP
D
D
indicates an instruction symbol of NEG/DNEG.
D
D