810
Data Control Instructions Section 3-18
Examples In the following example, the content of CIO 0040 is set to #0000 and then
incremented by 1 each cycle. For the first two cycles, AVG(195) moves the
content of CIO 0040 to D01002 and D01003. The contents of D01001 will
also change (which can be used to confirm that the results of AVG(195) has
changed). On the third and later cycles AVG(195) calculates the average
value of the contents of D01002 to D01004 and writes that average value to
D01000.
S: D00100
N: D00200
R: CIO 0300
R+1: CIO 0301
R+2: CIO 0302
R+3: CIO 0303
R+11: CIO 0311
S
N
R
Average
Pointer
Average Valid Flag
(10 times)
S, scan 2
S, scan 1
S, scan n
D01000 0000 0001 0001 0002
D01001 0001 0002 8000 8001
D01002 0000 0000 0000 0003
D01003 --- 0001 0001 0001
D01004 --- --- 0002 0002
CIO 0040 0000 0001 0002 0003
@MOV
1
st
cycle 2
nd
cycle 3
rd
cycle 4
th
cycle
Average
Pointer
3 previous values of IR 4