Fnc 29 - Neg / Negation - Mitsubishi Electric MELSEC FX3U Programming Manual

Melsec fx series programmable logic controllers
Table of Contents

Advertisement

FX
/FX
/FX
Series Programmable Controllers
3G
3U
3UC
Programming Manual - Basic & Applied Instruction Edition
10.10 FNC 29 – NEG / Negation
Outline
This instruction obtains the complement of a numeric value (by inverting each bit and adding "1").
This instruction can be used to negate the sign of a numeric value.
1. Instruction format
FNC 29
D
NEG
2. Set data
Operand type
D
3. Applicable devices
Bit Devices
Oper-
and
System User
Type
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G
D
Explanation of function and operation
1. 16-bit operation (NEG and NEGP)
Each bit of
D
Command
input
FNC 29
NEGP
2. 32-bit operation (DNEG and DNEGP)
Each bit of [
D
original device.
Command
input
FNC 29
DNEGP
Caution
Note that the complement is obtained in every operation cycle in a continuous operation type instruction.
304
→ For the Floating point negation ENEG (FNC128), refer to Section 18.16.
Mnemonic
16-bit Instruction
P
3 steps NEG
NEGP
Word device number which stores data for obtaining complement and will store
the operation result (The operation result will be stored in the same word device
number.)
Digit Specification
is inverted (0 → 1, 1 → 0), "1" is added, and then the result is stored in the original device.
D
D
)+1 →
(
] is inverted (0 → 1, 1 → 0), "1" is added, and then the result is stored in the
+1,
D
D
(
+ 1,
D
10 Arithmetic and Logical Operation (+, −, ×, ÷) – FNC 20 to FNC 29
Operation Condition
32-bit Instruction
Continuous
Operation
Pulse (Single)
Operation
Description
Word Devices
Special
System User
Unit
D
D
D
D
) +1 = (
+ 1,
10.10 FNC 29 – NEG / Negation
Mnemonic
Operation Condition
DNEG
5 steps
DNEGP
16- or 32-bit binary
Others
Con-
Real
Index
stant
Number
V Z Modify K H
E
)
Continuous
Operation
Pulse (Single)
Operation
Data type
Charac-
Pointer
ter String
" "
P

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec fx3ucMelsec fx3g

Table of Contents