Fnc 20 - Add / Addition - 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.1
FNC 20 – ADD / Addition
Outline
This instruction executes addition by two values to obtain the result (A + B = C).
1. Instruction format
FNC 20
D
ADD
P
2. Set data
Operand type
S
1
S
2
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
S
1
S
2
D
: This function is supported only in FX
Explanation of function and operation
1. 16-bit operation (ADD and ADDP)
The contents of
Command
input
FNC 20
ADD
• The most significant bit of each data indicates the sign (positive: 0 or negative: 1), and data are added
algebraically.
5 + (−8) = −3
• When a constant (K) is specified in
2. 32-bit operation (DADD and DADDP)
The contents of [
is transferred to [
Command
input
FNC 20
DADD
• The most significant bit of each data indicates the sign (positive: 0 or negative: 1), and data are added
algebraically.
5500 + (−8540) = −3040
• When a constant (K) is specified in [
the binary format.
→ For the floating point addition instruction EADD (FNC120), refer to Section 18.8.
Mnemonic
16-bit Instruction
7 steps ADD
ADDP
Data for addition or word device number storing data
Data for addition or word device number storing data
Word device number storing the addition result
Digit Specification
/FX
3U
are added to
in the binary format, and the addition result is transferred to
S
S
2
1
S
S
D
1
2
S
1
+1,
] are added to [
S
S
2
2
+1,
].
D
D
1
1
S
S
D
1
2
S
1
10 Arithmetic and Logical Operation (+, −, ×, ÷) – FNC 20 to FNC 29
Operation Condition
32-bit Instruction
Continuous
13 steps
Operation
Pulse (Single)
Operation
Description
Word Devices
Special
System User
Unit
V Z Modify K H
PLCs.
3UC
S
S
D
+
1
2
or
, it is automatically converted into the binary format.
S
2
+1,
] in the binary format, and the addition result
S
S
1
1
S
S
S
[
+1,
] + [
1
1
2
+1,
] or [
+1,
S
S
S
1
2
10.1 FNC 20 – ADD / Addition
Mnemonic
Operation Condition
Continuous
DADD
Operation
Pulse (Single)
DADDP
Operation
Data type
16- or 32-bit binary
16- or 32-bit binary
16- or 32-bit binary
Others
Con-
Real
Charac-
Index
stant
Number
ter String
E
" "
S
] → [
D
+1,
D
+1,
2
], it is automatically converted into
2
1
2
3
4
5
Pointer
P
6
7
.
D
8
9
]
10
283

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec fx3ucMelsec fx3g

Table of Contents