8 Application Instructions API 100-149 Operands: S 1 : Dividend S 2 : Divisor D : Quotient and remainder Explanations: 1. In 16-bit instruction, D occupies one device. 2. In 32-bit instruction, D occupies 2 consecutive devices. 3. See the specifications of each model for their range of use. 4. This instruction divides S 1 and S 2 in BIN format and stores the result in D . Be careful with the positive/negative signs of S 1 , S 2 and D when doing 16-bit and 32-bit operations. 5. The instruction supports EH3/EH3L/SV2 series PLCs whose version is 1.82 or above. 6. This instruction will not be executed when the divisor is 0. M1067 and M1068 will be On and D1067 records the error code 0E19 (hex).
7. In 16-bit BIN division, S 1 D S 2 b15................ b0 / = b15................ b0 b15................ b0 b15 is a symbol bit. b15 is a symbol bit. b15 is a symbol bit. When D serves as a bit device, it can designate K1 ~ K4 and construct a 16-bit result, occupying a 16-bit quotient. 8. In 32-bit BIN division, S 1 S 1 +1 S 2 S 2 +1 D D +1 / = b31 is a symbol bit b31 is a symbol bit b31 is a symbol bit When D serves as a bit device, it can designate K1 ~ K8 and construct a 32-bit result, occupying a 32-bit quotient.
DVP-PLC Application Manual 8-28 API Mnemonic Operands Function 115 DIV16 DIV32 P 16-bit Division 32-bit Division Type OP Bit Devices Word Devices Program Steps X Y M S K H KnX KnY KnM KnS T C D E F DIV, DIVP: 7 steps DDIV, DDIVP: 13 steps S 1 * * * * * * * * * * S 2 * * * * * * * * * * D * * * * * * * PULSE 16-bit 32-bit SA SX SC EH SV EH3 SV2 ES EX SS SA SX SC EH SV EH3 ES EX SS SA SX SC EH SV EH3 ES EX SS SV2 SV2 b31.......b16 b15.........b0 b31.......b16 b15.........b0 b31.......b16 b15.........b0