Download Print this page

Mitsubishi Electric MELSEC iQ-F FX5 Programming Manual page 213

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

Advertisement

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).
Ladder diagram
(s1)
(s2)
(d)
*1
FBD/LD
EN
ENO
s1
d
s2
("DIVP", "DIV_U", "DIVP_U" enters .)
*1 The DIV instruction is not supported by the ST language and the FBD/LD language. Use DIV of the standard function.
Page 993 DIV(_E)
Setting data
■Descriptions, ranges, and data types
Operand
Description
(s1)
DIV(P)
Dividend data or the device where the data to
be divided by another is stored
DIV(P)_U
(s2)
DIV(P)
Divisor data or the device where the data by
which another is to be divided is stored
DIV(P)_U
(d)
DIV(P)
Head device for storing the operation result
(quotient, remainder)
DIV(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 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).
(s1)
b15
b0
b15
···
5678 (BIN)
÷
1234 (BIN)
(d): Quotient
(d)+1: Remainder
• 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.
• Quotient...... Stored in the lower 16 bits.
• Remainder...... Stored in the upper 16 bits.
Word
T, ST, C, D, W,
U\G
SD, SW, R
(s2)
(d)
(d)+1
b15
b0 b15
b0
···
···
···
4 (BIN)
742 (BIN)
*1
Structured text
ENO:=DIVP(EN,s1,s2,d);
Range
Data type
-32768 to +32767
16-bit signed binary
0 to 65535
16-bit unsigned binary
-32768 to +32767
16-bit signed binary
0 to 65535
16-bit unsigned binary
32-bit signed binary
32-bit unsigned binary
Bit
Bit
Double word Indirect
specification
Z
LC
LZ
b0
7.2 Arithmetic Operation Instructions
ENO:=DIV_U(EN,s1,s2,d);
ENO:=DIVP_U(EN,s1,s2,d);
Data type (label)
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
Others
K, H
E
$
7 BASIC INSTRUCTIONS
211
7

Hide quick links:

Advertisement

loading