Mitsubishi MELSEC QS Series Programming Manual page 113

Hide thumbs Also See for MELSEC QS Series:
Table of Contents

Advertisement

/
(1) Divides BIN 16-bit data designated by
the result in the device designated by
(2) If a word device has been used, the result of the division operation is stored as 32 bits, and
both the quotient and remainder are stored; if a bit device has been used, 16 bits are used
and only the quotient is stored.
Quotient:
Remainder:
(3) Values for
S1
(4) Judgment whether values for
basis of the most significant bit (b15). (Sign is attached to both the quotient and remainder.)
• 0: Positive
• 1: Negative
Operation Error
(1) In any of the following cases, an operation error occurs, the error flag (SM0) turns ON, and
the corresponding error code is stored into SD0.
• Attempt to divide
Program Example
(1) The following program divides "5678" by "1234" when X5 goes ON, and stores the result at
D3 and D4.
[Ladder Mode]
(2) The following program divides BIN data at X8 to XF by BIN data at X10 to X1B, and outputs
the result of the division operation to Y30 to Y3F.
[Ladder Mode]
(3) The following program divides, when X3 is turned ON, the data at X8 to XF by 3.14 and
outputs the operation result at Y30 to Y3F.
[Ladder Mode]
S1
b15
b0
b15
5678 (BIN)
1234 (BIN)
Stored at the lower 16 bits
Stored at the upper 16 bits (Stored only when using a word device)
and
can be designated between
S2
,
,
S1
S2
by 0.
S2
6.2.3 BIN 16-bit multiplication and division operations (*(P), /(P))
and BIN 16-bit data designated by
S1
.
D
Quotient
Remainder
D
S2
b0
b15
b0
b15
4 (BIN)
742 (BIN)
32768 and 32767 (BIN, 16 bits).
and
+ 1 are positive or negative is made on the
D
D
6.2 Arithmetic Operation Instructions
*(P), /(P)
, and stores
S2
D
+1
b0
(Error code: 4100)
6-15
6

Advertisement

Table of Contents
loading

Table of Contents