Download Print this page

Dividing 32-Bit Binary Data - Mitsubishi Electric MELSEC iQ-F FX5 Programming Manual

Instructions, standard functions/function blocks
Hide thumbs Also See for MELSEC iQ-F FX5:

Advertisement

Dividing 32-bit binary data

D/(P)(_U) instruction and DDIV(P)(_U) instruction can be used for division of 32-bit binary data.
D/(P)(_U)
These instructions divide the 32-bit binary data in the device specified by (s1) by the 32-bit binary data in the device specified
by (s2), and store the result in the device specified by (d).
Ladder diagram
(s1)
(s2)
(d)
FBD/LD
EN
ENO
s1
d
s2
("DDIVISION", "DDIVISIONP", "DDIVISION_U", "DDIVISIONP_U" enters .)
*1 Supported by engineering tool version "1.035M" and later.
Setting data
■Descriptions, ranges, and data types
Operand
Description
(s1)
D/(P)
Dividend data or the head device where the
data to be divided by another is stored
D/(P)_U
(s2)
D/(P)
Divisor data or the head device where the data
by which another is to be divided is stored
D/(P)_U
(d)
D/(P)
Head device for storing the operation result
D/(P)_U
EN
Execution condition
ENO
Execution result
■Applicable devices
Operand
Bit
X, Y, M, L, SM,
F, B, SB, S
(s1)
(s2)
(d)
Processing details
• These instructions divide the 32-bit binary data in the device specified by (s1) by the 32-bit binary data in the device
specified by (s2), and store the division result in the device specified by (d).
(s1)
(s1)+1
(s2)+1
b31
b16 b15
b31
b16 b15
···
···
b0
···
567890 (BIN)
÷
123456 (BIN)
• For the division result of word device, 64-bit binary is used to store the quotient and remainder. For bit device, 32-bit binary
is used to store quotient only.
Word
T, ST, C, D, W,
U\G
SD, SW, R
(s2)
(d)
(d)+1
b31
b16 b15
···
b0
···
···
4 (BIN)
*1
Structured text
ENO:=DDIVISION(EN,s1,s2,d);
ENO:=DDIVISIONP(EN,s1,s2,d);
Range
Data type
-2147483648 to +2147483647
32-bit signed binary
0 to 4294967295
32-bit unsigned binary
-2147483648 to +2147483647
32-bit signed binary
0 to 4294967295
32-bit unsigned binary
64-bit signed binary
64-bit unsigned binary
Bit
Bit
Double word Indirect
specification
Z
LC
LZ
(d)+2
(d)+3
b31
b16 b15
b0
···
···
b0
74066 (BIN)
7.2 Arithmetic Operation Instructions
ENO:=DDIVISION_U(EN,s1,s2,d);
ENO:=DDIVISIONP_U(EN,s1,s2,d);
Data type (label)
ANY32_S
ANY32_U
ANY32_S
ANY32_U
ANY32_ARRAY
(Number of elements:
2)
BOOL
BOOL
Constant
Others
K, H
E
$
7 BASIC INSTRUCTIONS
217
7

Hide quick links:

Advertisement

loading