FX Series Positioning Controllers
Program format 5
5-59
5.10.19 FNC29 (NEG): Complement
Obtaining the absolute value of a negative value
FNC 29
NEG
Applicable models
Series name
Remarks
K,H
KnX
KnY
KnM
D
V,Z
Applicable
devices
and basic
format
Word
devices
FNC 29
NEG
FX
2N
-10GM
FX
2N
-20GM
BINARY
NEG
[D]NEG
Complement
Each bit of data in the device specified by
is inverted (0
→
1,1
→
0), "1" is added to the
inverted bits, then the result is saved in the
same device.
Drive
input
D·
D·
D·
16-bit operation
3 steps
32-bit operation
5 steps
FNC 29
NEG
D 10
X00
This instruction yields the absolute value of a
negative binary value.
(D10)+1
→
(D10)
·
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
(D 10) + 1 = -32,768
(D 10) = 2
(D 10) = 1
(D 10) = 0
(D 10) + 1 = 1
(D 10) + 1 = 2
(D 10) + 1 = 3
(D 10) + 1 = 32,766
(D 10) + 1 = 32,767
(D 10) = -32,768
(D 10) = -32,767
(D 10) = -32,766
(D 10) = -3
(D 10) = -2
(D 10) = -1
The miximum absolte value is 32,767 for 16-bit operation.
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
The positioning unit expresses negative values in the
form of twos complement as shown on the left.
If the most significant bit is 1, the number is negative
and its absolute value can be obtained using the NEG
instruction.
Summary of Contents for FX2N-10GM
Page 1: ...HARDWARE PROGRAMMING MANUAL FX2N 10GM FX2N 20GM ...
Page 4: ...FX Series Positioning Controllers ii ...
Page 6: ...FX Series Positioning Controllers iv ...
Page 46: ...FX Series Positioning Controllers Introduction 1 1 34 MEMO ...
Page 76: ...FX Series Positioning Controllers Wiring 3 3 24 MEMO ...
Page 222: ...FX Series Positioning Controllers Operation Maintenance and Inspection 8 8 18 MEMO ...
Page 256: ...FX Series Positioning Controllers Program Examples 9 9 34 MEMO ...