Справочник Пользователя для Mitsubishi Electronics FX2NC

Скачать
Страница из 382
FX Series Programmable Controlers
Applied Instructions 5
5-44
5.5.3
ENCO (FNC 42)
Operation:
The highest active bit within the readable range has
its location noted as a numbered offset from the
source head address (S). This is stored in the
destination register (D).
Points to note:
a) The readable range is defined by the largest number storable in a binary format within the
number of destination storage bits specified by n, i.e. if n was equal to 4 bits a maximum
number within the range 0 to 15 can be written to the destination device. Hence, if bit
devices were being used as the source data, 16 bit devices would be used, i.e. the head bit
device and 15 further, consecutive devices.
b) If the stored destination number is 0 (zero) then the source head address bit is ON, i.e. the
active bit has a 0 (zero) offset from the head address. However, if NO bits are ON within the
source area, 0 (zero) is written to the destination device and an error is generated.
c) When the source device is a data or word device n must be taken from the range 1 
to 4 as
there are only 16 source bits available within a single data word.
Mnemonic
Function 
Operands
Program steps
S
D
n
ENCO
FNC 42
(Encode)
Then location of
the highest active
bit is stored as a
numerical position
from the head
address
X, Y, M, S,
T, C, D, V,
Z
T, C, D, V,
Z
K, H,
Note:
S=X, Y, M, S then
       n range=1-8
S= T,C,D then 
       n range = 1-4
n = 0, then no 
       processing
ENCO,
ENCOP:
7 steps
FX
0(S)
FX
0N
FX FX
(2C)
FX
2N(C)
FX
(2C)
FX
FX
2N(C)
FX
0N
FX
0(s)
PULSE-P
FX
(2C)
FX
FX
2N(C)
FX
0N
FX
0(s)
16 BIT OPERATION
FX
FX
0N
FX
0(s)
FX
(2C)
FX
2N(C)
32 BIT OPERATION
X5
D 10
K 3
[ S ]
[ D ]
M 10
[ n ]
ENCO
M15 M14 M13 M12 M11 M10
M16
M17
0
1
0
0
0
0
0
0
7.
6.
5.
4.
3.
2.
1.
0.
0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1
D10
4 2 1
. .
+
= 3