Delta Electronics DVP15MC11T Operation Manual page 131

Table of Contents

Advertisement

DVP15MC11T Operation Manual
The input and output variables are allowed to be of different data types in this instruction. When the
data types of input and output variables are different, the range of the data type of the output
variable must include the valid ranges of data types of all input variables. Otherwise, there will be an
error during the compiling of the software. For example, if the data types of In1 and In2 are INT and
DINT respectively, the data type of Out is DINT. There will be an error during the compiling of the
software if the data type of the variable that Out is connected to is INT. No error will occur during the
compiling of the software if the data type of the variable that Out is connected to is LINT.
Precautions for Correct Use
The input variables are not allowed to omit. An error will occur during the compiling of the software if
any input variable is omitted. But the output variable is allowed to omit.
The multiplication result of In1 ~ In2 may be out of the valid range of the data type of Out.
For example, the data types of "MUL _In1" and "MUL _In2" are both INT with their respective values,
20000 and 2. If the data type of the output variable is INT, the output variable value will be -25536 as
shown in the following table, Variable 1. If the data type of the output variable is set to DINT, the
output variable value will be 40000 as shown in the following table, Variable 2.
Variable 1
MUL_EN
MUL _In1
MUL _In2
Out1
Variable 2
MUL_EN
MUL _In1
MUL _In2
Out1
The Program
_8
Programming Example
The data types of variables MUL _In1, MUL _In2 and Out1 are all INT. The values of MUL _In1 and
MUL _In2 are 10 and 50 respectively. The value of Out1 is 500 when MUL _EN changes to TRUE.
8-60
In put pa rameter Multiplicat ion
In1
In2
InN
Variable name
Variable name
MUL_E N
MUL_I n1
MUL_I n2
Outp ut
paramete r
Res ult
O ut
as sign ment
Data type
BOOL
INT
INT
INT
Data type
BOOL
INT
INT
DINT
1
MUL
EN
ENO
In1
Ou t
O ut1
In2
Current value
TRUE
20000
2
-25536
Current value
TRUE
20000
2
40000

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents