Installation manual
Publication 1747-RM001G-EN-P - November 2008
Data Handling Instructions 5-11
Entering Parameters
• Source is the address that contains the bit decode information. Only the
first four bits (0 to 3) are used by the DCD instruction. The remaining
bits may be used for other application specific needs. Change the value
of the first four bits of this word to select one bit of the destination
word.
• Destination is the address of the word where the data is to be stored.
Updates to Arithmetic Status Bits
Unaffected.
Encode 1 of 16 to 4 (ENC)
When the rung is true, this output instruction searches the source from the
lowest to the highest bit, and looks for the first set bit. The corresponding bit
position is written to the destination as an integer as shown in the table below.
Use this instruction to multiplex data in applications such as rotary switches,
keypads, and bank switching.
ENC
Encode 1 of 16 to 4
Source N7:64
0000000000000100<
Dest N7:65
0003h<
ENC
Output Instruction
Fixed SLC
5/01
SLC
5/02
SLC
5/03
SLC
5/04
SLC
5/05
•••
Source Destination
Bit1514131211100908070605040302010015 to 0403020100
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
1
x
x
x
x
x
x
x
x
x
x
x
x
x
x
1
0
x
x
x
x
x
x
x
x
x
x
x
x
x
1
0
0
x
x
x
x
x
x
x
x
x
x
x
x
1
0
0
0
x
x
x
x
x
x
x
x
x
x
x
1
0
0
0
0
x
x
x
x
x
x
x
x
x
x
1
0
0
0
0
0
x
x
x
x
x
x
x
x
x
1
0
0
0
0
0
0
x
x
x
x
x
x
x
x
1
0
0
0
0
0
0
0
x
x
x
x
x
x
x
1
0
0
0
0
0
0
0
0
x
x
x
x
x
x
1
0
0
0
0
0
0
0
0
0
x
x
x
x
x
1
0
0
0
0
0
0
0
0
0
0
x
x
x
x
1
0
0
0
0
0
0
0
0
0
0
0
x
x
x
1
0
0
0
0
0
0
0
0
0
0
0
0
x
x
1
0
0
0
0
0
0
0
0
0
0
0
0
0
x
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
0
0
0
0
1
1
1
1
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1