Mitsubishi — 5.6 Descriptions of the Applied Instructions

Chapter 5 Applied Instructions  S 1 : Augend; S 2 : Addend; D : Sum  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 DAADR is the same as the function of API 120 DEADD.  The floating-point value in S 2 is added to the floating-point value in S 1 , and the sum is stored in D .  S 1 and S 2 can be the same register. If the instruction DAADR is used under the circumstances, the value in the register is added to itself whenever the conditional contact is ON in a scan cycle.

Generally, the pulse instruction DADDRP 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.0 is added to the Example 1 floating-point value F1.23456, and the sum F2.23456 is stored in (D11, D10).  When X0.0 is ON, the floating-point value in (D3, D2) is added to the Example 2 floating-point value in (D1, D0), and the sum is stored in (D11, D10). X0.0 5-105 API Instruction code Operand Function 172 D ADDR P S , S , D 1 2 Floating-point addition 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 DADDR F1.23456 F1.0 D10 DADDR D0 D2 D10