Mitsubishi FX3G Series Programming Manual page 268

Programmable controllers
Hide thumbs Also See for FX3G Series:
Table of Contents

Advertisement

FX
/FX
/FX
/FX
3G
3U
3GC
3UC
Programming Manual - Basic & Applied Instruction Edition
Related devices
1. Relationship between the flag operation and the sign (positive or negative) of a numeric value
Device
Name
M8020
Zero
M8021
Borrow
M8022
Carry
−2, −1,
−2,
−1,
Cautions
1. When using a 32-bit operation instruction (DADD or DADDP)
When specifying word devices, a 16-bit word device on the low-order side is specified first, and a word device with the
subsequent device number is automatically set for the high-order 16 bits.
To prevent number overlap, it is recommended to always specify an even number, for example.
2. When specifying the same device in the source and destination
The same device number can be specified for both the source and the destination.
In this case, note that the addition result changes in every operation cycle if a continuous operation type instruction
(ADD or DADD) is used.
X001
FNC 20
ADD
Program example
1. Difference between ADD instruction and INC instruction caused by a program for adding "+1"
When ADD[P] is executed, "1" is added to the contents of D0 every time X001 turns from OFF to ON.
ADD[P] instruction is similar to INCP instruction described later except the contents shown in the table below:
Flag (zero, borrow or carry)
16-bit
operation
32-bit
operation
X001
FNC 20
ADDP
X001
FNC 24
INCP
266
Series
ON : When the operation result is 0
OFF : When the operation result is not 0
ON : When the operation result is less than −32768 (in 16-bit operation) or −2,147,483,648 (in 32-bit operation)
OFF : When the operation result is not less than −32768 (in 16-bit operation) or −2,147,483,648 (in 32-bit operation)
ON : When the operation result is more than 32767 (in 16-bit operation) or 2,147,483,647 (in 32-bit operation)
OFF : When the operation result is not more than 32767 (in 16-bit operation) or 2,147,483,647 (in 32-bit operation)
Zero flag
−32768
0,
The most
Borrow flag
significant bit of
data becomes
"1".
Zero flag
−2,147,483,648
0,
Borrow flag
D 0
K 25
ADD, ADDP, DADD or DADDP
+32767→0→+1→+2→
S
D
+(+1)=
←−2←−1←0←−32768
S
D
+(−1)=
+2,147,483,647→0→+1→+2→
S
D
+(+1)=
←−2←−1←0←−2,147,483,648
S
+(−1)=
D
S
S
1
2
D 0
K 1
D 0
10 Arithmetic and Logical Operation (+, −, ×, ÷) – FNC 20 to FNC 29
→ For the flag operations, refer to Subsection 6.5.2.
Description
Zero flag
−1,
0,
1
The most
significant bit
of data
becomes "0".
−1,
0,
1
Zero flag
D 0
(D 0) + 25→(D 0)
instruction
Operates
D
(D 0) + 1→(D 0)
D 0
(D 0) + 1→(D 0)
10.1 FNC 20 – ADD / Addition
Zero flag
32767,
0,
Carry flag
Zero flag
2,147,483,647,
0,
Carry flag
INC, INCP, DINC, DINCP instruction
Does not operate
+32767→−32768→−32767
+2,147,483,647→−2,147,483,648→−2,147,483,647
1,
2
1,
2

Advertisement

Table of Contents
loading

This manual is also suitable for:

Fx3u seriesFx3gc seriesFx3uc series

Table of Contents