Function Block - Calculates the average of signal samples.

Inputs

Input

Data type

Description

RUN

BOOL

Enabling command.

XIN

REAL

Input signal.

N

DINT

Number of samples stored for average calculation - Cannot exceed 128.

Outputs

Output

Data type

Description

XOUT

REAL

Average of the stored samples (*).

(*) AVERAGEL has LREAL arguments.

Remarks

The average is calculated according to the number of stored samples, that can be less that N when the block is enabled. In LD language, the input rung is the RUN command. The output rung keeps the state of the input rung.

The "N" input is take into account only when the RUN input is FALSE. So the "RUN" needs to be reset after a change.

ST Language

MyAve is a declared instance of AVERAGE function block.

MyAve (RUN, XIN, N);
XOUT := MyAve.XOUT;

FBD Language

Fixed_Image

LD Language

ENO has the same state as RUN.

Fixed_Image See also

INTEGRAL  DERIVATE  LIM_ALRM  HYSTER  STACKINT


Created with the Personal Edition of HelpNDoc: Import and export Markdown documents