Floating-Point Bin Conversion; 32-Bit Floating-Point Bin Conversion - Mitsubishi Electric MELSEC Q Series Programming Manual

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

Advertisement

5 MELSEC FUNCTIONS
5.6.5 Floating-point
The specified real number data is converted into BIN 16-bit data.
Function definition BOOL INT_E_MD (BOOL EN, REAL S1, ANY16 D);
5.6.6 32-bit floating-point
The specified real number data is converted into BIN 32-bit data.
Function definition
5 - 25
BIN conversion
Argument Name
EN
S1
D
Remarks: The real number data specified in argument "S1" can be specified within the
range -32768 to 32767.
The data after conversion is the value obtained by rounding off the real
number in the first decimal place.
Return Value
BOOL
Execution condition
Example of use
(* When execution condition X0 turns ON, the real number data in RealData1 is *)
(* converted into BIN 16-bit data, and the result is stored into D0.
INT_E_MD (X0, RealData1, D0);
Corresponding MELSEC command
INT (Conversion from floating decimal point data to BIN16-bit data (Single
precision))
BIN conversion
BOOL DINT_E_MD (BOOL EN, REAL S1, ANY32 D);
Argument Name
EN
S1
D
Remarks: The real number data specified in argument "S1" can be specified within the
range -2147483648 to 2147483647.
The data after conversion is the value obtained by rounding off the real
number in the first decimal place.
Return Value
BOOL
Execution condition
Example of use
(* When execution condition X0 turns ON, real number data E2.6 is converted
(* into BIN 32-bit data, and the result is stored into Result.
DINT_E_MD (X0, E2.6, Result);
Corresponding MELSEC command
DINT (Conversion from floating decimal point data to BIN32-bit data (Single
precision))
INT_E_MD
IN/OUT
Execution condition (Function is executed only when the
IN
result is TRUE)
IN
Data to be converted (real number data)
OUT
Conversion result (BIN 16-bit data)
DINT_E_MD
IN/OUT
Execution condition (Function is executed only when the
IN
result is TRUE)
Data to be converted (real number data)
IN
Conversion result (BIN 32-bit data)
OUT
For the usable data type, refer to "3.2.2
About ANY type".
Description
Description
Description
Description
*)
*)
*)
5 - 25

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec l series

Table of Contents