![Omron CJ1G-CPUxx Instructions Manual Download Page 740](http://html1.mh-extra.com/html/omron/cj1g-cpuxx/cj1g-cpuxx_instructions-manual_742491740.webp)
719
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
Average
D01001 0001
0002
8000
8001
Pointer
D01002 0000
0000
0000
0003
D01003
---
0001
0001
0001
3 previous values of IR 40
D01004 ---
---
0002
0002
1
st
cycle 2
nd
cycle 3
rd
cycle 4
th
cycle
CIO 0040 0000 0001 0002 0003
@MOV
Summary of Contents for CJ1G-CPUxx
Page 3: ...iv N o t i c e ...
Page 5: ...vi ...
Page 21: ...xxii Conformance to EC Directives 6 ...
Page 35: ......
Page 1131: ...1110 CJ series Instruction Execution Times and Number of Steps Section 4 2 ...