Str_To_Real(_E) - Mitsubishi Electric MELSEC FX Series Structured Programming Manual

Hide thumbs Also See for MELSEC FX Series:
Table of Contents

Advertisement

FXCPU Structured Programming Manual
(Application Functions)

5.1.39 STR_TO_REAL(_E)

Outline
This function converts string data into float (single precision) data, and outputs the data obtained by
conversion.
1. Format
Function name
STR_TO_REAL
STR_TO_REAL_E
*1.
Output variable
2. Set data
Variable
EN
Input
variable
_STRING (
ENO
Output
variable
*1
In explanation of functions, I/O variables inside ( ) are described.
Explanation of function and operation
1) This function converts string data (in the decimal format or exponent format) stored in a device specified
in
into float (single precision) data, and outputs the data obtained by conversion to a device specified
s
in
.
d
String
1st word
2nd word
3rd word
4th word
5th word
6th word
7th word
2) The conversion source string data can be in the decimal format or exponent format.
a) In the case of decimal format
String
FX
3U(C)
Expression in each language
Structured ladder
STR_TO_REAL
Label 1
_STRING
X000
STR_TO_REAL_E
EN
ENO
Label 1
_STRING
Execution condition
Conversion source string data
)
s
Execution status
Float (single precision) data after conversion
(
)
d
High-order byte
ASCII code for 1st character
ASCII code for 3rd character ASCII code for 2nd character
ASCII code for 5th character
ASCII code for 7th character
ASCII code for 9th character
ASCII code for 11th character
0000H (Indicates the end of the character string.)
High-order byte
31H (1)
1st word
2nd word
33H (3)
30H (0)
3rd word
34H (4)
4th word
5th word
- 1 . 3 5 0 3 4
FX
3G
FX
2N(C)
FX
1N(C)
ST
STR_TO_REAL(_STRING);
Example:
Label 2:=
*1
Label 2
STR_TO_REAL(Label 1);
STR_TO_REAL_E(EN,_STRING,
Output label);
Example:
STR_TO_REAL_E(X000, Label 1,
*1
Label 2
Label 2);
Description
Low-order byte
Sign data
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)
0000H
5 Applied Functions
5.1 Type Conversion Functions
FX
1S
FX
U
/FX
2C
FX
0N
Data type
Bit
String
Bit
FLOAT (Single Precision)
Float (single precision) data
-1.35034
Float (single precision)
data
1
FX
0(S)
2
3
4
5
6
A
113

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Fx-kp-ok-e09r927

Table of Contents