199
B+, B+P, B-, B-P
1
2
3
4
6
7
8
6.2
A
rithmetic Opera
tion In
str
uctions
6.2.5
B
+
, B
+
P, B-, B-P
Program Example
(1) The following program adds BCD data 5678 and 1234, stores it at D993, and at the same time outputs it to from Y30 to
Y3F.
[Ladder Mode]
[List Mode]
(2) The following program subtracts the BCD data 4321 from 7654, stores the result at D10, and at the same time outputs it
to Y30 to Y3F.
[Ladder Mode]
[List Mode]
When three data are set ( +
, -
)
: Data to be added to/subtracted from or head number of the devices where the data to be added to/subtracted from is stored (BCD 4 digits)
: Data for adding/subtracting or head number of the devices where the data for adding/subtracting is stored (BCD 4 digits)
: Head number of the devices where the addition/subtraction operation result will be stored (BCD 4 digits)
Setting
Data
Internal Devices
R, ZR
J \
U \G
Zn
Constants
K, H
Other
Bit
Word
Bit
Word
––
––
––
––
Stores
5678
i
n
BCD
to
D993
.
Adds
123
4 i
n
BCD
to
the
va
l
ue
at
D993
,
and
stores
the
resu
l
t
to
D993
.
Outputs
the
data
i
n
D993
to
Y
30
to
Y
3
F.
Step
Instruction
Device
Stores
765
4 i
n
BCD
to
D10
.
Subtracts
the
va
l
ue
i
n
D10
from
4
321
i
n
BCD
,
and
stores
the
resu
l
t
to
D10
.
Outputs
the
data
i
n
D10
to
Y
30
to
Y
3
F.
Step
Instruction
Device
S1
S2
D
S1
S2
D
Command
Command
P
B+, B-
B+P, B-P
S1
S2
D
S1
S2
D
B+/B-
indicates an instruction s
y
mbol of .
S1
S2
D
S1
S2
D