EasyManuals Logo
Home>Mitsubishi>Controller>MELSEC QCPU

Mitsubishi MELSEC QCPU User Manual

Mitsubishi MELSEC QCPU
285 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #178 background imageLoading...
Page #178 background image
6 - 27 6 - 27
MELSEC-Q/QnA
6 BASIC INSTRUCTIONS
(4) Judgment whether values for
S1
,
S2
, and
D
are positive or negative are made on the basis of
the most significant bit (b31 for
S1
and
S2
, and b63 for
D
).
• 0 ....... Positive
• 1 ....... Negative
D/
(1) Divides BIN 32-bit data designated by
S1
and BIN 32-bit data designated by
S2
, and stores the
result in the device designated by
D
.
+1
123456 (BIN)
b15- -b0
+1
567890 (BIN)
+1
4 (BIN)
74066 (BIN)
+2+3
S1 S2
D D D D
S1
b15- -b0b31- -b16
S2
b31- -b16 b15- -b0b31- -b16 b15- -b0b31- -b16
/
(2) If a word device has been used, the result of the division operation is stored as 64 bits, and
both the quotient and remainder are stored; if a bit device has been used, 32 bits are used and
only the quotient is stored.
Quotient .......... Stored at the lower 32 bits
Remainder...... Stored at the higher 32 bits
(Can be stored only when a word device has been used)
(3) The values for
S1
and
S2
can be designated at between -2147483648 to 2147483647 (BIN 32 bits).
(4) Judgment whether values for
S1
,
S2
,
D
, and
D
+2 are positive or negative is made on the
basis of the most significant bit (b31).
(A sign is used with both the quotient and the remainder)
• 0 ....... Positive
• 1 ....... Negative
[Operation Errors]
(1) In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
code is stored at SD0.
• Attempt to divide
S2
by 0. (Error code: 4100)
[Program Example]
(1) The following program divides the BIN data at D7 and D8 by the BIN data at D18 and D19
when X5 is ON, and stores the result at D1 to D4.
[Ladder Mode] [List Mode]
Steps
Instruction
Device
(2) The following program outputs the value resulting when the data at X8 to XF is multiplied by
3.14 to Y30 to Y3F when X3 is ON.
[Ladder Mode] [List Mode]
Steps
Instruction
Device
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Mitsubishi MELSEC QCPU and is the answer not in the manual?

Mitsubishi MELSEC QCPU Specifications

General IconGeneral
BrandMitsubishi
ModelMELSEC QCPU
CategoryController
LanguageEnglish

Related product manuals