Chapter 6 Applied Instructions
6-265
Example 2:
1. When X0.0 is switched from OFF to ON, the instruction DECO decodes the values of b2~b0 in
D10 as the values of b7~b0 in D20, and the values of b15~b8 in D10 become 0.
2. The values of the lower 3 bits in D10 is decoded as the values of the lower 8 bits in D20. The
values of the higher 8 bits are 0.
3. After the instruction DECO is executed and X0.0 is switched OFF, the data in D20 is
unchanged.
0 0 0 0 0 0 0 01 1 1 1 1 1 1 1
0 0 0 0 0 0 0 0 0 0 0 0 0 0 01
4
2
1
3
b15 b0
The values of b15~b8
in D10 become 0.
b15 b0
D10
D20
7 6 5 4 2 1 0
Additional remark:
1. Suppose D is a bit device. If n is less than 1, or if n is larger than 8, the instruction is not
executed, SM0 is ON, and the error code in SR0 is 16#200B.
2. Suppose D is a word device. If n is less than 1, or if n is larger than 4, the instruction is not
executed, SM0 is ON, and the error code in SR0 is 16#200B.
3. Suppose S is a bit device. If S+n-1 exceeds the device range, the instruction is not executed,
SM0 is ON, and the error code in SR0 is 16#2003.
4. Suppose D is a bit device. If D+(2^n)-1 exceeds the device range, the instruction is not
executed, SM0 is ON, and the error code in SR0 is 16#2003.