Delta AH500 Programming Manual page 234

Hide thumbs Also See for AH500:
Table of Contents

Advertisement

AH 5 00 Pr ogr am m ing Ma n ua l
API
Instruction code
0058
MCMP
Device X
Y
M
S
1
S
2
n
D
Symbol:
Explanation:
1.
The search for the bits whose states are different starts from the bits specified by the number
gotten from the addition of one to the current value in D. After the bits whose states are
different are found, the bit number is stored in D, and the comparison is finished.
2.
The operand n should be within the range between 1 and 256.
3.
When SM607 is ON, the equivalent values are compared. When SM607 is OFF, the different
values are compared. When the matching bits are compared, the comparison stops
immediately, and SM610 is ON. When the last bits are compared, SM608 is ON, and the bit
number is stored in D. The comparison starts from the 0
SM609 is ON. When the value in D exceeds the range, SM611 is ON.
4.
When the instruction MCMP is executed, users need a 16-bit register to specify a certain bit
among the 16n bits in the matrix for the operation. The register is called the pointer, and is
specified by users. The value in the register is within the range between 0 and 16n-1, and
corresponds to the bit within the range between b0 and b16n-1. During the operation, users
should be prevented from altering the value of the pointer in case the search for the matching
bits is affected. If the value of the pointer exceeds the range, SM611 will be ON, and the
instruction MCMP will not be executed.
5.
If SM608 and SM610 occur simultaneously, they will be ON simultaneously.
Example:
1.
When X0.0 is switched from OFF to ON, SM609 is OFF. The search for the bits whose states
are different (SM607 is OFF) starts from the bits specified by the number gotten from the
addition of one to the current value of the pointer.
2.
Suppose the current value in D20 is 2. When X0.0 is switched from OFF to ON four times,
users can get the following execution results.
The value in D20 is 5, SM610 is ON, and SM608 is OFF.
The value in D20 is 45, SM610 is ON, and SM608 is OFF.
The value in D20 is 47, SM610 is OFF, and SM608 is ON.
The value in D20 is 1, SM610 is ON, and SM608 is OFF.
Operand
P
S
, S
, n, D
1
2
S
T
C
HC
D
Pulse instruction 16-bit instruction (9 steps) 32-bit instruction
AH500
: Matrix source device 1
S
1
: Matrix source device 2
S
2
n : Length of the array
D : Pointer
Matrix comparison
L
SM SR
E
PR
AH500
Word
Word
Word
Word
th
bits in the next scan cycle, and
Function
K
16# "$"
DF
6 - 2 9

Advertisement

Table of Contents
loading

Table of Contents