Download Print this page

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

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

Advertisement

18.47

Converting STRING to REAL

STRING_TO_REAL(_E)
These functions convert STRING type data to REAL type data.
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(STRING_TO_REAL(_E))
Output
Processing details
■Operation processing
• These functions convert the STRING type (in the decimal format or exponent format) data input to (s) to REAL type data
and output from (d).
High-order byte
+0
ASCII code for 1st character
+1
ASCII code for 3rd character
+2
ASCII code for 5th character
+3
ASCII code for 7th character
+4
ASCII code for 9th character
+5
ASCII code for 11th character
+6
• The conversion source STRING type data can be in the decimal format or exponent format.
• Decimal point format
High-order byte
+0
31H (1)
+1
33H (3)
+2
30H (0)
+3
34H (4)
+4
[With EN/ENO]
EN
ENO
s
d
(s)
00H (Indicates the end of the character string.)
(s)
00H
-
1
.
3
5
0
3
4
Structured text
[Without EN/ENO]
d:=STRING_TO_REAL(s);
[With EN/ENO]
d:=STRING_TO_REAL_E(EN,ENO,s);
Type
Input variable
Input variable
Output variable
Output variable
Low-order byte
Sign data
ASCII code for 2nd character
ASCII code for 4th character
ASCII code for 6th character
ASCII code for 8th character
ASCII code for 10th character
Low-order byte
2DH (-)
2EH (.)
35H (5)
33H (3)
18 TYPE CONVERSION FUNCTIONS
18.47 Converting STRING to REAL
18
Data type
BOOL
STRING(24)
BOOL
REAL
(d)
REAL
(d)
-1.35034
REAL
961

Hide quick links:

Advertisement

loading