Mitsubishi Electronics FX3G User Manual

Page of 964
280
FX
3S
/FX
3G
/FX
3GC
/FX
3U
/FX
3UC
 Series
Programming Manual - Basic & Applied Instruction Edition
10 Arithmetic and Logical Operation (
+, −, ×, ÷) – FNC 20 to FNC 29
10.4 FNC 23 – DIV / Division
Program examples
1. 16-bit operation
2. 32-bit operation
Function Changes According to Versions
The function of the FNC 23 instruction varies depending on the PLC version shown in the table below.
Compatible Versions
Item
Function Summary
FX
3S
FX
3G
FX
3GC
FX
3U
FX
3UC
Ver. 1.00 
or later
Ver. 1.00 
or later
Ver. 1.40 
or later
Ver. 2.30 
or later
Ver. 2.30 
or later 
Zero Flag
Turns M8304 ON when the operation result of DIV 
instruction is 0.
Carry Flag
Turns M8306 ON when the operation result of DIV 
instruction overflows.
16-bit operation: Only when the maximum negative value 
(-32,768) is divided by -1.
32-bit operation: Only when the maximum negative value 
(-2,147,483,648) is divided by -1.
X000
FNC 23
DIV
D  0
D  2
D  4
S
S
Dividend    Divisor     Quotient       Remainder
(D 0) 
   ÷    (D 2)   →   (D 4)     ...    (D 5)
 100             33               3                 1
X001
FNC 23
DDIV
D  0
D  2
D  4
S
S
Dividend      Divisor        Quotient      Remainder
(D 1,D 0) 
÷ (D 3,D 2) → (D 5,D 4) ... (D 7,D 6)
 100,000        3333              30               10