Dividing 16-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 16-bit binary data

/(_U)
These instructions perform division between the two sets of 16-bit binary data specified.
ST
ENO:=DIVISION(EN,s1,s2,d);
■Execution condition
Instruction
/
/_U
Setting data
■Description, range, data type
Operand
Description
(s1)
/
Dividend data or the device where dividend data is stored
/_U
(s2)
/
Divisor data or the device where divisor data is stored
/_U
(d)
/
Start device for storing the operation result
/_U
EN
Execution condition
ENO
Execution result
■Applicable devices/labels
Operand
Bit
SB
(s1)
(s2)
(d)
Processing details
• These instructions divide the 16-bit binary data in the device specified by (s1) by the 16-bit binary data in the device
specified by (s2), and store the operation result in the device specified by (d).
(s1)
b15
b0
b15
···
÷
5678 (BIN)
1234 (BIN)
(d): Quotient
(d)+1: Remainder
• As the operation result, the quotient and remainder are stored in 32 bits. When a bit device is specified, the number of digit-
specified bits is used to store the quotient and remainder.
• Quotient⋅⋅⋅Stored in lower 16 bits.
• Remainder⋅⋅⋅Stored in upper 16 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
b0
b15
b0 b15
···
···
···
4 (BIN)
742 (BIN)
ENO:=DIVISION_U(EN,s1,s2,d);
Range
-32768 to 32767
0 to 65535
-32768 to 32767
0 to 65535
G, RWw, RWr, LW
b0
6.1 Arithmetic Operation Instructions
Data type
ANY16_S
ANY16_U
ANY16_S
ANY16_U
ANY16_S_ARRAY
(Number of elements: 2)
ANY16_U_ARRAY
(Number of elements: 2)
BOOL
BOOL
Constant
K, H
6 BASIC INSTRUCTIONS
6
69

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents