Delta AH500 Programming Manual page 456

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
1214
MBC
Device X
Y
M
S
n
D
Symbol:
Explanation:
1.
The instruction is used to count the bits with the value 1 or 0 in the n devices starting from the
device specified by S. The operation result is stored in D.
2.
When SM617 is ON, the bits with the value 1 is counted. When SM617 is OFF, the bits with the
value 0 is counted. When the operation result is 0, SM618 is ON.
3.
The operand n should be within the range between 1 and 256.
Example:
Suppose SM617 is ON. When X0.0 is ON, the bits with the value 1 are counted, and the operation
result is stored in D20. Suppose SM617 is OFF. When X0.0 is ON, the bits with the value 0 are
counted, and the operation result is stored in D20.
Additional remark:
1.
If S+n-1 exceeds the device range, the instruction is not executed, SM0 is ON, and the error
code in SR0 is 16#2003.
2.
If n is less than 1, or if n is larger than 256, the instruction is not executed, SM0 is ON, and the
error code in SR0 is 16#200B.
3.
The flags:
SM617: The bits with the value 0 or 1 are counted.
SM618: It is ON when the matrix counting result is 0.
6 - 2 8 8
Operand
S, n, D
P
S
T
C
HC
D
Pulse instruction 16-bit instruction (7 steps) 32-bit instruction
AH500
S : Matrix source
n : Length of the array
D : Operation result
b15
D0
1 1 1 1 1 1 1 1 1 1 0 0 0 0 1 1
D1
1 1 1 1 1 1 1 1 1 1 0 0 0 0 1 1
D2
1 1 1 1 1 1 1 1 1 1 0 0 0 0 1 1
Counting the bits with the value 0
or 1
L
SM SR
E
PR
AH500
b0
1 2
0
SM 617
D20
1
3 6
D20
SM 617
Function
K
16# "$"
DF
-
Word
Word
Word

Advertisement

Table of Contents
loading

Table of Contents