FilterOrder1PLCopen motion icon

FunctionClosed A function calculates a result according to the current value of its inputs. A function has no internal data and is not linked to declared instances. block - first order filter

Inputs

XIN : REAL Input analog value
GAIN : REAL Transformation gain

Outputs

XOUT : REAL Output signal

Remarks

The operation performed is:

Output = (Input x Gain) + (OutputPrev * (1-Gain))

The allowed range for the gain is [0.05 .. 1.0]

ST Language

Filt1 is a declared instance of FilterOrder1 function block.

Filt1 (rIn, rGain);
Signal := Fillt1.Xout;

Example