6 - 16 6 - 16
6 IEC FUNCTIONS
6.1.14 Real number type (REAL) character string type (STRING) conversion REAL_TO_STR
REAL_TO_STR_E
Real number type (REAL) data is converted into character string type data.
Function definition
STRING(14) REAL_TO_STR ( REAL S1);
Argument
Argument Name
IN/OUT
Description
S1
IN
Data to be converted (real number data)
Return value
Return Value
Description
STRING (14)
Conversion result (character string data)
Note: The display format of the ESTR instruction is the Exponent format, the total
number of digits is 13, and the number of fraction part digits is 5.
Example of use
Argument Type
ST Program
Conversion Result
Used Instruction
REAL
w_Str1:= REAL_TO_STR(w_Real1 ); LD
SM400
MOV K1
D10237
MOV K13
D10238
MOV K5
D10239
ESTR w_Real1
D10237
w_Str1
LD,MOV,ESTR
Function definition
BOOL REAL_TO_STR _E( BOOL EN, REAL S1, STRING(14) 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 (real number data)
D1
OUT
Conversion result (character string data)
Return value
Return Value
Description
BOOL Execution
condition
Example of use
(*
(*
(*
When execution condition X0 turns ON, the real number type (REAL) data in
rData is converted into character string type data, and the result is stored into
Result.
M0 := REAL_TO_STR_E( X0, rData, 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: ......