Mitsubishi Electric MELSEC-Q/L Programming Manual page 245

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

Advertisement

Operation error
• 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
Error details
code
4100
The (S1) or (S2) BCD data is outside the 0 to 99999999 range.
The divisor is 0.
Program example
• 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
0
0
5 7 3 6 8 2
Multiplicand
Multiplier
• 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
3
2
Dividend
D766
(Upper 4 digits)
0
D505
0
0
Y4F
0
0
D9 (Upper 4 digits)
X20
1
1
5
2
6
/
Divisor
D765
(Lower 4 digits)
0
0
0
0
0
0
6
Quotient
Q00J/
QnH
Q00/
Q01
[List Mode]
Instruction
Step
D504
D503
D502
3 9
2
0
9 5
1
5
3 6
4
2
Y30
3 9 2 0 9 5
[List Mode]
Step
Instruction
D8 (Lower 4 digits)
3
7
4
8
D768
D767
(Upper 4 digits)
(Lower 4 digits)
0
8
2
8
1
8
Remainder
6.2 Arithmetic Operation Instructions
QnPH
QnPRH
QnU
Device
5 0
Device
3
3
6 BASIC INSTRUCTIONS
LCPU
6
243

Advertisement

Table of Contents
loading

Table of Contents