Configure

This method can be used at runtime to initially configure the instance of a filter (if it was not already configured in the declaration) or to reconfigure it.

If a filter instance is not configured, the methods Call() and Reset() cannot be used.

Syntax

METHOD Configure : BOOL
VAR_INPUT
    stConfig : ST_FTR_IIRSos;
END_VAR

Configure 1: Inputs

Name

Type

Description

stConfig

ST_FTR_IIRSos

Structure for configuring the filter behavior

Configure 2: Return value

Name

Type

Description

Configure

BOOL

TRUE if the filter instance was configured successfully.

Sample

(*Declaration without configuration*)
fbFilter : FB_FTR_IIRSos();
(* initial configuration of fbFilter *)
IF bInit THEN
    bSucceed := fbFilter.Configure(stConfig := stParams);
    bInit    := FALSE
END_IF

(* reconfigure fbFilter on bReconfigure = TRUE *)
IF bReconfigure THEN
    stParams.pCoefficientArrayAdr_Sos := ADR(aNewArray); (*change coefficients*)
    stParams.nCoefficientArraySize_Sos := SIZEOF(aNewArray);
    bSucceed         := fbFilter.Configure(stConfig := stParams);
    bReconfigure     := FALSE;
END_IF