Delta AH500 — 6.2.2 Explanation of Arithmetic Instructions

Chapter 6 Applied Instructions API 0113 Symbol: S 1 : Minuend Word S 2 : SubtrAH500end Word n : Data length Word D : Difference Word 1. n pieces of data in devices starting from S 2 are subtracted from those in devices starting from S 1 . The minuends and the subtrAH500ends are binary numbers, and the differences are stored in D . 2. The operand n should be within the range between 1 and 256. 3. When the operation result is zero, SM600 is ON. 4. When the operation result is less than –32,768, SM601 is ON. 5. When the operation result is larger than 32,767, SM602 is ON. 6. When the operand S 2 is a device (not a constant or a hexadecimal value): Explanation: S 1 . . . . .

S 1 +n-1 1 2 } } S S-1=4 S 2 1 . . . . . D 1 +n-1 } D S 1 +1 4 n n - S 2 +1 2 n = D +1 4-2=2 . . . . . S 1 +n-1 . . . . . . . . . . . . 7. When the operand S 2 is a constant or a hexadecimal value: S 1 1-S=-4 S 1 . . . . . S 1 2 } } S S-1=4 S 2 1 . . . . . D +n-1 } D S 1 +1 4 n n - S 2 1 n = D +1 4-1=3 . . . . . S +n-1 . . . . . . . . 1 1 . . 1-1=0 . . Example 1: When X0.0 is ON, the binary values in D10~D14 are subtracted from the binary values in D0~D4, and the differences are stored in D100~D104.

6-63 Instruction code Operand Function BK- P S , S , n, D 1 2 Subtraction of binary numbers in blocks Device X Y M S T C HC D L SM SR E PR K 16# “$” DF S 1           S 2             N             D           Pulse instruction 16-bit instruction (9 steps) 32-bit instruction AH500 AH500 -