3 . I n s t r u c t i o n S e t
M N050 03003E F or mo re infor ma tio n vi sit:
w w w. e a t o n . c o m
3-95
API Mnemonic
Operands
Function
41
DECO P
S, D, n
Decode
Bit Devices
Word devices
Program Steps
Type
OP
X Y M S K H KnX KnY KnM KnS T
C D E
F
S
*
*
*
*
*
* *
*
*
*
*
D
*
*
*
*
*
*
*
*
n
*
*
DECO, DECOP: 7 steps
ELC ELCB
ELCM
PB PC/PA/PH
PV
PB PH/PA
32 16
P
32 16
P
32 16
P 32 16 P 32 16
P
Operands:
S
: Source to decode
D
: Destination
n
: Number of bits to decode
Description:
1. Decodes the lower “
n
” bits of source
S
and stores the result of “2
n
” bit in
D
.
2. This instruction works best with the pulse instruction (DECOP).
3. When
operand
D
is a bit device,
n
=1~8, when operand
D
is a word device,
n
=1~4
Program Example 1:
1.
n
valid range: 0<
n
≦
8. But if
n
=0 or
n
>8, an error will occur.
2. If
n
= 8, the decoded data is 2
8
= 256 bits of data.
3. When X20 goes from OFF
→
ON, the data of X0~X2 will be decoded to M100~M107.
4. If the source data is 3, M103 (third bit from M100) = ON.
5. After the execution is completed, X20 is changed to OFF. The result in M103 remains.
DECOP
X0
K3
M100
X20
X2
X1
X0
M107 M106 M105 M104 M103 M102 M101 M100
0
1
1
1
0
0
0
0
0
0
0
3
7
6
5
4
2
1
0
4
1
2
3
Содержание ELC-PB
Страница 1: ......
Страница 5: ...For more information visit www eaton com MN05003003E iv...
Страница 29: ...ELC Programming Manual For more information visit www eaton com MN05003003E 1 24 MEMO...
Страница 502: ...3 Instruction Set MN05003003E For more information visit www eaton com 3 333...
Страница 601: ...ELC Programming Manual For more information visit www eaton com MN05003003E 3 432...
Страница 625: ...ELC Programming Manual For more information visit www eaton com MN05003003E 3 456...