5 Categories and Use of Basic Application Instructions API 121 Operands: S 1 : Minuend S 2 : Subtrahend D : Subtraction result Explanations: 1. S 1 − S 2 = D . The floating point value in S 2 is subtracted from the floating point value in S 1 and the result is stored in D . The subtraction is conducted in binary floating point format. 2. F refers to floating point input. Be sure to add a decimal point when using it. 3. Only 32-bit instructions DEADD and DEADDP are applicable. 4. If S 1 or S 2 is specified with floating point value F, the instruction will operate in binary floating point. 5. S 1 and S 2 can designate the same register.
In this case, if the instruction is specified as “continuous execution instruction” (generally DESUBP instruction) and the drive contact is ON, the register will be subtracted once in 7. Flags: every scan. a) If the absolute value of the result exceeds the max. floating point value, carry flag will be ON. b) If the absolute value of the result is less than min. floating point value, borrow flag will be ON. c) If the conversion result is 0, zero flag will be ON. Program Example 1: When X0 = ON, binary floating point value (D1, D0) minuses binary floating point value (D3, D2) and the result is stored in (D11, D10). X0 Program Example 2:
When X2 = ON, F1234.0 (automatically converted into binary floating point value ) minuses binary floating point (D1, D0) and the result is stored in (D11, D10). X2 Points to note: For floating point operations, see “5.3 Numeric Values for Data Processing” . DVP-PM Operation Instruction 5-100 Mnemonic Operands Function Controllers 20PM 10PM D ESUB P Binary Floating Point Subtraction Type OP Bit Devices Word Devices Program Steps X Y M S F H KnX KnY KnM KnS T C D V Z D S 1 * * S 2 * * D * OX O100 Zero flag M1808 M1968 Borrow flag M1809 M1969 Carry flag M1810 M1970 DESUB D0 D2 D10 DESUB F1234.0 D0 D10