Справочник Пользователя для Mitsubishi Electronics Mitsubishi Digital Electronics Welding System FXCPU

Скачать
Страница из 236
5 Applied Functions
5.1 Type Conversion Functions
113
FXCPU Structured Programming Manual
(Application Functions)
1
O
utlin
e
2
Function Li
st
3
Functi
on 
Cons
tructi
on
4
Ho
w t
o R
ea
Explanati
on of 
Func
tions
5
Appl
ie
Functions
6
Stan
dard 
Functi
on
 Blocks
A
Correspondence 
be
tw
een Dev
ice
an
d A
ddres
ses
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
*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 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
in .
2) The conversion source string data can be in the decimal format or exponent format.
a) In the case of decimal format
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
STR_TO_REAL
STR_TO_REAL(_STRING);
Example:
Label 2:=
STR_TO_REAL(Label 1);
STR_TO_REAL_E
STR_TO_REAL_E(EN,_STRING,
Output label);
Example:
STR_TO_REAL_E(X000, Label 1,
Label 2);
Variable
Description
Data type
Input
variable
EN
Execution condition
Bit
_STRING (
)
Conversion source string data
String
Output
variable
ENO
Execution status
Bit
*1
(
)
Float (single precision) data after conversion
FLOAT (Single Precision)
STR_TO_REAL
_STRING
*1
Label 1
Label 2
STR_TO_REAL_E
EN
ENO
*1
Label 2
X000
Label 1
_STRING
s
d
s
d
ASCII code for 1st character
High-order byte
ASCII code for 3rd character ASCII code for 2nd character
ASCII code for 4th character
ASCII code for 5th character
ASCII code for 7th character
ASCII code for 9th character
ASCII code for 11th character
ASCII code for 8th character
ASCII code for 6th character
ASCII code for 10th character
Sign data
Low-order byte
String
1st word
2nd word
3rd word
4th word
5th word
6th word
7th word
0000H (Indicates the end of the character string.)
Float (single precision) data
31H (1)
High-order byte
33H (3)
2EH (.)
35H (5)
30H (0)
34H (4)
33H (3)
-1.35034
2DH (-)
Low-order byte
String
1st word
2nd word
3rd word
4th word
5th word
Float (single precision)
data
0000H
- 1
. 3 5 0 3 4