Rockwell Automation DeviceLogix System User Manual User Manual

Page 36

Advertising
background image

36

Publication RA-UM003B-EN-P - February 2010

Chapter 2 Navigate the Function Block Editor Interface

Statistical Category

The Statistical category includes a single instruction type: Moving
Average.

Moving Average

The DeviceLogix Moving Average function block calculates a time
average value for the input signal.

When sampling is enabled, the object executes this formula as the
main function.

When the object starts executing, the moving average is initialized, as
shown in the example that follows.

Example

Number of samples = 3
Scan 1: Output1 = Input1
Scan 2: Output2 = (Input2+Input1)/2
Scan 3: Output3 = (Input3+Input2+Input1)/3

The table lists the conditions and corresponding output with special
input values.

IMPORTANT

When data values are large, switching between REAL and DINT
data types may cause a minimal loss of accuracy. For example,
a value of 99999999 DINT will be rounded up to 100000000
REAL when you switch to a REAL data type and then back to a
DINT data type.

Condition

Output

Fault Code

Fault Option = 1

Fault Option = 2

Fault Option = 3

INPUT in NAN

NAN

Hold last output

Value of instance
attribute Fault State
Value

2

INPUT is the Positive
Infinity

Positive Infinity

2

INPUT is the Negative
Infinity

Negative Infinity

2

Input value from
binding source is out
of range for the object

The calculated result
using the truncated input
value

1

Advertising