![background image](http://html1.mh-extra.com/html/omron/sysmac-c200hs/sysmac-c200hs_operation-manual_742436247.webp)
237
Example
In the following example, the content of IR 040 is set to #0000 and then increm-
ented by 1 each cycle. For the first two cycles, AVG(––) moves the content of
IR 040 to DM 1002 and DM 1003. The contents of DM 1001 will also change
(which can be used to confirm that the results of AVG(––) has changed). On the
third and later cycles AVG(––) calculates the average value of the contents of
DM 1002 to DM 1004 and writes that average value to DM 1000.
@MOV(21)
040
#0000
00001
Address
Instruction
Operands
00000
LD
00001
00001
@MOV(21)
#
0000
040
00002
AVG(––)
040
#
0003
DM
1000
00003
CLC(41)
00004
ADB(50)
040
#
0001
040
AVG(––)
#0003
040
DM 1000
CLC(41)
ADB(50)
#0001
040
040
1
st
cycle
2
nd
cycle
3
rd
cycle
4
th
cycle
DM 1000
0000
0001
0001
0002
Average
DM 1001
0001
0002
8000
8000
Pointer
DM 1002
0000
0000
0000
0003
Previous
DM 1003
---
0001
0001
0001
values of
DM 1004
---
---
0002
0002
IR 40
1
st
cycle
2
nd
cycle
3
rd
cycle
4
th
cycle
IR 40
0000
0001
0002
0003
5-21-4
SUM – SUM(––)
C: Control data
IR, SR, AR, DM, HR, LR
R
1
: First word in range
IR, SR, AR, DM, HR, TC, LR
Ladder Symbols
Operand Data Areas
D: First destination word
IR, SR, AR, DM, HR, LR
SUM(––)
C
R
1
D
@SUM(––)
C
R
1
D
Limitations
The 3 rightmost digits of C must be BCD between 001 and 999.
If bit 14 of C is OFF (setting for BCD data), all data within the range R
1
to R
1
+N–1
must be BCD.
Special Math Instructions
Section 5-21
Содержание SYSMAC C200HS
Страница 1: ...Cat No W235 E1 05 C200HS SYSMAC Programmable Controllers...
Страница 2: ...C200HS Programmable Controllers Operation Manual Revised February 2002...
Страница 3: ...iv...
Страница 5: ...vi...
Страница 379: ...371 SR word Corresponding key s Bit 279 03 04 05 3 06 07 VER 08 09 Monitoring Operation and Modifying Data Section 7 1...
Страница 470: ...468 Programmer Program Date Page Word Contents Notes Word Contents Notes Data Storage...
Страница 471: ...469 Programmer Program Date Page TC address T or C Set value Notes TC address T or C Set value Notes Timers and Counters...