Delta AH500 — 6.1.2 Explanation of Comparison Instructions

AH500 Programming Manual Symbol: S 1 : Source device 1 Word S 2 : Source device 2 Word n : Data length Word D : Comparison result Bit Explanation: 1. The instruction is used to compare n pieces of data in devices starting from S 1 with those in devices starting from S 2 . The values compared are signed decimal numbers, and the comparison results are stored in D . 2. The operand n should be within the range between 1 and 256. 3. The value which is written into the operand D is a one-bit value. 4. When the results gotten from the comparison by using the instruction CMPT# are that all devices are ON, SM620 is ON. Otherwise, SM620 is OFF. 5.

If the operand S 1 is a device, the comparison will be as shown below. Comparison result S1 1234(BIN) 5678(BIN) 5000(BIN) 1000(BIN) S2 1111(B IN) 2222(BIN) 3333(BIN) 4444(BIN) D 1 1 1 0 S1 S1 +2 Comparison sign +1 S2 S2 +2 +3 +1 D D +2 +3 +1 S1 ~ +3 n > S2 ~ n D ~ S1 +(N-2) 10(BIN) 90(BIN) S2 +(N-2) 8888(BIN) 9999(BIN) D +(N-2) 0 0 +(N-1) S1 +(N-1) S2 +(N-1) D 6. If the operand S 1 is a constant within the range between -32768 and 32767, the comparison will be as shown below. Comparison result S2 S2 +1 1111(B IN) 2222(BIN) 3333(BIN) 4444(BIN) D D +1 0 0 1 0 S1 n 3333(BIN) Compariosn sign = S2 S2 +2 +3 D D +2 +3 ~ ~ 7.

The corresponding comparison operation results of the instructions are listed below. +(N-1) S2 S2 +(N-2) 8888(BIN) 9999(BIN) +(N-1) D D +(N-2) 0 0 6-31 API Instruction code Operand Function 0059~ 0064 CMPT※ P S , S , n, D 1 2 Comparing the tables 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 -