Delta AH500 Programming Manual page 445

Hide thumbs Also See for AH500:
Table of Contents

Advertisement

API
Instruction code
1208
D
MEAN
Device X
Y
M
S
D
n
Symbol:
Explanation:
1.
After the values in the n devices starting from the device specified by S are added up, the
mean of the sum is stored in D.
2.
If a remainder appears in the calculation, it is left out.
3.
The operand n used in the 16-bit instruction should be within the range between 1 and 256,
and the operand n used in the 32-bit instruction should be within the range between 1 and 128.
4.
Only the 32-bit instructions can use the 32-bit counter.
Example:
When X0.0 is ON, the values in the three registers starting from D0 are added up. After the values
are added up, the sum is divided by 3. The quotient is stored in D10, and the remainder is left out.
(D0+D1+D2)/3
D0
D1
D2
Operand
S, D, n
P
S
T
C
HC
D
Pulse instruction 16-bit instruction (7 steps) 32-bit instruction(7 steps)
AH500
S : Initial device
Device in which the mean is
D :
stored
n : Number of devices
100
After the instruction
113
is executed
125
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons
L
SM SR
E
PR
AH500
Word/Double word
Word/Double word
Word/Double word
D10
D10
112
T he quotient 2 is left out.
Function
Mean
K
16# "$"
DF
AH500
6 - 2 7 7

Advertisement

Table of Contents
loading

Table of Contents