![background image](http://html.mh-extra.com/html/mitsubishi-electric/melsec-iq-f-fx5/melsec-iq-f-fx5_programming-manual_239114949.webp)
18 TYPE CONVERSION FUNCTIONS
18.37 Converting REAL to STRING
947
18
18.37
Converting REAL to STRING
REAL_TO_STRING(_E)
These functions convert REAL type data to STRING type data (exponent format).
Setting data
■
Descriptions, types, and data types
Processing details
■
Operation processing
• These functions convert the REAL type data input to (s) to STRING type (exponent format) data and output from (d).
• A value input to (s) is the REAL type data value.
• The string data obtained by conversion is output from (d) as follows:
Ladder diagram, FBD/LD
Structured text
[Without EN/ENO]
[With EN/ENO]
[Without EN/ENO]
d:=REAL_TO_STRING(s);
[With EN/ENO]
d:=REAL_TO_STRING_E(EN,ENO,s);
Argument
Description
Type
Data type
EN
Execution condition (TRUE: Execution, FALSE: Stop)
Input variable
BOOL
s(IN)
Input
Input variable
REAL
ENO
Output status (TRUE: Normal, FALSE: Abnormal)
Output variable
BOOL
d(REAL_TO_STRING(_E))
Output
Output variable
STRING(13)
• The number of digits is fixed respectively for the integer part, decimal part and exponent part as follows: Integer part: 1, decimal part: 5, exponent part: 2
• "20H (space)" is stored in the 2nd byte, "2EH (.)" is stored in the 4th byte, and "45H (E)" is stored in the 10th byte automatically.
(1): Total number of digits (13 digits)
(2): Integer part (1 digit)
(3): Decimal part (5 digits)
(4): Exponent part (2 digits)
(5): "20H (SP)" is stored.
(6): "2EH (.)" is stored.
(7): "45H (E)" is stored.
s
d
EN
ENO
d
s
Sign
(integer part)
Sign
(exponent part)
REAL
+0
+1
+2
+3
+4
+5
+6
High-order byte
Low-order byte
20H (SP)
2EH (.)
45H (E)
(d)
(s)
00H (NUL)
E
.
ASCII code for ones place of exponent part
ASCII code for tens place of exponent part
Sign data (exponent part)
Added
automatically
ASCII code for 5th decimal place
ASCII code for 3rd decimal place
ASCII code for 4th decimal place
ASCII code for 1st decimal place
ASCII code for 2nd decimal place
ASCII code for integer part
Sign data (integer part)
REAL
-12.3456
(6)
(5)
(7)
(1)
(2)
(3)
(4)
5
4
3
2
.
1
-
6 E + 0 1
(d)
(s)
Содержание MELSEC iQ-F FX5
Страница 1: ...MELSEC iQ F FX5 Programming Manual Instructions Standard Functions Function Blocks ...
Страница 2: ......
Страница 17: ...15 CONTENTS ...
Страница 24: ...22 MEMO ...
Страница 25: ...23 PART 1 PART 1 OVERVIEW Part 1 consists of the following chapter 1 OVERVIEW 2 PRECAUTIONS ON PROGRAMMING ...
Страница 126: ...124 6 SEQUENCE INSTRUCTIONS 6 3 Output Instructions Operation error There is no operation error ...
Страница 132: ...130 6 SEQUENCE INSTRUCTIONS 6 3 Output Instructions Operation error There is no operation error ...
Страница 140: ...138 6 SEQUENCE INSTRUCTIONS 6 3 Output Instructions Operation error There is no operation error ...
Страница 191: ...7 BASIC INSTRUCTIONS 7 2 Arithmetic Operation Instructions 189 7 Operation error There is no operation error ...
Страница 202: ...200 7 BASIC INSTRUCTIONS 7 2 Arithmetic Operation Instructions Operation error There is no operation error ...
Страница 278: ...276 7 BASIC INSTRUCTIONS 7 4 Bit Processing Instructions Operation error There is no operation error ...
Страница 280: ...278 7 BASIC INSTRUCTIONS 7 4 Bit Processing Instructions Operation error There is no operation error ...
Страница 915: ...18 TYPE CONVERSION FUNCTIONS 18 13 Converting DWORD to WORD 913 18 Operation error There is no operation error ...
Страница 917: ...18 TYPE CONVERSION FUNCTIONS 18 14 Converting DWORD to INT 915 18 Operation error There is no operation error ...
Страница 932: ...930 18 TYPE CONVERSION FUNCTIONS 18 26 Converting DINT to WORD Operation error There is no operation error ...
Страница 1050: ...1048 26 TIME DATA FUNCTIONS 26 4 Division MEMO ...
Страница 1068: ...1066 29 COUNTER FUNCTION BLOCKS 29 4 Counter Function Block Operation error There is no error ...
Страница 1107: ...I 1105 MEMO ...
Страница 1111: ......