Panasonic FP Series Programming Manual page 450

Hide thumbs Also See for FP Series:
Table of Contents

Advertisement

F86_DNEG
Takes two's complement of 32-bit data specified by d if the trigger EN is in the ON-state. Two's
Description
complement of the original 32-bit data is stored in d.
Two's complement is a number system used to express positive and negative numbers in binary
format. In this system, the number becomes negative if the most significant bit (MSB) of data is 1.
Two's complement is obtained by inverting all bits and adding 1 to the inverted result.
This instruction is useful for inverting the sign of 32-bit data from positive to negative or from
negative to positive.
Destination
Bit position
15
Binary data
1
Decimal data
Destination
Bit position
15
Binary data
0
Decimal data
This instruction also exists as a P instruction (for FP2/2SH, FP3/5, FP10/10SH PLC types), which
is only executed at the rising edge of the EN trigger. Select [Insert P instruction] from the
"Instructions" pane if you require a P instruction. To facilitate reuse, the instruction then appears
under "Recently used" in the pop-up menu. Press <Ctrl>+<Shift>+<v> within the programming
area to open the list of recently used elements.
Availability of F86_DNEG (see page 1326)
PLC types
Data types
Variable
Data type
ANY32
d
Operands
For
d
In this example the function has been programmed in ladder diagram (LD) and structured text
Example
(ST).The same POU header is used for all programming languages.
POU header
All input and output variables used for programming this function have been declared in the POU
header.
32-bit data two's complement
DT1
1211
8
7
4
3
· · ·
· ·
· ·
· ·
1
1
1
1 1
1
1
1
1
1
1
1
1
DT1
1211
8
7
4
3
· · ·
· ·
· ·
· ·
0
0
0
0 0
0
0
0
0
0
0
0
0
Function
32-bit area for storing original data and its two's complement
Relay
-
DWY
DWR
DWL
DSV
DT0
0
15
12
11
8 7
· · ·
· ·
· ·
1
1
1
1
1
1
1
1
1
1
1
1
1
-3
32-bit area
start: ON
DT0
0
15
12
11
8
7
· · ·
· ·
· ·
0
0
0
0
0
0
0
0
0
0
0
0
0
3
32-bit area
T/C
Register
DEV
DDT
DLD
DFL
Arithmetic instructions
4
3
0
· ·
1
1
1
0
1
4
3
0
· ·
0
0
0
1
1
Constant
-
449

Advertisement

Table of Contents
loading

Table of Contents