beckhoff TS4100 — 5.3.6 FB_CTRL_TRANSFERFUNCTION_1

PLC-API bError : Becomes TRUE, as soon as an error occurs. VAR_IN_OUT VAR_IN_OUT stParams : ST_CTRL_TRANSFERFUNCTION_1_PARAMS; END_VAR stParams : Parameter structure of the function block. This consists of the following elements: TYPE ST_CTRL_TRANSFERFUNCTION_1_PARAMS: STRUCT tTaskCycleTime : TIME; (* task cycle time in seconds *) tCtrlCycleTime : TIME := T#0ms; (* controller cycle time *) nOrderOfTheTransferfunction : USINT; pNumeratorArray_ADR : POINTER TO FLOAT := 0; nNumeratorArray_SIZEOF : UINT; pDenominatorArray_ADR : POINTER TO FLOAT := 0; nDenomiantorArray_SIZEOF : UINT; pTransferfunction1Data_ADR : POINTER TO ST_CTRL_TRANSFERFUNCTION_1_DATA; nTransferfunction1Data_SIZEOF :

UINT; END_TYPE tTaskCycleTime : 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 : 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. nOrderOfTheTransferfunction : Order of the transfer function [0... ] pNumeratorArray_ADR : Address of the array with the numerator coefficients. nNumeratorArray_SIZEOF : Size of the array with the numerator coefficients in bytes.

pDenominatorArray_ADR : Address of the array with the denominator coefficients. nDenominatorArray_SIZEOF : Size of the array with the denominator coefficients in bytes. pTransferfunction1Data_ADR : Address of the data array. nTransferfunction1Data_SIZEOF : Size of the data array in bytes. TYPE ST_CTRL_TRANSFERFUNCTION_1_DATA: STRUCT Interne Struktur. Auf diese darf nicht schreibend zugegriffen werden. END_STRUCT END_TYPE Sample: PROGRAM PRG_TRANSFERFUNCTION_1_TEST VAR CONSTANT nOrderOfTheTransferfunction : USINT := 2; END_VAR VAR ar_fNumeratorArray : ARRAY[0..nOrderOfTheTransferfunction] OF FLOAT; ar_DenominatorArray :

ARRAY[0..nOrderOfTheTransferfunction] OF FLOAT; ar_stTransferfunction1Data : ARRAY[0..nOrderOfTheTransferfunction] OF ST_CTRL_TRANSFERFUNCTION_1_DATA; eMode : E_CTRL_MODE; stParams : ST_CTRL_TRANSFERFUNCTION_1_PARAMS; eErrorId : E_CTRL_ERRORCODES; bError : BOOL; TS4100 34 Version: 1.1