5 - 61 5 - 61
5 MELSEC FUNCTIONS
5.14.5 Decode DECO_M
The lower n bits of the specified data are decoded.
Function definition
BOOL DECO_M (BOOL EN, ANY_SIMPLE S1, ANY16 n, ANY_SIMPLE D);
Argument Name
IN/OUT
Description
EN IN
Execution condition (Function is executed only when the
result is TRUE)
S1
IN
Data to be decoded
n
IN
Valid bit length (1 to 8) *0: No processing (BIN 16-bit data)
D OUT
Decode
result
Remarks: The DINT, REAL and STRING types cannot be used in arguments S1" and
"D".
Return Value
Description
BOOL Execution
condition
Example of use
(* When execution condition X0 turns ON, the lower Bit Size bits of D100 are
*)
(* decoded, and the decode result is stored into 2
BitSize
bits, starting at Result.
*)
DECO_M (X0, D100, BitSize, Result)
Corresponding MELSEC command
DECO (8 256 bits decode)
For the usable data type, refer to "3.2.2 About
ANY type".
5.14.6 Encode ENCO_M
2
n
bits of data, starting at the specified data, are encoded.
Function definition
BOOL ENCO_M (BOOL EN, ANY_SIMPLE S1, ANY16 n, 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 encoded
n
IN
Valid bit length (1 to 8) *0: No processing (BIN 16-bit data)
D OUT
Encode
result
Remarks: The DINT, REAL and STRING types cannot be used in argument S1".
Return Value
Description
BOOL Execution
condition
Example of use
(* When execution condition X0 turns ON, 2
BitSize
bits, starting at D100, are
*)
(* encoded, and the result is stored into Result.
*)
ENCO (X0, D100, BitSize, Result);
Corresponding MELSEC command
ENCO (256 8 bits decode)
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: ......