EasyManua.ls Logo

Mitsubishi MELSEC iQ-F FX5 series

Mitsubishi MELSEC iQ-F FX5 series
888 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
6 BASIC INSTRUCTIONS
6.2 Arithmetic Operation Instructions
181
6
DIV(P)(_U)
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 result in the device specified by (d).
*1 The DIV instruction is not supported by the ST language. Use DIV of the standard function.
Page 783 DIV(_E)
Setting data
Descriptions, ranges, and data types
Applicable devices
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 division result in the device specified by (d).
Two devices in total starting from the one specified by (d) are used to store the division result. Make sure that these two
devices are not used for another control.
Related flag
Ladder diagram Structured text
*1
ENO:=DIVP(EN,s1,s2,d); ENO:=DIV_U(EN,s1,s2,d);
ENO:=DIVP_U(EN,s1,s2,d);
Operand Description Range Data type Data type (label)
(s1) DIV(P) Dividend data or the device where the data to
be divided by another is stored
-32768 to +32767 16-bit signed binary ANY16_S
DIV(P)_U 0 to 65535 16-bit unsigned binary ANY16_U
(s2) DIV(P) Divisor data or the device where the data by
which another is to be divided is stored
-32768 to +32767 16-bit signed binary ANY16_S
DIV(P)_U 0 to 65535 16-bit unsigned binary ANY16_U
(d) DIV(P) Head device for storing the operation result
(quotient, remainder)
32-bit signed binary ANY16_S_ARRAY
(Number of elements:
2)
DIV(P)_U 32-bit unsigned binary ANY16_U_ARRAY
(Number of elements:
2)
Operand Bit Word Double word Indirect
specification
Constant Others
X, Y, M, L,
SM, F, B, SB
U\G T, ST,
C, LC
T, ST, C, D,
W, SD, SW, R
U\G Z LC LZ K, H E $
(s1) 
(s2) 
(d) 
Quotient…… Stored in the lower 16 bits.
Remainder…… Stored in the upper 16 bits.
Device Name Description
SM700 Carry When the operation result of the signed operation exceeds 32767, the carry flag is turned ON.
SM8304 Zero When the operation result is 0, the zero flag is turned ON.
SM8306 Carry When the operation result of the signed operation exceeds 32767, the carry flag is turned ON.
(s1) (s2) (d)
b15 b0
5678 (BIN)
(s1) (s2)
1234 (BIN) 4 (BIN) 742 (BIN)
÷
···
b15 b0
···
(d)
b0
··· ···
b15 b0 b15
(d)+1
Quotient Remainder

Table of Contents

Related product manuals