FB_CTRL_CHECK_IF_IN_BAND

FB_CTRL_CHECK_IF_IN_BAND 1:

This function block monitors whether the input value is within the range [ fMin ... fMax ], i.e. whether the inequality

FB_CTRL_CHECK_IF_IN_BAND 2:

is satisfied.

VAR_INPUT

VAR_INPUT
    fIn         : FLOAT;
END_VAR

fIn : The input variable to be monitored.

VAR_OUTPUT

VAR_OUTPUT
    bInBand         : BOOL;
    bNotInBand      : BOOL;
    eErrorId        : E_CTRL_ERRORCODES;
    bError      : BOOL;
END_VAR

bInBand : A TRUE at this output indicates that the input value is within the specified range.

bNotInBand : A TRUE at this output indicates that the input value is not within the specified range.

eErrorId : Supplies the error number when the bError output is set.

bError : Becomes TRUE, as soon as an error occurs.

VAR_IN_OUT

VAR_IN_OUT
    stParams        : ST_CTRL_CHECK_IF_IN_BAND_PARAMS;
END_VAR

stParams : Parameter structure of the function block. This consists of the following elements:

TYPE ST_CTRL_CHECK_IF_IN_BAND_PARAMS:
STRUCT
    tCtrlCycleTime     : TIME     := T#0ms; (* controller cycle
time [TIME] *)
    tTaskCycleTime     : TIME     := T#0ms; (* task cycle time
[TIME] *)
    fMin           : FLOAT;
    fMax           : FLOAT;
END_STRUCT
END_TYPE

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 variable to calculate internally whether the state and the output variables have to be updated in the current cycle.

tTaskCycleTime : Cycle time with which the function block is called. If the block is called in every cycle this corresponds to the task cycle time of the calling task.

fMin : Lower limit of the range.

fMax : Upper limit of the range.

Requirements

Development Environment

Target System

PLC libraries to include

TwinCAT v2.8

PC (i386)

TcControllerToolbox.lib

TwinCAT v2.9 from Build 947

BC

TcControllerToolbox.lb6

TwinCAT v2.9 from Build 956

BX

TcControllerToolbox.lbx