Panasonic FP Series Programming Manual page 448

Hide thumbs Also See for FP Series:
Table of Contents

Advertisement

F85_NEG
Takes two's complement of 16-bit data specified by d if the trigger EN is in the ON-state. Two's
Description
complement of the original 16-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 16-bit data from positive to negative or from
negative to positive.
Destination
Bit position
15
0
d
Decimal data
Destination
Bit position
15
1
d
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 F85_NEG (see page 1326)
PLC types
Data types
Variable
Data type
ANY16
d
Operands
For
d
In this example, the same POU header is used for all programming languages. For an example
Example
using IL (instruction list), please refer to the online help.
POU header
All input and output variables used for programming this function have been declared in the POU
header.
Body
When the variable start changes from FALSE to TRUE, the function is carried out.
16-bit data two's complement
12
11
8 7
4 3
· · ·
· ·
· ·
· ·
0
0
0
0
0
0
0
0
0
0
0
0
0
3
start: ON
· · ·
12
11
· ·
8 7
· ·
4 3
· ·
1
1
1
1 1
1
1 1
1
1 1 1
1
-3
Function
16-bit area for storing original data and its two's complement
Relay
-
WY
WR
WL
SV
0
1
1
0
0
1
T/C
Register
EV
DT
LD
FL
Arithmetic instructions
Constant
-
447

Advertisement

Table of Contents
loading

Table of Contents