6 - 12 6 - 12
6 IEC FUNCTIONS
6.1.10 Integer type (INT) real number type (REAL) conversion INT_TO_REAL
INT_TO_REAL_E
Integer type (INT) data is converted into real number type (REAL) data.
Function definition
REAL INT_TO_REAL ( INT S1 );
Argument
Argument Name
IN/OUT
Description
S1
IN
Data to be converted (BIN 16-bit data)
Return value
Return Value
Description
REAL
Conversion result (real number data)
Example of use
Argument Type
ST Program
Conversion Result
Used Instruction
INT w_Real1:=
INT_TO_REAL( D0 );
LD SM400
FLT D0
w_Real1
LD,FLT
Function definition
BOOL INT_TO_REAL_E( BOOL EN, INT 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 (BIN 16-bit 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 integer type (INT) data in iData is
converted into real number type (REAL) data, and the result is stored into
Result.
M0 := INT_TO_REAL_E( X0, iData, 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: ......