EasyManua.ls Logo

Mitsubishi Electric MELSEC FX Series - Page 192

Mitsubishi Electric MELSEC FX Series
838 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
Loading...
7 Applied Instructions
7.3 Arithmetic and Logical Operation
190
FXCPU Structured Programming Manual
(Basic & Applied Instruction)
Function and operation explanation
1. 16-bit operation(DIV, DIVP)
The contents specified by indicates the dividend, the contents specified by indicates the divisor, the
quotient and remainder are transferred to the device specified by .
The most significant bit of each data indicates the sign (positive: 0 or negative: 1), and data is divided
algebraically, for example, 36 ÷ (-5) = -7 (quotient) and 1 (remainder).
Two devices in total starting from are occupied to store the operation result (quotient and remainder).
Make sure that these two devices are not used for other control.
When a constant (K) is specified in or , it is automatically converted into the binary format.
2. 32-bit operation(DDIV, DDIVP)
The contents specified by indicates the dividend, the contents specified by indicates the divisor, the
quotient and remainder are transferred to the device specified by .
Four devices in total starting from are occupied to store the operation result (quotient and remainder).
Make sure that these four devices are not used for other control.
The most significant bit of each data indicates the sign (positive: 0 or negative: 1), and data is divided
algebraically, for example, 5,500 ÷ (-540) = -10 (quotient) and 100 (remainder).
When a constant (K) is specified in or , it is automatically converted into the binary format.
Extension function(FXU and FX2C PLCs)
The FXU PLC of V2.30 or earlier does not support the extension function.
When executing an instruction with M8023 ON, a binary float operation takes place, for example, (D1, D0) ÷
(D3, D2) = (D5, D4).
In this case, K, H and D are valid as the object device for and and D is valid for .
The source data needs to be converted into binary float value in advance by FLT instruction.
Note, however, that constants K and H are automatically converted into binary float values.
Related device
*1. Available in the FX3U and FX3UC PLCs of Ver. 2.30 or later and FX3G PLC of Ver. 1.00 or later.
Device Name Description
M8304
*1
Zero
ON : When the operation result is 0
OFF : When the operation result is not 0
M8306
*1
Carry
ON : When the operation result is more than 32,767 (in 16-bit operation) or 2,147,483,647 (in
32-bit operation), the carry flag operates.
OFF : When the operation result is not more than 32,767 (in 16-bit operation) or
2,147,483,647(in 32-bit operation)
Command input
Division data 1
Division data 2
Label1
*1
*1 This defines the device that stores the division result.
DIV
EN
s1
s2
ENO
d
Dividend
BIN BIN BIN BIN
( ) ÷ ( ) ( )··· ( +1)
16 bits
s1 s2 d d
16 bits16 bits 16 bits
Divisor Quotient
Remainde
r
*3 This defines the device that stores
the division result.
DDIV
EN
s1
s2
ENO
d
Label2
*2
Label3
*3
*1 This defines the dividend data or the
device that stores the dividend data.
*2 This defines the divisor data or the
device that stores the divisor data.
Label1
*1
32 bits
s1 s2 s2
[ +1, ] ÷ [ +1, ] [ +1, ] ··· [ +3, +2]
s1 d d d d
BIN BIN BIN BIN
32 bits 32 bits 32 bits
Command input
Dividend Divisor Quotient
Remainder

Table of Contents

Other manuals for Mitsubishi Electric MELSEC FX Series

Related product manuals