Delta AS Series Programming Manual page 312

Hide thumbs Also See for AS Series:
Table of Contents

Advertisement

API
Instruction code
0058
MCMP
Device
X
Y
M
S
1
S
2
n
D
Data
type
S
1
S
2
n
D
Symbol
Explanation
1.
This instruction searches for the bits with different states, starting from the bits specified by adding one to the
current value in D. After finding the bits with different states, the instruction stores the bit number in D, and the
comparison is finished.
2.
The operand n must be between 1–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 found, 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
cycle, and SM609 is ON. When the value in D exceeds the range, SM611 is ON.
4.
When the MCMP instruction is executed, you 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 you. The value in the register is
between 0–16n-1, and corresponds to the bit between b0 to b16n-1. During the operation, you are 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 is ON, and the MCMP instruction is not executed.
5.
If SM608 and SM610 occur simultaneously, they are ON simultaneously.
Operand
,S
,n,D
P
S
1
2
S
T
C
HC
Pulse Instruction
: Matrix source device 1
S
1
: Matrix source device 2
S
2
: Length of the array
n
: Pointer
D
C h a p t e r 6 Ap p l i e d I n s t r u c t i o n s
D
FR
SM
SR
16-bit instruction
AS
AS
Function
Matrix comparison
E
K
16#
"$"
F
32-bit instruction
th
bits in the next scan
6 - 3 3
6_

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents