beckhoff TF4100 — 4.2.1.2.7 FB_CTRL_TRANSFERFUNCTION_2

PLC API aNumArray : ARRAY[0..nTfOrder] OF FLOAT; aDenArray : ARRAY[0..nTfOrder] OF FLOAT; aStTfData : ARRAY[0..nTfOrder] OF ST_CTRL_TRANSFERFUNCTION_2_DATA; The coefficients "b 0 " to "b n " are stored in the array aNumArray . This must be organized as follows: aNumArray[0]:= b0; aNumArray[1]:= b1; ... aNumArray[n-1] := bn-1; aNumArray[n] := bn; The coefficients "a 0 " to "a n " are stored in the array aDenArray . This must be organized as follows: aDenArray[0]:= a0; aDenArray[1]:= a1; ... aDenArray[n-1] := an-1; aDenArray[n] := an; The internal data required by the function block is stored in the array aStTfData . This data must never be modified from within the PLC program.

This procedure is also illustrated in the sample program listed below. VAR_INPUT fIn : FLOAT; fManValue : FLOAT; eMode : E_CTRL_MODE; END_VAR Inputs Outputs VAR_OUTPUT fOut : FLOAT; eState : E_CTRL_STATE; bError : BOOL; eErrorId : E_CTRL_ERRORCODES; END_VAR VAR_IN_OUT stParams : ST_CTRL_TRANSFERFUNCTION_2_PARAMS; END_VAR Inputs/ outputs stParams consists of the following elements: TYPE ST_CTRL_TRANSFERFUNCTION_2_PARAMS: STRUCT TF4100 39 Version: 2.2.4 Name Type Description fIn FLOAT Input to the transfer function fManValue FLOAT Input whose value is present at the output in manual mode. eMode E CTRL MODE _ _ Input that specifies the operation mode of the function block.

Name Type Description fOut FLOAT Output from the transfer function eState E CTRL STATE _ _ State of the function block bError BOOL Supplies the error number [} 173] when the output bError is set. eErrorId E CTRL ERROR _ _ CODES Becomes TRUE, as soon as an error occurs. Name Type Description stParams ST CTRL TRAN _ _ SFERFUNCTION 2 PARAMS _ _ Parameter structure of the function block