5 - 27 5 - 27
5 MELSEC FUNCTIONS
5.6.9 16-bit BIN 32-bit BIN conversion DBL_M
The specified BIN 16-bit data is converted into signed BIN 32-bit data.
Function definition BOOL DBL_M (BOOL EN, ANY16 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 (BIN 16-bit data)
D
OUT
Conversion result (BIN 32-bit data)
Return Value
Description
BOOL Execution
condition
Example of use
(* When execution condition X0 turns ON, the BIN 16-bit data in D0 is
*)
(* converted into signed BIN 32-bit data, and the result is stored into Result.
*)
DBL_M (X0, D0, Result);
Corresponding MELSEC command
DBL (Conversion from BIN 16-bit to BIN 32-bit data)
5.6.10 32-bit BIN 16-bit BIN conversion WORD_M
The specified BIN 32-bit data is converted into signed BIN 16-bit data.
Function definition
BOOL WORD_M (BOOL EN, ANY32 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 (BIN 32-bit data)
D OUT
Conversion result (BIN 16-bit data)
Return Value
Description
BOOL Execution
condition
Example of use
(* When execution condition X0 turns ON, the BIN 32-bit data stored in dwData1 *)
(* is converted into signed BIN 16-bit data, and the result is stored into D0.
*)
WORD_M (X0, dwData1, D0);
Corresponding MELSEC command
WORD (Conversion from BIN 32-bit to BIN 16-bit data)
For the usable data type, refer to "3.2.2
About ANY type".
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: ......