Division - 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

14.4

Division

DIV
This function outputs the quotient of input values ((s1)÷(s2)).
Structured text
d:=DIV(s1,s2);
Setting data
■Description, type, data type
Argument
Description
s1 (IN1)
Dividend
s2 (IN2)
Divisor
d
Output
Processing details
■Operation processing
• This function performs division between the INT, DINT, WORD, DWORD, REAL, or LREAL data type values input to (s1)
and (s2) ((s1)÷(s2)), and output the operation result, in the same data type as (s), from (d).
Ex.
Data type: INT
(s1)
÷
5
INT
• Input an INT, DINT, WORD, DWORD, REAL, or LREAL data type value to (s1) and (s2). (Note that the value input to (s2)
shall be other than 0.)
■Operation result
The operation processing is performed. The operation result is output from (d).
Operation error
• When (s1) and (s2) are of INT or WORD data type
Error code
Description
3400H
The value (divisor) input to (s2) is 0.
• When (s1) and (s2) are of DINT or DWORD data type
Error code
Description
3400H
The value (divisor) input to (s2) is 0.
• When (s1) and (s2) are of REAL data type
Error code
Description
3400H
The value (divisor) input to (s2) is 0.
3402H
The value input to (s1) is -0, a subnormal number, NaN (not a number), or ±∞.
The value input to (s2) is -0, a subnormal number, NaN (not a number), or ±∞.
3403H
The data output from (d) exceeds the following range. (An overflow has occurred.)
128
|(d)|<2
(s2)
2
INT
Type
Data type
Input variable
ANY_NUM
Input variable
ANY_NUM
Output variable
ANY_NUM
(d)
Quotient
Remainder
2
INT
The value is not output.
14 ARITHMETIC OPERATION FUNCTIONS
14.4 Division
14
1
183

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents