Delta DVP-ES2 — 3.8 Detailed Instruction Explanation

3. Instruction Set Operands: S : Source device D : Operation result (Gray code) Explanations: 1. GRY instruction converts the BIN value in S to Gray Code and stores the converted result in specified register D . 2. Available range of S : 16-bit instruction: 0~32,767 32-bit instruction: 0~2,147,483,647 3. If operand S exceeds the available range, operation error occurs and M1067 = ON, M1068 = ON. D1067 stores the error code 0E1A (HEX) 4. If operands S and D use device F, only 16-bit instruction is applicable. Program Example: When X0 = ON, GRY instruction executes and converts K6513 to Gray Code. The operation result is stored in K4Y20, i.e. Y20 ~ Y37.

b15 b0 K6513=H1971 Y37 Y20 GRAY 6513 K4Y20 3-425 API Mnemonic Operands Function Controllers 170 D GRY P BIN  Gray Code ES2/EX2 SS2 SA2 SX2 SE Typ e OP Bit Devices Word devices Program Steps X Y M S K H K nX KnY KnM KnS T C D E F GRY, GRYP: 5 steps DGRY, DGRYP: 9 steps S * * * * * * * * * * * D * * * * * * * * PULSE 16-bit 32-bit SS2 SA2 SA2 SA2 ES2/EX2 SX2 ES2/EX2 SS2 SX2 ES2/EX2 SS2 SX2 SE SE SE X GRY K6513 K4Y20 0 0 0 1 1 0 0 1 0 1 1 1 0 0 0 1 0 0 0 1 0 1 0 1 1 1 0 0 1 0 0 1