Справочник Пользователя для Mitsubishi Electronics MELSEC -Q/L
232
6 BASIC INSTRUCTIONS
6.2 Arithmetic Operation Instructions
6.2 Arithmetic Operation Instructions
BCD 4-digit addition and subtraction operations
B+(P), B-(P) [When two data are set]
Processing details
■B+
• Adds the BCD 4-digit data designated by (D) and the BCD 4-digit data designated by (S), and stores the result of the
addition at the device designated by (D).
• 0 to 9999 (BCD 4 digits) can be assigned to (S) and (D).
• If the result of the addition operation exceeds 9999, the higher bits are ignored. The carry flag (SM700) in this case does
• If the result of the addition operation exceeds 9999, the higher bits are ignored. The carry flag (SM700) in this case does
not turn ON.
■B-
• Subtracts the BCD 4-digit data designated by (S) and the BCD 4-digit data designated by (D), and stores the result of the
subtraction at the device designated by (D).
• 0 to 9999 (BCD 4 digits) can be assigned to (S) and (D).
• The following will result if an underflow is generated by the subtraction operation: The carry flag (SM700) in this case does
• The following will result if an underflow is generated by the subtraction operation: The carry flag (SM700) in this case does
not turn ON.
(S): Data for adding/subtracting or head number of the devices where the data for adding/subtracting is stored (BCD 4 digits)
(D): Head number of the devices where the data to be added to/subtracted from is stored (BCD 4 digits)
(D): Head number of the devices where the data to be added to/subtracted from is stored (BCD 4 digits)
Setting
data
data
Internal device
R, ZR
J\
U\G
Zn
Constant
K, H
K, H
Others
Bit
Word
Bit
Word
(S)
(D)
Basic
Process
High
performance
Redundant Universal
LCPU
Command
Command
P
B+/B
B+, B
B+P, B P
S
D
S
D
indicates an instruction symbol of .
9
6
1
2
2
1
3
4
6
5
7
8
D
S
D
4
6
3
2
0
0
1
5
5
3
8
3
Digits exceeding the designated
number of digits are assumed to be 0.
number of digits are assumed to be 0.
4
0
4
4
2
0
3
4
6
0
7
8
D
D
S
9
9
9
8
0
0
0
3
0
0
0
1