5 - 25 5 - 25
5 MELSEC FUNCTIONS
5.6.5 Floating-point BIN conversion INT_E_MD
The specified real number data is converted into BIN 16-bit data.
Function definition BOOL INT_E_MD (BOOL EN, REAL S1, ANY16 D);
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)
D
OUT
Conversion result (BIN 16-bit data)
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
Description
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))
5.6.6 32-bit floating-point BIN conversion DINT_E_MD
The specified real number data is converted into BIN 32-bit data.
Function definition
BOOL DINT_E_MD (BOOL EN, REAL S1, ANY32 D);
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)
D OUT
Conversion result (BIN 32-bit data)
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
Description
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))
For the usable data type, refer to "3.2.2
About ANY type".
Содержание MELSEC L series
Страница 1: ...Programming Manual Structured Text ...
Страница 2: ......
Страница 73: ...4 33 4 33 4 ST PROGRAM EXPRESSIONS MEMO ...
Страница 297: ......