Rockwell Automation 1772-L8_LW_LWP_LX_LXP,D17726.5.8 User Manual User Manual

Page 248

Advertising
background image

EAF

Process Control Instructions

Chapter 16

16-37

Rung 3

This is an unconditional File-to-Word Move instruction
containing the values you want to average. Addresses 201
through 205 are externally indexed by the counter 0034 and
the position starting value must be zero (see rung 2).

Rung 4

This is the averaging EAF rung. The input conditions (second
rung) must be programmed as shown.

Branch 1 The result word done bit 04115 (when set)

stops the averaging calculation after all five
values have been entered and their
average calculated.

The positioning of the Get instructions cannot be altered from
the example program

Branch 2 Bit 03315 is a timer done bit enabling the

calculation. (Timer in rung 1)

Word 0032 is the the number of samples you
want to average.

Word 0035 is the rate (or sum) per scan
which must always be 001. The instruction
will not be completed in one scan but must
be executed once per value to be averaged.

Word 0036 is the result word of the
File-to-Word move. It will contain a different
value each time the instruction is enabled
(every 3 seconds). The 3 Gets must be
included in this rung. The first two can
reside in any storage location; the third GET
must correspond to the WORD ADDR(ess)
from the File-to-Word Move in rung 3.

The DATA ADDR(ess) in the EAF average
instruction (047) is used by the function to
store the position of the word currently
being summed. The result address (040) is
the first of three consecutive words reserved
for the result. The first word is used by the
instruction; the second word contains the
three most significant digits of the result;
and the third word contains the three least
significant digits of the result.

Rung 5

Word 047 points to the next value added to the calculation
(present position). (Optional display rung.)

Advertising