Multiplication - 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.2

Multiplication

MUL
This function outputs the product of input values ((s1)×(s2)×⋅⋅⋅×(s28)).
*1
Structured text
d:=MUL(s1,s2);
*1 The input variable s can be changed within the range from 2 to 28.
Setting data
■Description, type, data type
Argument
Description
s1 (IN1) to s28 (IN28)
Input
d
Output
Processing details
■Operation processing
• This function multiplies the INT, DINT, WORD, DWORD, REAL, or LREAL data type values input to (s1) to (s28)
((s1)×(s2)×⋅⋅⋅×(s28)), and output the operation result, in the same data type as (s), from (d).
Ex.
Data type: INT
(s1)
(s2)
100
×
15
INT
INT
• Input an INT, DINT, WORD, DWORD, REAL, or LREAL data type value to (s1) to (s28).
• If an underflow or overflow occurs in the operation result, the output from (d) will be as follows.
Data type
Description
INT
• Even if an underflow or overflow occurs, no operation error is issued.
WORD
• Even if the operation result is outside the INT or WORD data type range, the INT or WORD data type value is output; (In this
case, the output value is of INT or WORD data type with the upper 16 bits deleted although the operation result is a DINT or
DWORD data type value.)
• If the operation result is outside the INT or WORD data type range, convert the input value to the DINT or DWORD data type by
using the INT_TO_DINT or WORD_TO_DWORD function, and then perform operation.
DINT
• Even if an underflow or overflow occurs, no operation error is issued.
DWORD
• Even if the operation result is outside the DINT or DWORD data type range, the DINT or DWORD data type value is output; (In
this case, the output value is of DINT or DWORD data type with the upper 32 bits deleted although the operation result is 64-bit
data.)
• If the operation result is outside the DINT or DWORD data type range, convert the input value to the REAL data type by using the
DINT_TO_REAL function, and then perform operation.
REAL
An operation error occurs and an undefined value is output.
LREAL
■Operation result
The operation processing is performed. The operation result is output from (d).
If the operation result is outside the data type range, convert the input value as appropriate before operation.
(d)
1500
INT
14 ARITHMETIC OPERATION FUNCTIONS
Type
Data type
Input variable
ANY_NUM
Output variable
ANY_NUM
14.2 Multiplication
14
179

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents