5 - 29 5 - 29
5 MELSEC FUNCTIONS
5.6.13 Gray code BIN conversion GBIN_M
The specified gray code 16-bit data is converted into BIN 16-bit data.
Function definition BOOL GBIN_M (BOOL EN, ANY16 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 (gray code 16-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 gray code 16-bit data in D100 is *)
(* converted into BIN 16-bit data, and the result is stored into D200.
*)
GBIN_M (X0, D100, D200);
Corresponding MELSEC command
GBIN (Conversion of Gray code to BIN 16-bit data)
5.6.14 32-bit gray code BIN conversion DGBIN_M
The specified gray code 32-bit data is converted into BIN 32-bit data.
Function definition
BOOL DGBIN_M (BOOL EN, ANY32 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 (gray code 32-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 gray code 32-bit data in dwData1 *)
(* is converted into BIN 32-bit data, and the result is stored into Result.
*)
DGBIN_M (X0, dwData1, Result);
Corresponding MELSEC command
DGBIN (Conversion of Gray code to BIN 32-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: ......