247
FX
3U
/FX
3UC
Series Programmable Controllers
Programming Manual - Basic & Applied Instruction Edition
10 Arithmetic and Logical Operation (
+
,
−
,
×
,
÷
) – FNC 20 to FNC 29
10.1 FNC 20 – ADD / Addition
1
In
troduct
io
n
2
Ov
e
rv
ie
w
3
In
st
ru
ct
ion
Li
st
4
D
evi
ce
s
in
De
ta
il
5
Speci
fied t
h
e
D
evi
ce &
C
onst
a
nt
6
Bef
o
re
Pr
ogr
a
m
m
ing
7
Bas
ic
In
st
ru
cti
o
n
8
FNC0
0
-FNC0
9
P
ro
g
ra
m F
lo
w
9
FNC1
0
-FNC1
9
M
ov
e
&
C
om
par
e
10
FNC
20-
FNC
2
9
Ar
ith.
&
Logi
c
O
per
at
io
n
Related devices
1. Relationship between the flag operation and the sign (positive or negative) of a numeric
value
→
For the flag operations, refer to Subsection 6.5.2.
Cautions
1. When using a 32-bit operation instruction (DADD or DADPP)
When specifying word devices, a 16-bit word device on the low-order side is specified first, and then a word
device having a serial device number is automatically set for the high-order 16 bits.
For preventing number overlap, it is recommended to always specify an even number, for example.
2. When specifying a same device as the source and destination
A 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.
Device
Name
Description
M8020
Zero
ON : When the operation result is 0
OFF: When the operation result is other than 0
M8021
Borrow
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)
M8022
Carry
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
−
2,
−
1, 0,
−
32768
Borrow flag
Zero flag
−
2,
−
1, 0,
−
2,147,483,648
Borrow flag
The most
significant bit of
data becomes
"1".
Zero flag
32767, 0, 1, 2
Carry flag
Zero flag
2,147,483,647, 0, 1, 2
Carry flag
Zero flag
−
1, 0, 1
Zero flag
−
1, 0, 1
The most
significant bit
of data
becomes "0".
FNC 20
ADD
D 0
K 25
D 0
X001
(D 0) + 25
→
(D 0)
Содержание FX3U Series
Страница 1: ...PROGRAMMING MANUAL Basic Applied Instructions Edition FX3U FX3UC SERIES PROGRAMMABLE CONTROLLERS ...
Страница 2: ......
Страница 889: ......