200
B+, B+P, B-, B-P
Function
B+
(1) Adds the BCD 4-digit data designated by and the BCD 4-digit data designated by , and stores the result of the
addition at the device designated by .
(2) 0 to 9999 (BCD 4 digits) can be assigned to , and .
(3) If the result of the addition operation exceeds 9999, the higher bits are ignored.
The carry flag in this case does not go ON.
B-
(1) Subtracts the BCD 4-digit data designated by and the BCD 4-digit data designated by , and stores the result of the
subtraction at the device designated by .
(2) 0 to 9999 (BCD 4 digits) can be assigned to , and .
(3) The following will result if an underflow is generated by the subtraction operation:
The carry flag in this case does not go ON.
Operation Error
(1) In the following case, an operation error occurs, the error flag (SM0) turns ON, and an error code is stored into SD0.
Program Example
(1) The following program adds the D3 BCD data and the Z1 BCD data when X20 goes ON, and outputs the result to Y8 to
Y17.
[Ladder Mode]
[List Mode]
(2) The following program subtracts the BCD data at D20 from the BCD data at D10 when X20 goes ON, and stores the
result at R10.
[Ladder Mode]
[List Mode]
Error
code
Error details
Q00J/
Q00/
Q01
QnH
QnPH QnPRH
QnU
LCPU
4100
or BCD data is outside the 0 to 9999 range.
S1
S2
D
9
6
1
2
2
1
3
4
6
5
7
8
S1
S2
D
S1
S2
D
4
6
3
2
0
0
1
5
5
3
8
3
S1
S2
D
Digits exceeding the designated
number of digits are assumed to be 0.
4
0
4
4
2
0
3
4
6
0
7
8
S1
D
S2
S1
S2
D
9
9
9
8
0
0
0
3
0
0
0
1
S1
S2
Step
Instruction
Device
Step
Instruction
Device