Delta Electronics DVP15MC11T Operation Manual page 208

Table of Contents

Advertisement

When the data types of input variables are not BOOL, TIME, DATE, TOD or STRING, the input
parameters In0~In1 are allowed to connect the variables of different data types.
When the data types of input variables are one of BOOL, TIME, DATE, TOD and STRING, all the
input variables and output variable should be of the data type. For example, if the data type of the
variable connected to In0 is TIME, the data types of the variables connected to In1 and Out must be
TIME. Otherwise, an error will occur during the compiling of the software.
Precautions for Correct Use
The input variables are not allowed to omit. An error will occur during the compiling of the software if
the input variables are omitted. But the output variable is allowed to omit.
The length of the data type of the output variable must contain the length of the variables that the
input parameters In0 and In1 connect. Otherwise, an error will occur during the compiling of the
software.
Programming Example
The data types of SEL_G, SEL_In0 and SEL_In1 are BOOL, UINT and DINT and the data type of
Out1 is DINT. When SEL_EN is TRUE, the value of Out1 is 50 if the values of SEL_G, SEL_In0 and
SEL_In1 are FALSE, 50 and 100 respectively as shown in the following table Variable 1. If the
values of SEL_G, SEL_In0 and SEL_In1 are TRUE, 50 and 100 respectively, the value of Out1 is
100 as shown in the following table Variable 2.
Variable 1
Variable name
SEL_EN
SEL_G
SEL_In0
SEL_In1
Out1
Variable 2
Variable name
SEL_EN
SEL_G
SEL_In0
SEL_In1
Out1
The program
:
In0 I NT#1 0
SE L
G=FALSE
:
In1 I NT#2 0
:
In0 I NT#1 0
SE L
G=TRUE
:
In1 I NT#2 0
SE L
SEL_E N
EN
SEL _G
G
SEL_ In0
In0
SEL_ In1
In1
Chapter 8 Logic Instructions
O ut:I NT#1 0
O ut:I NT#2 0
Data type
BOOL
BOOL
UINT
DINT
DINT
Data type
BOOL
BOOL
UINT
DINT
DINT
1
ENO
Ou t
O ut1
Current value
TRUE
FALSE
50
100
50
Current value
TRUE
TRUE
50
100
100
8-137
8_

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents