Real Number Type (Real) Character String Type (String) Conversion - Mitsubishi Electric MELSEC Q Series Programming Manual

Structured text
Hide thumbs Also See for MELSEC Q Series:
Table of Contents

Advertisement

6 IEC FUNCTIONS

6.1.14 Real number type (REAL) character string type (STRING) conversion

Real number type (REAL) data is converted into character string type data.
Function definition
Function definition
6 - 16
STRING(14) REAL_TO_STR ( REAL S1);
Argument
Argument Name
IN/OUT
S1
IN
Return value
Return Value
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
REAL
w_Str1:= REAL_TO_STR(w_Real1 ); LD
BOOL REAL_TO_STR _E( BOOL EN, REAL S1, STRING(14) D1 );
Argument
Argument Name
IN/OUT
EN
IN
S1
IN
D1
OUT
Return value
Return Value
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 ) ;
Data to be converted (real number data)
Description
ST Program
MOV
MOV
MOV
ESTR
Execution condition (Function is executed only when the result is TRUE)
Data to be converted (real number data)
Conversion result (character string data)
Description
REAL_TO_STR
REAL_TO_STR_E
Description
Conversion Result
Used Instruction
SM400
LD,MOV,ESTR
K1 D10237
K13 D10238
K5 D10239
w_Real1 D10237
w_Str1
Description
*)
*)
*)
6 - 16

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec l series

Table of Contents