EasyManua.ls Logo

Delta DVP-15MC Series - Page 152

Delta DVP-15MC Series
972 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Chapter 8 Logic Instructions
8-65
8_
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 _In1and SUB _In2are 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
Data type
Current value
SUB_EN
BOOL
TRUE
SUB _In1
INT
-32768
SUB _In2
INT
1
Out1
INT
32767
Variable 2
Variable name Data type Current value
SUB_EN
BOOL
TRUE
SUB _In1
INT
-32768
SUB _In2
INT
1
Out1
DINT
-32769
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.
The data types of variables SUB_In1, SUB _In2 and Out1 are all TIME and the values of SUB _In1
and SUB _In2 are TIME#4s and TIME#1s respectively. The value of Out1 is TIME#3s when
SUB_EN changes to TRUE as shown in Variable 2.
1
SUB
EN ENO
In1 Out
In2
SUB_EN
SUB_In1
SUB_In2
Out1

Table of Contents

Related product manuals