Chapter 16 PLC Function ApplicationsC2000-HS
16-73
API
DECO
S D
n
Decoder
41
D P
Bit device Word device
16-bit command (7 STEP)
DECO Continuous
execution type
DECOP Pulse
execution type
32-bit command (13 STEP)
DDECO Continuous
execution type
DDECOP Pulse
execution type
Flag signal: none
X Y M K H KnX KnY KnM T C D
S * * * * * * * *
D * * * * * * *
n * *
Notes on operand usage: none
S
: Decoding source device.
D
: Device that saves the decoding result.
n
: Length of decoding bit.
Decodes with the lower “n” bit, and saves the length of “2
n
” bit in D.
This command usually uses pulse execution type command (DECOP).
When D is the bit device, n = 1–8, when D is the word device, n = 1–4.
When Dis the bit device, the valid range of n is 0< n ≦8. If n = 0 or n > 8, a fault
will occur.
When n = 8, the maximum decoding will be 2
8
= 256 points.
When M200 switches from Off to On, the content of X0–X2 is decoded to
M100–M107.
If S = 3, M103 (the third digit starting from M100) = On.
When the command is executed, M200 turns to Off. The ones that are decoded
and outputted act as usual.
DECOP X0 K3M100
M200
X2 X1 X0
M107 M106 M105 M104 M103 M102 M101 M100
011
1
0000 000
3
76 54 210
4 12
3
When D is word device, the valid range of n is 0< n ≦4. If n = 0 or n > 4, the fault
occurs.
When n = 4, the maximum decoding will be 2
4
= 16 points.
When M200 switches from Off to On, the content of D10 (b2–b0) is decoded to
D20 (b7–b0). The unused digits (b15–b8) of D20 become 0.
The lower 3 digits of D10 are decoded and saved in the lower 8 digits of D20, the
upper 8 digits are 0.
When the command is executed, M200 turns to Off. The ones that are decoded
and outputted act as usual.
DECOP D10 K3D20
M200