Chapter 8 Logic Instructions
8-71
8_
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
Out
is INT. No error will occur during the compiling of the software if
the data type of
Out
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 input value of
In2
can not be 0. In other words, the divisor in the division operation can not be
0. The value of
Out
will be 0 if the value of
In2
is 0.
The division result of
In1
and
In2
may be out of the valid range of the data type of
Out.
For example, the data types of “DIV _In1” and “DIV _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 -32768
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 32768 as shown in the following table, variable 2.
Variable 1
Variable name
Data type
Current value
DIV_EN
BOOL
TRUE
DIV_In1
INT
-32768
DIV_In2
INT
-1
Out1
INT
-32768
Variable 2
Variable name
Data type
Current value
DIV_EN
BOOL
TRUE
DIV_In1
INT
-32768
DIV_In2
INT
-1
Out1
DINT
32768
The Program
1
DIV
EN
ENO
I n1
O ut
I n2
DIV _EN
DIV _In1
DIV _In2
Out 1
The result is always an integer for the division of two integers. Even if there is a remainder for the
division of two integers, the remainder is cut.
For example, the data types of
In1
and
In2
are both INT with their respective values, 10 and 3. And
the data type of
Out
is INT and Real and thus its value is 3 and 3.0 respectively as illustrated in the
following figure.
I n1
In2
/
=
Divis ion res ult
Ou t1
I NT
3
INT
10
3
3
Out 2
3 .0
RE AL
INT
I NT
Содержание DVP-15MC Series
Страница 16: ...1 1 1 Preface Table of Contents 1 1 Explanation of Symbols in This Manual 1 2 1 2 Revision History 1 3...
Страница 19: ...DVP 15MC Series Motion Controller Operation Manual 1 4 _1 MEMO...
Страница 20: ...2 1 2 Overview Table of Contents 2 1 Product Description 2 2 2 2 Functions 2 2 2 3 Profile and Components 2 3...
Страница 23: ...DVP 15MC Series Operation Manual 2 4 _2 MEMO...
Страница 31: ...DVP 15MC Series Motion Controller Operation Manual 3 8 _3 MEMO...
Страница 75: ...DVP 15MC Series Motion Controller Operation Manual 6 26 _6 MEMO...
Страница 87: ...DVP 15MC Series Motion Controller Operation Manual 7 12 _7 MEMO...
Страница 432: ...Chapter 8 Logic Instructions 8 345 8_ MEMO...
Страница 433: ...9 1 9 Chapter 9 Introductions of Axis Parameters Table of Contents 9 1 Description of Axis Parameters 9 2...
Страница 470: ...DVP 15MC Series Motion Controller Operation Manual 10 34 10 MEMO...
Страница 878: ...DVP 15MC Series Motion Controller Operation Manual 11 408 11 1 MEMO...
Страница 920: ...DVP 15MC Series Motion Controller Operation Manual A 16 A MEMO...
Страница 941: ...D 1 D Explanation of Homing Modes Table of Contents D 1 Explanation of Homing Modes D 2...
Страница 966: ...DVP 15MC Series Motion Controller Operation Manual D 26 D MEMO...