Dividing 32-Bit Binary Data - Mitsubishi Electric MELSEC iQ-R Series Programming Manual

Motion module instructions, standard functions/ function blocks
Hide thumbs Also See for MELSEC iQ-R Series:
Table of Contents

Advertisement

Dividing 32-bit binary data

D/(_U)
These instructions perform division between the two sets of 32-bit binary data specified.
ST
ENO:=DDIVISION(EN,s1,s2,d);
■Execution condition
Instruction
D/
D/_U
Setting data
■Description, range, data type
Operand
Description
(s1)
D/
Dividend data or the start device where dividend data is stored
D/_U
(s2)
D/
Divisor data or the start device where divisor data is stored
D/_U
(d)
D/
Start device for storing the operation result
D/_U
EN
Execution condition
ENO
Execution result
■Applicable devices/labels
Operand
Bit
SB
(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 operation result in the device specified by (d).
(s1)
(s1)+1
(s2)+1
b31
b16 b15
b31
b16 b15
b0
···
···
···
÷
123456 (BIN)
567890 (BIN)
• As the operation result when a word device is specified, the quotient and remainder are stored in 64 bits. The quotient is
stored in lower 32 bits, and the remainder is stored in upper 32 bits. When a bit device is specified, only quotient is stored in
32 bits.
Operation error
Error code
Description
3400H
The value (divisor) in the device specified by (s2) is 0.
Execution condition
Word
RX, RY, LB
SW
(s2)
(d)
(d)+1
b31
b16 b15
b0
b0
···
···
···
4 (BIN)
ENO:=DDIVISION_U(EN,s1,s2,d);
Range
-2147483648 to 2147483647
0 to 4294967295
-2147483648 to 2147483647
0 to 4294967295
G, RWw, RWr, LW
(d)+2
(d)+3
b31
b16 b15
b0
···
···
74066 (BIN)
6.1 Arithmetic Operation Instructions
Data type
ANY32_S
ANY32_U
ANY32_S
ANY32_U
ANY32_S_ARRAY
(Number of elements: 2)
ANY32_U_ARRAY
(Number of elements: 2)
BOOL
BOOL
Constant
K, H
6 BASIC INSTRUCTIONS
6
71

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents