Converting Real To Int - Mitsubishi Electric MELSEC iQ-R Series Programming Manual

Motion module instructions, standard functions/ function blocks
Hide thumbs Also See for MELSEC iQ-R Series:
Table of Contents

Advertisement

12.30

Converting REAL to INT

REAL_TO_INT
This function converts a value from REAL data type to INT data type.
Structured text
d:=REAL_TO_INT(s);
Setting data
■Description, type, data type
Argument
Description
s (IN)
Input
d
Output
Processing details
■Operation processing
• This function converts the value input to (s) from REAL data type to INT data type, and output the converted value from (d).
(s)
1234.0
REAL
• Input a REAL data type value to (s) within the range of -32768 to 32767.
• After conversion, the first digit after the decimal point of the input value (REAL data type) is rounded off.
■Operation result
The operation processing is performed. The operation result is output from (d).
Operation error
Error code
Description
3401H
The single-precision real number input to (s) is out of the range, -32768 to 32767.
3402H
• An unusual number is input to (s).
• The single-precision real number input to (s) is not within the following range:
128
-126
-2
<(s)≤-2
(E-3.40282347+38 to E-1.17549435-38, 0, E1.17549435-38 to E3.40282347+38)
• The value set to a device or label is -0, a subnormal number, NaN (not a number), or ±∞.
(d)
1234
INT
-126
128
, 0, 2
≤(s)<2
Type
Data type
Input variable
REAL
Output variable
INT
12 TYPE CONVERSION FUNCTIONS
12.30 Converting REAL to INT
12
155

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents