5 - 28 5 - 28
5 MELSEC FUNCTIONS
5.6.11 BIN gray code conversion GRY_M
The specified BIN 16-bit data is converted into gray code 16-bit data.
Function definition
BOOL GRY_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 (BIN 16-bit data)
D
OUT
Conversion result (gray code 16-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 gray code 16-bit data, and the result is stored into D100.
*)
GRY_M (X0, D0, D100);
Corresponding MELSEC command
GRY (Conversion from BIN 16-bit data to Gray code)
5.6.12 32-bit BIN gray code conversion DGRY_M
The specified BIN 32-bit data is converted into gray code 32-bit data.
Function definition
BOOL DGRY_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 (BIN 32-bit data)
D OUT
Conversion result (gray code 32-bit data)
Return Value
Description
BOOL Execution
condition
Example of use
(* When execution condition X0 turns ON, the BIN 32-bit data in dwData1 is
*)
(* converted into gray code 32-bit data, and the result is stored into Result.
*)
DGRY_M (X0, dwData1 Result);
Corresponding MELSEC command
DGRY (Conversion from BIN 32-bit data to Gray code)
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: ......