Chapter 6 Instruction and Flag List
XBC E-Type Main Unit
6-203
Ver. 1
6.32.3 ENCO, ENCOP
Instruction
Area Available
Step
Flag
P M K
F
L
T
C
S
Z D.x R.x
Con
st
U
N
D
R
Error
(F110)
Zero
(F111)
Carry
(F112)
ENCO(P)
S
O O O O O O O
-
O
-
-
O O O O O
4~6
O
O
-
D
O O O
-
O O O
-
O
-
-
O O O O O
N
O O O
-
O O O
-
O
-
-
O O O O O
Operand
Description
Data Type
S
Data or address to perform ENCO operation
WORD
D
Address to save operation result in
WORD
N
Available multipliers of bits to encode are 1 ~ 8
WORD
[Flag Setting]
Flag
Description
Device Number
Error
If effective number of bits N is other than 0 ~ 8
If effective number of bits starting from S exceeds device area
F110
Zero
If effective 2
N
data is Zero.
F111
1) ENCO (Encode)
(1) Saves the result of the highest position of 1 made Hexadecimal among effective 2
N
data saved in S Device,
in specified device D.
(2) S, if input with constant, will be encoded in the input variable area although N’s value exceeds 4 (Searched
number of bits is 16).
(3) If N is 0, D will not be changed.
(4) Saves the result of the highest contact point position of 1 made Hexadecimal in 2
N
area, in D.
2) Program Example
(1) For P1000=h4321 and P1200=h0004, if Input Signal is changed from Off to On status, h000E is saved
in P1100.
ENCOP P1000 P1100 P1200
P00000
ENCO
means ENCO
P S
D
ENCOP
S
D
N
N
b15
b8
b0
b7
b15
b8
b0
b7
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
P0002
P0001
b15
b8
b0
b7
0
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
P0012
2
5
bits
5
bits
Summary of Contents for XBC-DN10E
Page 1: ......
Page 10: ...Table of Contents Table of Contents 6 10 10 CLEAR ALL PLC 29...