EasyManuals Logo

Delta DVP-15MC Series User Manual

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
Page #262 background imageLoading...
Page #262 background image
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
123456792.
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
Out
In
REAL_TO_USINT
EN ENO
Out
In
LREAL_TO_DINT
EN ENO
Out
In
LREAL_TO_LINT
EN ENO
Out
In
REAL_TO_BYTE
EN ENO
Out
In
REAL_TO_WORD
EN ENO
Out
In
LREAL_TO_DWORD
EN ENO
Out
In
LREAL_TO_LWORD
EN ENO
Out
In

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Delta DVP-15MC Series and is the answer not in the manual?

Delta DVP-15MC Series Specifications

General IconGeneral
BrandDelta
ModelDVP-15MC Series
CategoryController
LanguageEnglish

Related product manuals