Mitsubishi MELSEC Q Series Programming Manual page 247

Common instruction 1/2
Hide thumbs Also See for MELSEC Q Series:
Table of Contents

Advertisement

(2) 64 bits are used for the result of the division operation, and stored as quotient and
remainder.
Quotient (BCD 8 digits)
Remainder (BCD 8 digits) :Stored at the upper 32 bits.
(3) If
has been designated as a bit device, the remainder of the operation will not be stored.
D
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.
• The
or
S1
• Attempt to divide
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]
3 4 7 1 2 5
6
8
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
:Stored at the lower 32 bits.
BCD data is outside the 0 to 99999999 range.
S2
by 0.
S2
0
0
5 7 3 6 8 2
Multiplier
D9 (Upper 4 digits)
X20
6
4
3
2
1
1
/
Dividend
D766
(Upper 4 digits)
0
0
0
0
0
Quotient
[List Mode]
Instruction
Step
D505
D504
0
0
3 9
2
0
9 5
Y4F
Y30
0
0
3 9 2 0 9 5
[List Mode]
Instruction
Step
D8 (Lower 4 digits)
5
2
6
3
7
4
Divisor
D765
D768
(Lower 4 digits)
(Upper 4 digits)
0
0
6
0
8
2
Remainder
DB*(P),DB/(P)
(Error code: 4100)
(Error code: 4100)
Device
D503
D502
1
5
3 6
4
2
5 0
Device
8
D767
(Lower 4 digits)
8
8
3
3
1
6-45
1
2
3
4
4
6
7
8

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec l series

Table of Contents