6 - 15 6 - 15
6 IEC FUNCTIONS
6.1.13 Real number type (REAL) integer type (INT) conversion REAL_TO_INT
REAL_TO_INT_E
Real number type (REAL) data is converted into integer type (INT) data.
Function definition
INT REAL_TO_INT ( REAL S1 );
Argument
Argument Name
IN/OUT
Description
S1
IN
Data to be converted (real number data)
Return value
Return Value
Description
INT
Conversion result (BIN 16-bit data)
Example of use
Argument Type
ST Program
Conversion Result
Used Instruction
REAL w_Word1:=
REAL_TO_INT(w_Real1);
LD SM400
INT w_Real1
w_Word1
LD,INT
Function definition
BOOL REAL_TO_INT_E( BOOL EN, REAL S1, INT 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 (BIN 16-bit 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 integer type (INT) data, and the result is stored into
Result.
M0 := REAL_TO_INT_E( X0, rData, Result ) ;
*)
*)
*)
Содержание MELSEC L series
Страница 1: ...Programming Manual Structured Text ...
Страница 2: ......
Страница 73: ...4 33 4 33 4 ST PROGRAM EXPRESSIONS MEMO ...
Страница 297: ......