6 - 20 6 - 20
6 IEC FUNCTIONS
6.1.18 Character string type (STRING) real number type (REAL) conversion STR_TO_REAL
STR_TO_REAL_E
Character string type (STRING) data is converted into real number type (REAL) data.
Function definition
REAL STR_TO_REAL ( STRING(24) S1 );
Argument
Argument Name
IN/OUT
Description
S1
IN
Data to be converted (character string data)
Return value
Return Value
Description
REAL
Conversion result (real number data)
Remarks:
Example of use
Argument Type
ST Program
Conversion Result
Used Instruction
STRING w_Real1:=
STR_TO_REAL(w_Str1);
LD SM400
EVAL w_Str1
w_Real1
LD,EVAL
Function definition
BOOL STR_TO_REAL _E( BOOL EN, STRING(24) S1, REAL D1 );
Argument
Argument Name
IN/OUT
Description
EN
IN
Execution condition (Function is executed only when the result is TRUE)
S1
IN
Data to be converted (character string data)
D1
OUT
Conversion result (real number data)
Return value
Return Value
Description
BOOL Execution
condition
Example of use
(*
(*
(*
When execution condition X0 turns ON, the character string type data in
sData is converted into real number type (REAL) data, and the result is stored
into Result.
M0 := STR_TO_REAL_E( X0, sData, Result ) ;
*)
*)
*)
Summary of Contents for MELSEC L series
Page 1: ...Programming Manual Structured Text ...
Page 2: ......
Page 73: ...4 33 4 33 4 ST PROGRAM EXPRESSIONS MEMO ...
Page 297: ......