Real Number Type (Real) Integer Type (Int) 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.13 Real number type (REAL)
Real number type (REAL) data is converted into integer type (INT) data.
Function definition
Function definition
6 - 15
integer type (INT) conversion
INT REAL_TO_INT ( REAL S1 );
Argument
Argument Name
IN/OUT
S1
IN
Return value
Return Value
INT
Conversion result (BIN 16-bit data)
Example of use
Argument Type
REAL
w_Word1:=
REAL_TO_INT(w_Real1);
BOOL REAL_TO_INT_E( BOOL EN, REAL S1, INT 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 integer type (INT) data, and the result is stored into
(*
Result.
M0 := REAL_TO_INT_E( X0, rData, Result ) ;
Data to be converted (real number data)
ST Program
Conversion Result
LD
INT
Execution condition (Function is executed only when the result is TRUE)
Data to be converted (real number data)
Conversion result (BIN 16-bit data)
REAL_TO_INT
REAL_TO_INT_E
Description
Description
Used Instruction
SM400
LD,INT
w_Real1
w_Word1
Description
Description
*)
*)
*)
6 - 15

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec l series

Table of Contents