Decode; Encode - Mitsubishi Electric MELSEC Q Series Programming Manual

Structured text
Hide thumbs Also See for MELSEC Q Series:
Table of Contents

Advertisement

5 MELSEC FUNCTIONS

5.14.5 Decode

The lower n bits of the specified data are decoded.
Function definition

5.14.6 Encode

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

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec l series

Table of Contents