Delta Electronics DVP15MC11T Operation Manual page 128

Table of Contents

Advertisement

The input and output variables are allowed to be of different data types among bits, integers and
real numbers. When the data types of input and output variables are different, 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.
For the data type of time and date, only following combinations are supported.
1. In1 is TIME, In2 is TIME and Out is TIME;
2. In1 is TOD, In2 is TIME and Out is TOD;
3. In1 is TOD, In2 is TOD and Out is TIME;
4. In1 is DATE, In2 is DATE and Out is TIME;
5. In1 is DT, In2 is DT and Out is TIME;
6. In1 is DT, In2 is TIME and Out is DT.
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 difference between In1 and In2 may be out of the valid range of the data type of Out.
For example, the data types of "SUB _In1" and "SUB _In2" are both INT with their respective values,
-32768 and 1. If the data type of the output variable is INT, the output variable value will be 32767 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 -32769 as shown in the following table, variable 2.
Variable 1
Variable name
SUB_EN
SUB _In1
SUB _In2
Out1
Variable 2
Variable name
SUB_EN
SUB _In1
SUB _In2
Out1
The Program
Programming Example
The data types of variables SUB_In1, SUB _In2 and Out1 are all INT and the values of SUB _In1
and SUB _In2 are 100 and 40 respectively. The value of Out1 is 60 when SUB_EN changes to
TRUE as shown in Variable 1.
I nput p aramete r
In1
In2
S UB
SUB_EN
EN
SUB_I n1
In1
SUB_I n2
In2
Chapter 8 Logic Instructions
Su btraction
Result
assig nment
Data type
BOOL
INT
INT
INT
Data type
BOOL
INT
INT
DINT
1
E NO
Out
O ut1
Ou tput
parame ter
Out
Current value
TRUE
-32768
1
32767
Current value
TRUE
-32768
1
-32769
8-57
8_

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents