Fnc 23 - Div / Division - Mitsubishi Electric MELSEC FX3U Programming Manual

Melsec fx series programmable logic controllers
Table of Contents

Advertisement

FX
/FX
/FX
Series Programmable Controllers
3G
3U
3UC
Programming Manual - Basic & Applied Instruction Edition
10.4
FNC 23 – DIV / Division
Outline
This instruction executes division by two values to obtain the result (A ÷ B = C ... ).
1. Instruction format
FNC 23
D
DIV
2. Set data
Operand type
S
1
S
2
D
3. Applicable devices
Bit Devices
Oper-
and
System User
Type
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G
S
1
S
2
D
1:This function is supported only in FX
2: Available only in 16-bit operations (Not available in 32-bit operations)
Explanation of function and operation
1. 16-bit operation (DIV and DIVP)
indicates the dividend,
S
1
remainder is transferred to
Command
input
FNC 23
DIV
• The most significant bit of each data indicates the sign (positive: 0 or negative: 1), and data are divided
algebraically.
36 ÷ (−5) = −7 (quotient) ... 1 (remainder)
• Two devices in total starting from
remainder). Make sure that these two devices are not used for another control.
• When a constant (K) is specified as
292
→ For the floating point division instruction EDIV (FNC123), refer to Section 18.11.
Mnemonic
16-bit Instruction
P
7 steps DIV
DIVP
Data for division or word device number storing data (dividend)
Data for division or word device number storing data (divisor)
Head word device number storing the division result (quotient and remainder)
Digit Specification
3U
indicates the divisor, the quotient is transferred to
S
2
+1.
D
S
S
1
2
D
S
10 Arithmetic and Logical Operation (+, −, ×, ÷) – FNC 20 to FNC 29
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
Description
Word Devices
Special
System User
Unit
1
1
1
/FX
PLCs.
3UC
Dividend
Divisor
D
BIN
BIN
S
) ÷ (
S
) → (
(
1
2
16 bits
16 bits
are occupied to store the operation result (quotient and
or
, it is automatically converted into the binary format.
S
1
2
10.4 FNC 23 – DIV / Division
Mnemonic
32-bit Instruction
DDIV
13 steps
DDIVP
16- or 32-bit binary
16- or 32-bit binary
32- or 64-bit binary
Con-
Real
Index
stant
Number
V Z Modify K H
E
2
Quotient
Remainder
BIN
BIN
D
D
) ... (
+1)
16 bits
16 bits
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
Data type
Others
Charac-
Pointer
ter String
" "
P
, and the
D

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec fx3ucMelsec fx3g

Table of Contents