Delta Electronics — 5.6 Application Instructions

5 Categories and Use of Basic Application Instructions API D 173 Operands: S 1 : Floating point minuend S 2 : Floating point subtrahend D: Remainder Explanations: 1. DSUBR instruction subtracts S 1 with S 2 and stores the operation result in D . 2. In DSUBR instruction, floating point values can be directly entered into S 1 and S 2. . 3. In DSUBR instruction, floating point values (e.g. F1.2) can be either entered directly into S 1 and S 2 or stored in data registers for operation. 4. When S 1 and S 2 is specified as data registers, the function of DSUBR instruction is the same as API 121 ESUB instruction. 5. S 1 and S 2 can designate the same register.

In this case, if the instruction is specified as “continuous execution instruction” (generally DSUBRP instruction) and the drive contact is ON, the register will be subtracted once in every scan. 7. Flags: If absolute value of the result exceeds max floating point value, carry flag will be ON. If absolute value of the result is less than min. floating point value, borrow flag will be ON. If the conversion result is 0, zero flag will be ON Program example 1: When X0 = ON, subtract floating point number F1.200E+0 (Input F1.2, and scientific notation F1.200E+0 will be displayed on ladder diagram.

Users can set monitoring data format as float on the function View) with F2.200E+0 and store the obtained result F-1.000E+0 in register D10 and D11. X0 Program example 2: When X0 = ON, subtract the floating point value (D1, D0) with (D3, D2) and store the result in (D11, D10). X0 DVP-PM Application Manual 5-123 Operands Function Controllers 20PM 10PM SUBR P Floating point subtraction Type OP Bit Devices Word devices Program Steps X Y M S F H KnX KnY KnM KnS T C D E F DSUBR: 13 steps S 1 * S 2 * D * OX O100 Zero flag M1808 M1968 Borrow flag M1809 M1969 Carry flag M1810 M1970 DSUBR F1.200E+0 F2.200E+0 D10 DSUBR D0 D2 D10