Omron SYSMAC C200HS Operation Manual page 246

Programmable controllers
Hide thumbs Also See for SYSMAC C200HS:
Table of Contents

Advertisement

Special Math Instructions
Previous Value Pointer
Cycle Indicator
Flags
236
th
On the N
cycle, the previous value of S is written to last word in the range D+2 to
D+N+1. The average value of the previous values stored in D+2 to D+N+1 is cal-
culated and written to D, bit 15 of D+1 is turned ON, and the previous value point-
er (the first 2 digits of D+1) is reset to zero. Each time that AVG(––) is executed,
the previous value of S overwrites the content of the word indicated by the point-
er and the new average value is calculated and written to D. The pointer will be
reset again after reaching N–1.
The following diagram shows the function of words D to D+N+1.
D
D+1
D+2
D+3
D+N+1
The function of bits in D+1 are shown in the following diagram and explained in
more detail below.
D+1:
15 14
Not used. Set to zero.
Cycle indicator
0 (OFF): cycles since execution of AVG(––) < N.
cycles since execution of AVG(––) ≥ N.
1 (ON):
The previous value pointer indicates the location where the most recent value of
S was stored relative to D+2, i.e., a pointer value of 0 indicates D+2, a value of 1
indicates D+3, etc.
The cycle indicator is turned ON after AVG(––) has been executed N times. At
this point, D will contain the average value of the contents of words D+2 through
D+N+1. The average value is 4-digit hexadecimal and is rounded off to the near-
est integer value.
Indirectly addressed DM word is non-existent. (Content of :DM word is
ER:
not BCD, or the DM area boundary has been exceeded.)
One or more operands have been set incorrectly.
Average value (after N or more cycles)
Previous value pointer and cycle indicator
Previous value #1
Previous value #2
Previous value #N
08 07
00
Previous value pointer
(2-digit hexadecimal from 0 to N–1.)
Section 5-21

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents