Enco, Encop - Mitsubishi MELSEC-Q/L Programming Manual

Table of Contents

Advertisement

Program Example
(1) The following program decodes the 3 bits from X0 and stores the results at M10 when X20 is ON.
[Ladder Mode]
[Operation]
X2
0 0
1
0
0
0
0
If 3 bits are designated as significant bits, 8 points are occupied.
7.5.4

ENCO, ENCOP

Encoding from 256 to 8 bits
7.5.4
ENCO, ENCOP
ENCO
ENCOP
: Head number of the device where the data to be encoded is stored (Device name)
S
: Number of the device where the encoding result will be stored (BIN 16 bits)
D
n
: Valid bit length (1 to 8), 0: No processing (BIN 16 bits)
Setting
Internal Devices
Data
Bit
S
D
n
Function
(1) Stores the binary value corresponding to the bits which are "1" included in the 2
(2) The value of n can be designated at between 1 and 8.
(3) If n
0, there will be no operation, and the contents of
(4) Bit devices are treated as 1 bit, and word devices as 16 bits.
(5) If more than 1 bit is at 1, processing will be conducted at the upper bit location.
[List Mode]
Step
X1
X0
1
0
When 6 is designated at X0 to X2
M17
M10
0
1
0
0
0
0
0
0
Command
Command
R, ZR
Word
Bit
8
7
6
5 4 3 2 1 0
0
0
1 0 0 0 0 0 0
S
Instruction
Device
Decoding result
High
Basic
performance
ENCO
S
ENCOP
S
J
\
U
\G
Word
––
n
-bit data of
D
1 1 0
(Binary value = 6)
will not change.
D
ENCO, ENCOP
Process
LCPU
Redundant Universal
n
D
n
D
Constants
Zn
Other
K, H
––
––
––
––
––
to
.
S
D
1
2
3
4
4
6
7
8
359

Advertisement

Table of Contents
loading

Table of Contents