Mitsubishi MELSEC-Q Series Programming Manual page 200

Hide thumbs Also See for MELSEC-Q Series:
Table of Contents

Advertisement

B*, B/
B/(P)
(1) Divides BCD data specified for
variable specified for
(2) Quotient and remainder of the division result are stored in 32-bit data.
Quotient (4-digit BCD):
Remainder (4-digit BCD):
Operation Error
In any of the following cases, an operation error occurs, the error flag (SM0) is turned ON, and
the corresponding error code is stored to SD0.
• The
• Attempt to divide
Program Example
(1) In the following program, the BCD value in Var_D7 is multiplied by the BCD value in Var_D8
when X20 turns ON, and the result is stored to Var_D0.
[Structured ladder]
[Operation]
Var_D7
9
(2) In the following program, the BCD value 5678 is divided by the BCD value 1234, and the
result is stored to Var_D502.
[Structured ladder]
[Operation]
5
6.2 Arithmetic Operation Instructions
6-38
6.2.7 4-digit BCD data multiplication and division
.
d
s1
5
6
7
8
0
or
BCD value is outside the range of 0 to 9999.
s2
s1
by 0.
s2
D8
7
5
3
8
6
4
6
7
8
1
2
3
by BCD data specified for
s1
Quotient
s2
d
[0]
8
7
6
0
0
Digits exceeding the specified
number of digits are assumed to be 0.
Stored to
Stored to
Var_D0[1](Upper 4 digits)
2
8
4
2
Var_502[0]
4
0
0
0
Quotient
, and stores the result to the
s2
Remainder
d
[1]
0
6
0
4
2
2
[0] (16 bits).
d
[1] (16 bits).
d
(Error code: 4100)
(Error code: 4100)
Var_D0[0](Lower 4 digits)
8
5
4
2
6
Var_502[1]
4
0
7
4
2
Remainder

Advertisement

Table of Contents
loading

This manual is also suitable for:

Qcpu

Table of Contents