Mitsubishi Electric MELSEC iQ-R Series Programming Manual page 1854

Hide thumbs Also See for MELSEC iQ-R Series:
Table of Contents

Advertisement

• Input a REAL data type value to (s).
• The converted string data is output from (d) as follows.
• The number of digits for an integral part, decimal part, and exponent is fixed, integral part: one digit; decimal part: five digits; exponent: two digits.
• As the second byte, 20H (space) is stored; as the fourth byte, 2EH (.) is stored; and as the 10th byte, 45H (E) is stored automatically.
(s)
-12.3456
REAL type
• As sign data (for integral part), 20H (space) is stored if the input value is positive, and 2DH (-) is stored if the input value is negative.
• The sixth and later digits of the decimal part are rounded off.
(s)
-12.345678
REAL type
• If the number of digits in the input value is less than the number of significant digits, 30H (0) is stored in the decimal part.
(s)
-12.34
REAL type
• As sign data (for exponent), 2BH (+) is stored if the input value is positive, and 2DH (-) is stored if the input value is negative.
• When the exponent is one digit, 30H (0) is stored in the tens place of the exponent.
(s)
-12.3456
REAL type
• The NULL code (00H) is automatically stored at the end (i.e. seventh word) of the converted string.
25 TYPE CONVERSION FUNCTIONS
1852
25.43 Converting REAL to STRING
(d)
Total number of digits (13)
Integral
Decimal
part (1)
part (5)
-
1 . 2 3 4 5
6
Filled with 2EH (.).
Filled with 20H (space).
(d)
Total number of digits (13)
7
-
1 . 2 3 4 5
6 6
Number of digits
in the decimal part (5)
(d)
Total number of digits (13)
-
1 . 2 3 4 0
0
Number of digits in the decimal part (5)
(d)
Total number of digits (13)
Number of digits in the exponent part (2)
-
1 . 2 3 4 5
6
Exponent
part (2)
E
+
0
1
Filled with 45H (E).
7
8
E
+
0
1
Rounded off.
E
+
0
1
Filled with 30Hs (0s).
E
+
0
1
Filled with 30H (0).

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents