PLC API TYPE ST_CTRL_DIGITAL_FILTER_DATA STRUCT Internal structure. This must not be written to. END_STRUCT END_TYPE Sample: PROGRAM PRG_DIGITAL_FILTER_TEST VAR fbDigitalFilter : FB_CTRL_DIGITAL_FILTER; aCoefficientsArray_a : ARRAY[1..3] OF FLOAT; aCoefficientsArray_b : ARRAY[1..3] OF FLOAT; aStDigitalFilterData : ARRAY[1..2] OF ST_CTRL_DIGITAL_FILTER_DATA; eMode : E_CTRL_MODE; stParams : ST_CTRL_DIGITAL_FILTER_PARAMS; eErrorId : E_CTRL_ERRORCODES; bError : BOOL; fIn : FLOAT := 0; fOut : FLOAT; bInit :
BOOL := TRUE; END_VAR IF bInit THEN aCoefficientsArray_a[1] := 0.0; (* not used *) aCoefficientsArray_a[2] := 0.2; aCoefficientsArray_a[3] := 0.1; aCoefficientsArray_b[1] := 0.6; aCoefficientsArray_b[2] := 0.4; aCoefficientsArray_b[3] := 0.2; stParams.tTaskCycleTime := T#2ms; stParams.tCtrlCycleTime := T#2ms; stParams.nFilterOrder := 2; eMode := eCTRL_MODE_ACTIVE; bInit := FALSE; END_IF stParams.pCoefficientsArray_a_ADR := ADR(aCoefficientsArray_a); stParams.nCoefficientsArray_a_SIZEOF := SIZEOF(aCoefficientsArray_a); stParams.pCoefficientsArray_b_ADR := ADR(aCoefficientsArray_b); stParams.nCoefficientsArray_b_SIZEOF := SIZEOF(aCoefficientsArray_b); stParams.pDigitalFilterData_ADR := ADR(astDigitalFilterData); stParams.nDigitalFilterData_SIZEOF := SIZEOF(aStDigitalFilterData); TF4100 92 Version:
2.2.4 Name Type Description tTaskCycleTime TIME Cycle time with which the function block is called. If the function block is called in every cycle this corresponds to the task cycle time of the calling task. tCtrlCycleTime TIME Cycle time with which the control loop is processed. This must be greater than or equal to the TaskCycleTime. The function block uses this input value to calculate internally whether the state and the output values have to be updated in the current cycle. nFilterOrder USINT Order of the digital filter [0...
] pCoefficientsArra y a ADR _ _ POINTER TO FLOAT Address of the array containing the a coefficients nCoefficientsArra y a SIZEOF _ _ UINT Size of the array containing the a coefficients, in bytes pCoefficientsArra y b ADR _ _ POINTER TO FLOAT Address of the array containing the b coefficients nCoefficientsArra y b SIZEOF _ _ UINT Size of the array containing the b coefficients, in bytes pDigitalFilterData ADR _ POINTER TO ST CTRL _ _ DIGITAL _ FILTER DATA _ Address of the data array nDigitalFilterData SIZEOF _ UINT Size of the data array in bytes