AH500 Programming Manual Example 2: 1. When X0.0 is switched from OFF to ON, the instruction ENCO encodes the values of b0~b7 in D10 as the values of b2~b0 in D20, and the values of b15~b3 in D20 become 0. (The values of b8~b18 in D10 are invalid data.) 2. After the instruction ENCO is executed and X0.0 is switched OFF, the data in D is unchanged. b15 b0 D10 b0 The values of b15~b3 in D20 become 0. Additional remark: 1. If there is no bit whose value is 1 in the source device specified by S, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#2003. 2. Suppose S 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. 3. Suppose S 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. 4. Suppose S is a bit device. If S +(2^ n )-1 exceeds the device range, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#2003. 5. Suppose D is a bit device. If D + n -1 exceeds the device range, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#2003. 6-268 0 1 0 1 0 1 0 1 0 0 0 0 1 0 0 0 7 6 5 4 3 2 1 0 of b8~b18 in D10 are invalid data.
b15 D20 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1