5 Applied Functions
5.1 Type Conversion Functions
84
FXCPU Structured Programming Manual
(Application Functions)
5.1.25 REAL_TO_STR(_E)
Outline
This function converts float (single precision) data into string data, and outputs the data obtained by
conversion.
1. Format
*1.
Output variable
2. Set data
In explanation of functions, I/O variables inside ( ) are described.
Explanation of function and operation
1) This function converts float (single precision) data stored in a device specified in
into string
(exponent) data, and outputs the data obtained by conversion to a device specified in
.
FX
3U(C)
FX
3G
FX
2N(C)
FX
1N(C)
FX
1S
FX
U
/FX
2C
FX
0N
FX
0(S)
Function name
Expression in each language
Structured ladder
ST
REAL_TO_STR
REAL_TO_STR(_REAL);
Example:
Label 2:=
REAL_TO_STR(Label 1);
REAL_TO_STR_E
REAL_TO_STR_E(EN,_REAL,
Output label);
Example:
REAL_TO_STR_E(X000, Label 1,
Label 2);
Variable
Description
Data type
Input
variable
EN
Execution condition
Bit
_REAL (
)
Conversion source float (single precision) data
FLOAT (Single Precision)
Output
variable
ENO
Execution status
Bit
*1
(
)
String data after conversion
String
REAL_TO_STR
_REAL
*1
Label 2
Label 1
REAL_TO_STR_E
EN
ENO
*1
Label 2
X000
Label 1
_REAL
s
d
s
d
Float
(single
precision)
data
ASCII code
for integer part
ASCII code
for 1st decimal place
ASCII code (2EH)
for decimal point (.)
ASCII code
for 2nd decimal place
ASCII code
for 4th decimal place
45H(E)
20H (space)
ASCII code for tens
place of exponent part
ASCII code
for 3rd decimal place
ASCII code
for 5th decimal place
ASCII code for ones
place of exponent part
High-order byte
Sign data (integer part)
Sign data
(exponent part)
Low-order byte
00H
Automatically stored at the end of the character string
String
1st word
2nd word
3rd word
4th word
5th word
6th word
7th word
E
Sign (exponent part)
Sign
(integer part)
Added
automatically
.
Содержание 09R927
Страница 2: ......
Страница 234: ...232 FXCPU Structured Programming Manual Application Functions Revision History MEMO ...