Download Print this page

Converting Real To String - Mitsubishi Electric MELSEC iQ-F FX5 Programming Manual

Instructions, standard functions/function blocks
Hide thumbs Also See for MELSEC iQ-F FX5:

Advertisement

18.37

Converting REAL to STRING

REAL_TO_STRING(_E)
These functions convert REAL type data to STRING type data (exponent format).
Ladder diagram, FBD/LD
[Without EN/ENO]
s
d
Setting data
■Descriptions, types, and data types
Argument
Description
EN
Execution condition (TRUE: Execution, FALSE: Stop)
s(IN)
Input
ENO
Output status (TRUE: Normal, FALSE: Abnormal)
d(REAL_TO_STRING(_E))
Output
Processing details
■Operation processing
• These functions convert the REAL type data input to (s) to STRING type (exponent format) data and output from (d).
(s)
REAL
E
.
Sign
Sign
(integer part)
(exponent part)
Added
automatically
• A value input to (s) is the REAL type data value.
• The string data obtained by conversion is output from (d) as follows:
• 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.
(s)
-12.3456
-
REAL
(5)
(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.
[With EN/ENO]
EN
ENO
s
d
High-order byte
20H (SP)
2EH (.)
ASCII code for 2nd decimal place
ASCII code for 4th decimal place
45H (E)
ASCII code for tens place of exponent part
00H (NUL)
(d)
(1)
(2)
(3)
(4)
1
.
2
3
4
5
6 E + 0 1
(6)
(7)
Structured text
[Without EN/ENO]
d:=REAL_TO_STRING(s);
[With EN/ENO]
d:=REAL_TO_STRING_E(EN,ENO,s);
Type
Input variable
Input variable
Output variable
Output variable
(d)
Sign data (integer part)
ASCII code for integer part
ASCII code for 1st decimal place
ASCII code for 3rd decimal place
ASCII code for 5th decimal place
Sign data (exponent part)
ASCII code for ones place of exponent part
18 TYPE CONVERSION FUNCTIONS
18.37 Converting REAL to STRING
Data type
BOOL
REAL
BOOL
STRING(13)
Low-order byte
18
+0
+1
+2
+3
+4
+5
+6
947

Hide quick links:

Advertisement

loading