Chapter 8 Logic Instructions
8-175
8_
Real Number to Integer
Real numbers can be converted to integers. And some instructions are shown below.
For the real number-to-integer conversion, there are two cases in which the fractional part is
truncated and rounded up as follows.
Case 1:
If the first digital number of the fractional part is less than 5, the fractional part will be
truncated and the integer part will not change.
Case 2:
If the first digital number of the fractional part is greater than or equal to 5, the
fractional part will be truncated and the integer part will add by 1.
Input value
Output result
Data type
Output value
Case 1
1.36
SINT
1
USINT
1
-2.4
SINT
-2
USINT
254
Case 2
1.6
SINT
2
USINT
2
-2.6
SINT
-3
USINT
253
Note:
For the Real Number-to-Integer Conversion, there are two cases for the value of a real
number.
1. If the number of input digits of a real number exceeds what is allowed, the result will be an
unsure value. Please set a limit in the user program in order to get a correct value.
For example: Then the input value is 123456789 and the number of its digits exceeds the set
limit 7. The digits which go beyond the limit are abnormal. Then the output value is
1234567
92
.
2. If the number of input digits does not exceed the set limit, the result is calculated based on
the conversion rule.
Real Number to Bit string
Real numbers can be converted to bit strings. And some instructions are shown below.
The rule for the conversion of real numbers into bit strings is the same as that for the
conversion of real numbers into unsigned integers.
REAL_ TO _SINT
EN
ENO
O ut
In
REA L_TO _USI NT
EN
ENO
O ut
In
LREA L_TO_DINT
EN
ENO
O ut
In
L RE AL_TO_L INT
EN
ENO
O ut
In
RE AL_TO_B YTE
EN
ENO
O ut
In
REAL_ TO_ WORD
EN
ENO
O ut
In
L RE AL_TO_DWO RD
EN
ENO
O ut
In
LREAL _TO _LWO RD
EN
ENO
O ut
In
Summary of Contents for DVP-15MC Series
Page 19: ...DVP 15MC Series Motion Controller Operation Manual 1 4 _1 MEMO...
Page 23: ...DVP 15MC Series Operation Manual 2 4 _2 MEMO...
Page 31: ...DVP 15MC Series Motion Controller Operation Manual 3 8 _3 MEMO...
Page 75: ...DVP 15MC Series Motion Controller Operation Manual 6 26 _6 MEMO...
Page 87: ...DVP 15MC Series Motion Controller Operation Manual 7 12 _7 MEMO...
Page 432: ...Chapter 8 Logic Instructions 8 345 8_ MEMO...
Page 470: ...DVP 15MC Series Motion Controller Operation Manual 10 34 10 MEMO...
Page 878: ...DVP 15MC Series Motion Controller Operation Manual 11 408 11 1 MEMO...
Page 920: ...DVP 15MC Series Motion Controller Operation Manual A 16 A MEMO...
Page 941: ...D 1 D Explanation of Homing Modes Table of Contents D 1 Explanation of Homing Modes D 2...
Page 966: ...DVP 15MC Series Motion Controller Operation Manual D 26 D MEMO...