9 Application Instructions API 150-199 API 171 Operands: S : Source device for Gray code D : Device for storing BIN value Explanations: 1. If S and D are used in device F, only 16-bit instruction is applicable. 2. See the specifications of each model for their range of use. 3. This instruction converts the Gray code in the device designated in S into BIN value and stores the value in D . 4. This instruction converts the content (in Gray code) in the absolute position encoder connected at the PLC input terminal into BIN value and store the result in the designated register. 5. See the ranges of S as indicated below.
If S exceeds the ranges, the program will regard it as an operation error and the instruction will not be executed. M1067 and M1068 will be On and D1067 will record the error code 0E1A (hex). In 16-bit instruction: 0 ~ 32,767 In 32-bit instruction: 0 ~ 2,147,483,647 Program Example: When X20 = On, the Gray code in the absolute position encoder connected at X0 ~ X17 will be converted into BIN value and stored in D10. X20 X17 X0 K4X0 GRAY6513 H1971=K6513 b15 b0 DVP-PLC Application Manual 9-80 Mnemonic Operands Function D GBIN P Gray Code BIN Type OP Bit Devices Word Devices Program Steps X Y M S K H KnX KnY KnM KnS T C D E F GBIN, GBINP: 5 steps DGBIN, DGBINP:
9 steps S * * * * * * * * * * * D * * * * * * * * PULSE 16-bit 32-bit ES EH3 SV2 ES EX SS SV EH3 SV2 ES EX SS EH3 EX SS SA SX SC EH SV SA SX SC EH SA SX SC EH SV SV2 0 GBIN K4X0 D10 0 0 0 1 0 1 0 1 1 1 0 0 1 0 0 1 0 0 0 1 1 0 0 1 0 1 1 1 0 0 0 1