B-63983EN/02 4.LADDER LANGUAGE
- 305 -
4.9.6 DECB (Binary Decoding: SUB 25)
DECB decodes one, two, or four-byte binary code data. When one of
the specified eight consecutive numbers matches the code data, a
logical high value (value 1) is set in the output data bit which
corresponds to the specified number. When these numbers do not
match, a logical low value (value 0) is set.
Use this instruction for decoding data of the M or T function.
There are two specifications - basic specification and extended
specification - for setting the format specification parameter in the
DECB instruction. The extended specification allows 8n consecutive
values to be decoded at a time. For the details of the setting of a format
specification parameter, see the description of parameters.
Format
SUB 25
DECB
7
Decode designating
number +0
Code
data
¡
¡¡¡¡
¡¡¡¡
¡¡¡¡
6543210
Decode result output
Decode designating numbers
Eight numbers, each of which is added by 0, 1, 2, . . . , and 7 to the specified
number are decoded.
When number 62 is specified, for example, eight numbers of 62 to 69 are
decoded.
If code data is 62, 0 bit of output data is turned on; if 69, 7th bit is turned on.
1, 2 or 4-byte
binary code data
Decode designating
number +1
Decode designating
number +7
Fig. 4.9.6 (a) Function of DECB instruction (basic specification)