Mitsubishi — 5.6 Descriptions of the Applied Instructions

AH500 Motion Control Module Manual  S 1 : Dividend; S 2 : Divisor; D : Quotient  S 1 and S 2 can be floating-point values.  S 1 and S 2 can be floating-point values, or data registers in which floating-point values are stored.  If S 1 and S 2 are data registers in which floating-point values are stored, the function of API 172 DDIVR is the same as the function of API 123 DEDIV.  The floating-point value in S 1 is divided by the floating-point value in S 2 , and the product is stored in D .  S 1 and S 2 can be the same register. If the instruction DSUBR is used under the circumstances, the value in the register is divided by itself whenever the conditional contact is ON in a scan cycle.

Generally, the pulse instruction DDIVRP is used.  If the absolute value of an oepration result is greater than the maximum floating-point value available, a carry flag will be ON.  If the absolute value of an oepration reuslt is less than the minimum floating-point value available, a borrow flag will be ON.  If an operation result is 0, a zero flag will be ON.  SM1064 is the zero flag in an Ox motion subroutine, and SM968 is the zero flag in O100.  SM1065 is the borrow flag in an Ox motion subroutine, and SM969 is the borrow flag in O100.  SM1066 is the carry flag in an Ox motion subroutine, and SM970 is the carry flag in O100.

Explanation  When X0.0 is ON, the floating-point value F1.23456 is divided by the Example 1 floating-point value F1.0, and the quotient F1.23456 is stored in (D11, D10). X0.0 Example 2  When X0.0 is ON, the floating-point value in (D1, D0) is divided by the floating-point value in (D11, D10), and the quotient is stored in (D21, D20). X0.1 5-108 API Instruction code Operand Function 175 D DIVR P S , S , D 1 2 Floating-point division Device Xn.n Yn.n M S K 16# F KnM KnS D W T C V Z S 1    S 2    D   Pulse instruction 16-bit instruction 32-bit instruction (9 steps )  –  0.0 DDIVR F1.23456 F1.0 D10 .1 DDIVR D0 D10 D20