Mitsubishi — 5.6 Descriptions of the Applied Instructions

AH500 Motion Control Module Manual  S : Source device; D : Device in which an encoding result is stored; n : Number of bits which are encoded  The low 2 n bits in S are encoded as the low n bits in D .  If there are many bits which are 1 in S , the first bit which is 1 from the left will be processed.  Generally, the pulse instruction ENCOP is executed.  The instruction supports V devices and Z devices. (If the 16-bit instructions used, Z devices can not be used. If the 32-bit instruction is used, V devices can not be used.)  If S is a bit device, n is in the range of 1 to 8. If S is a word device, n is in the range of 1 to 4.

Explanation Example 1  When S is a bit device, n is in the range of 1 to 8. If n is 0, or greater than 8, an error will occur.  If n is 8, the maximum number of bits which can be decoded is 2 8 =256.  When X0.0 is turned from OFF to ON, the instruction ENCOP encodes the 8 bits in M0~M7 as the low 3 bits in D0, and b15~b3 in D0 become 0.  After the instruction ENCOP is executed, X0.0 will be OFF, and the data in D will remain unchanged. X0.0 M7 M6 M5 M4 M3 M2 M1 M0 Bit 15~bit 3 in D0 become 0.

b0 5-62 API Instruction code Operand Function 42 ENCO P S, D, n Encoder Device Xn.n Yn.n M S K 16# F KnM KnS D W T C V Z S           D       n   Pulse instruction 16-bit instruction (7 steps ) 32-bit instruction   – ENCOP M0 D0 K3 0 0 0 0 1 0 0 0 7 6 5 4 3 2 1 0 b15 D0 4 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 1 0 0 0