Mitsubishi MELSEC-Q/L Programming Manual page 209

Table of Contents

Advertisement

Operation Error
(1) In any of the following cases, an operation error occurs, the error flag (SM0) turns ON, and an error code is stored into
SD0.
Error
code
The
or
BCD data is outside the 0 to 9999 range.
S1
S2
4100
The divisor is 0.
Program Example
(1) The following program multiplies the BCD data 67347125 and 573682, stores the result from D502 to D505, and at the
same time outputs the upper 8 digits to Y30 to Y4F.
[Ladder Mode]
[Operation]
6
8
3 4 7 1 2 5
Multiplicand
(2) The following program divides the BCD data from X20 to X3F by the BCD data at D8 and D9 when X0B goes ON, and
stores the result from D765 to D768.
[Ladder Mode]
[Operation]
X3F
9
9
8
6
4
Dividend
Error details
[List Mode]
Step
0
0
5 7 3 6 8 2
Multiplier
[List Mode]
Step
D9 (Upper 4 digits)
X20
3
2
1
1
5
2
/
D766
D765
(Upper 4 digits)
(Lower 4 digits)
0
0
0
0
0
0
0
Quotient
Q00J/
Q00/
QnH
Q01
Instruction
Device
D505
D504
D503
0
0
3 9
2
0
9 5
1
5
3 6
Y4F
Y30
0
0
3 9 2 0 9 5
Instruction
Device
D8 (Lower 4 digits)
6
3
7
4
8
Divisor
D768
(Upper 4 digits)
(Lower 4 digits)
6
0
8
2
8
1
Remainder
DB*, DB*P, DB/, DB/P
QnPH QnPRH
QnU
D502
4
2
5 0
D767
8
3
3
1
2
LCPU
3
4
6
7
8
207

Advertisement

Table of Contents
loading

Table of Contents