5 Applied Instructions and Basic Usage
DVP-20PM Application Manual
5-60
API
Applicable model
20PM
41
DECO
P
P
Decoder
Bit device Word device
X Y M S K H KnX KnY KnM KnS T C D V Z
S
* * * * * *
* * * * *
D
* * *
* * * * *
n
* *
Note: The instruction supports V devices and Z devices. (If the 16-bit
instruction is used, Z devices can not be used. If the 32-bit
instruction is used, V devices can not be used.)
Please refer to specifications for more information about device
ranges.
16-bit instruction (7 steps)
DECO
Continuity
instruction
DECO P
Pulse
instruction
32-bit instruction
- - - -
Flag: None
Explanation
S: Source device; D: Device in which a decoding result is stored n: Number of
bits which are decoded
The low n bits in S are decoded as the low 2
n
bits in D.
Generally, the pulse instruction DECOP is used.
D is in the range of 1 to 8.
Example 1
If n is 8, the maximum n
umber of bits which can be decoded is 2
8
=256.
When D is a bit device, n is in the range of 1 to 8. If n is 0, or greater than 8, an
error will occur.
When X20 i
s turned from OFF to ON, the instruction DECOP decodes X0~X2
as M100~M107.
If the value in S is 3, M103 will be ON.
After the instruciton is executed, X20 will be OFF, and the states of
M100~M107 will remain unchanged.
DECOP X0 K3M100
X20
X2 X1 X0
M107 M106 M105 M104 M103 M102 M101 M100
011
1
0000 000
3
76 54 210
4 12
3
Example 2
If n is 8, the maximum n
umber of bits which can be decoded is 2
8
=256.
When D is a word device, n is in the range of 1 to 8. If n is 0, or greater than 8,
an error will occur.
When X20 i
s turned from OFF to ON, the instruction DECOP decodes b2~b0 in
D10 as b7~b0 in D20, and b15~b8 in D20 become 0.
The low 3 bits in D10 are decoded as the low 8 bits in D20. The high 8 bits in
D20 are 0.
After the instruciton is executed, X20 will be OFF, and the value in D20 will
remain unchanged.
DECOP D10 K3D20
X20