AH500 Motion Control Module Manual S 1 : Minuend; S 2 : Subtrahend; D : Difference The binary floating-point value in S 2 is subtracted from the binary floating-point value in S 1 , and the difference is stored in D . If S 1 is a floating-point value, the instruction will be used to subtract the binary floating-point value in S 2 from the floating-point value. If S 2 is a floating-point value, the instruction will be used to subtract the floating-point value from the binary floating-point value in S 1 . S 1 and S 2 can be the same register.
If the instruction DESUB is used under the circumstances, the value in the register is subtracted from itself whenever the conditional contact is ON in a scan cycle. Generally, the pulse instruction DESUBP 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 binary floating-point value in (D3, D2) is Example 1 subtracted from the binary floating-point value in (D1, D0), and the difference is stored in (D11, D10). X0.0 Example 2 When X0.2 is ON, the binary floating-point value in (D1, D0) is subtracted from F1234.0, and the difference is stored in (D11, D10). Please refer to section 5.3 for more information about performing Additional remark operations on floating-point numbers.
5-84 API Instruction code Operand Function Binary floating-point 121 D ESUB P S , S , D 1 2 subtraction 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) – DESUB D0 D2 D10 0.2 DESUB F1234.0 D0 D10