Instruction 92- moving average – Maple Systems MAPware-7000 User Manual

Page 149

Advertising
background image

141

MAPware-7000 Ladder Logic Guide

1010-1041 rev. 00

Instruction 92- Moving Average

Expression:

Space Requirement: 1 line x 6 column Location Requirement: Middle, Right rail

Function:

When the input is ON, this instruction calculates the average value of the last (n) scanned values
in register A, and stores the average in register C. The number of scans (n) allowed is 1 to 64.
Register B is the start of the data table, (where scanned values are stored). Finally, Register C+1
is used as a pointer to the data table.

This instruction is primarily used for filtering analog input signals.

Execution Condition:

Input

Operation

Output

OFF

No execution

OFF

ON

Execution

ON

Operand:

Coil or Bit

Register

Constant

Index

Name

X

Y B

S

T.

C.

M

X
W

Y
W

B
W

S
W

T C

D

I

J

K

M
W

A

Input Data

√ √

n

Input Data

1-64

B

Start of

Table

√ √

C

Output Data

√ √

Example:

Register XW04 (A) is read during every scan of the ladder logic. Number of scans (n) is set to 5.
The start of the data table (B) is D0900. Therefore, registers D0900-D0904 are used to store the
values read from XW04. D0010 (C) is used to store the calculated average and D0011 (C+1) is
used by this instruction as a pointer:

Advertising