7-23
Section
Special Math Instructions
476
value will be stored in DM 0500. The address of the word containing the mini-
mum value (0014) will be stored in DM 0501.
00000
MIN(––)
DM 0300
DM 0000
DM 0500
Address
Instruction
Operands
00000
LD
00000
00001
MIN(––)
DM
0300
DM
0000
DM
0500
Minimum value
Address of word containing maximum value: 0014
Minimum value
If there are two words containing
the minimum value, the one found
first will be stored in DM 0501.
DM 0300
10 words
DM0010
DM0011
DM0012
DM0013
DM0014
DM0015
DM0016
DM0017
DM0018
DM0019
DM 0500
DM 0501
3F2A
51C3
E02A
7C9F
2A20
A827
33BF
E02A
2A20
94DC
4010
2A20
0014
7-23-4
AVERAGE VALUE – AVG(––)
S
: Source word
IR, SR, AR, DM, HR, TC, LR
N
: Number of cycles
IR, SR, AR, DM, HR, TC, LR, #
Ladder Symbols
Operand Data Areas
D
: First destination word
IR, SR, AR, DM, HR, LR
AVG(––)
S
N
D
Limitations
This instruction is available in the
CPM2A/CPM2C only
.
S must be hexadecimal.
N must be BCD from #0001 to #0064.
D and D+N+1 must be in the same data area.
DM 6144 to DM 6655 cannot be used for S, N, or D to D+N+1.
Description
AVG(––) is used to calculate the average value of S over N cycles.
When the execution condition is OFF, AVG(––) is not executed.
Each time that AVG(––) is executed, the content of S is stored in words D+2 to
D+N+1. On the first execution, AVG(––) writes the content of S to D+2; on the
second execution it writes the content of S to D+3, etc. On the N
th
execution,
AVG(––) writes the content of S is stored in D+N+1, AVG(––) calculates the av-
erage value of the values stored in D+2 to D+N+1, and writes the average to D.
Содержание SRM1 - PROGRAMING 02-2001
Страница 1: ...Programmable Controllers Cat No W353 E1 06 SYSMAC CPM1 CPM1A CPM2A CPM2C SRM1 V2 PROGRAMMING MANUAL ...
Страница 2: ...CPM1 CPM1A CPM2A CPM2C SRM1 V2 Programmable Controllers Programming Manual Revised February 2008 ...
Страница 3: ...iv ...
Страница 5: ...vi ...
Страница 9: ...x ...
Страница 15: ...xvi ...