beckhoff TS4100 — 5.3.7 FB_CTRL_TRANSFERFUNCTION_2

PLC-API The internal data required by the function block is stored in the array ar_stTransferfunction2Data. This data must never be modified from within the PLC program. This procedure is also illustrated in the sample program listed below. VAR_INPUT VAR_INPUT fIn : FLOAT; fManValue : FLOAT; eMode : E_CTRL_MODE; END_VAR fIn : Input to the transfer function. fManValue : Input whose value is present at the output in manual mode. eMode : Input that specifies the block's operating mode. VAR_OUTPUT VAR_OUTPUT fOut : FLOAT; eState : E_CTRL_STATE; bError : BOOL; eErrorId : E_CTRL_ERRORCODES; END_VAR fOut : Output from the transfer function. eState : State of the function block. eErrorId :

Supplies the error number [ } 16] when the bError output is set. bError : Becomes TRUE, as soon as an error occurs. VAR_IN_OUT VAR_IN_OUT stParams : ST_CTRL_TRANSFERFUNCTION_2_PARAMS; END_VAR stParams : Parameter structure of the function block. This consists of the following elements: TYPE ST_CTRL_TRANSFERFUNCTION_2_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; pTransferfunction2Data_ADR :

POINTER TO ST_CTRL_TRANSFERFUNCTION_2_DATA; nTransferfunction2Data_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. TS4100 37 Version: 1.1