Omron CP - PROGRAMMING MANUAL 05-2007 Programming Manual page 698

Cp1h/cp1l cpu unit
Table of Contents

Advertisement

Data Control Instructions
Description
Flags
Area
DM Area
Indirect DM addresses
in binary
Indirect DM addresses
in BCD
Constants
Data Registers
Index Registers
Indirect addressing
using Index Registers
For the first N–1 cycles when the execution condition is ON, AVG(195) writes
the values of S in order to words starting with R+2. The Previous Value
Pointer (bits 00 to 07 of R+1) is incremented each time a value is written. Until
the Nth value is written, the contents of S will be output unchanged to R and
the Average Value Flag (bit 15 of R+1) will remain OFF.
When the Nth value is written to R+N+1, the average of all the values that
have been stored will be computed, the average will be output to R as an
unsigned binary value, and the Average Value Flag (bit 15 of R+1) will be
turned ON. For all further cycles, the value in R will be updated for the most
current N values of S.
The maximum value of N is 64. If more than 64 cycles are specified, the set-
ting will be treated as 64 cycles.
The Previous Value Pointer will be reset to 0 after N–1 values have been writ-
ten.
The average value output to R will be rounded to the nearest integer.
S: Source word
R
R+1
Average Valid Flag
R+2
S
R+3
S
S
R+N+1
Name
Label
Error Flag
ER
S
D0 to D32767
@ D0 to @ D32767
*D0 to *D32767
#0000 to #FFFF
#0001 to #0040
(binary)
(binary)
DR0 to DR15
---
,IR0 to ,IR15
–2048 to +2047 ,IR0 to –2048 to +2047 ,IR15
DR0 to DR15, IR0 to IR15
N: Number of cycles
Pointer
Average
Cycle 1
Cycle 2
N values
Cycle N
Operation
ON if the contents of N is 0.
OFF in all other cases.
Section 3-17
N
R
---
---
665

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents