DVP-ES3 Series Programming Manual Symbol S 1 : Minuend S 2 : Subtrahend D : Difference _6 Explanation 1. This instruction subtracts the binary value in S 2 from the binary value in S 1 , and stores the difference in D . 2. Only the 32-bit instructions can use the 32-bit counter, but not the device E. 3. Instruction flags: SM600 (zero flag), SM601 (borrow flag), and SM602 (carry flag) 4. When the operation result is zero, SM600 is ON. Otherwise, it is OFF. 5. When borrowing occurs during the arithmetic, SM601 is ON. Otherwise, it is OFF. Example 1 Subtracting 16-bit binary values:
when M0 is ON, the instruction subtracts the subtrahend in D10 from the minuend in D0, and stores the difference in D20. 6-50 API Instruction code Operand Function 0101 D - P S1,S2,D Subtracting binary numbers Device X Y M S T C HC D FR SM SR E K 16# “$” F S1 S2 D BOOL WORD DWORD LWORD UINT INT DINT LINT REAL LREAL TMR CNT STRING Data type S1 S2 D Pulse instruction 16-bit instruction 32-bit instruction ES3 ES3 ES3