Average Value - Avg - Omron CQM1H - PROGRAM Programming Manual

Programmable controllers; inner boards
Table of Contents

Advertisement

Special Math Instructions
Flags
5-23-3 AVERAGE VALUE – AVG(––)
Limitations
Description
Precautions
Flags
ER:
Indirectly addressed EM/DM word is non-existent.
(Content of *EM/*DM word is not BCD, or the EM/DM area boundary
has been exceeded.)
R
and R
+N–1 are not in the same data area.
1
1
EQ:
ON when the minimum value is #0000.
Ladder Symbols
AVG(−−)
S
N
D
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.
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 Nth execution,
AVG(––) writes the content of S stored in D+N+1, AVG(––) calculates the
average value of the values stored in D+2 to D+N+1, and writes the average
to D.
The following diagram shows the function of words D to D+N+1.
D
Average value (after N or more executions)
D+1
Used by the system.
Content of S from the 1st execution of AVG(− −)
D+2
Content of S from the 2nd execution of AVG(− −)
D+3
Content of S from the Nth execution of AVG(− −)
D+N+1
The average value is calculated in binary. Be sure that the content of S is in
binary.
N must be BCD from #0001 to #0064. If the content of N ≥ #0065, AVG(––)
will operate with N=64.
The average value will be rounded off to the nearest integer value. (0.5 is
rounded up to 1.)
Leave the contents of D+1 set to #0000 after the first execution of AVG(––).
ER:
Indirectly addressed EM/DM word is non-existent.
(Content of *EM/*DM word is not BCD, or the EM/DM area boundary
has been exceeded.)
Section 5-23
Operand Data Areas
S: Source word
IR, SR, AR, DM, EM, HR, TIM/CNT, LR
N: Number of cycles
IR, SR, AR, DM, EM, HR, TIM/CNT, LR, #
D: First destination word
IR, SR, AR, DM, EM, HR, LR
341

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the CQM1H - PROGRAM and is the answer not in the manual?

This manual is also suitable for:

Sysmac cqm1h seriesSysmac cqm1h-cpu series

Table of Contents

Save PDF