FB_BA_Loop

The function block FB_BA_Loop represents a PID controller within the project structure of TF8040.
Functional diagram
The controller can be operated either in parallel structure or with upstream P part. This is specified by the input eOpMode.
Upstream P part:
eOpMode := E_BA_PIDMode. eP1ID

Parallel structure:
eOpMode := E_BA_PIDMode. ePID

Syntax
FUNCTION_BLOCK FB_BA_Loop EXTENDS FB_BA_Object IMPLEMENTS I_BA_Loop
VAR_INPUT
bEn : BOOL;
fSetpoint : REAL;
fCtrlVal : REAL;
eActionPgm : E_BA_Action;
fMinOutputPgm : REAL;
fMaxOutputPgm : REAL;
bEnSync : BOOL;
fValSync : REAL;
bHold : BOOL;
END_VAR
VAR_OUTPUT
fPresentValue : REAL;
END_VAR
VAR_INPUT CONSTANT PERSISTENT
{region 'Variable Parameters'}
{attribute 'parameterCategory':='General'}
eOutputUnit : E_BA_Unit := E_BA_Unit.eOther_Percent;
{attribute 'parameterCategory':='General'}
fCOVIncrement : REAL := XBA_Param.fDefCOVIncrement;
{attribute 'parameterCategory':='Config'}
eOpMode : E_BA_PIDMode := XBA_Param.nLoop_DefOpMode;
{attribute 'parameterCategory':='Config'}
eActionRm : E_BA_Action := E_BA_Action.eDirect;
{attribute 'parameterCategory':='Config'}
fNeutralZone : REAL := 0;
{attribute 'parameterCategory':='Config'}
fMinOutputRm : REAL := 0;
{attribute 'parameterCategory':='Config'}
fMaxOutputRm : REAL := 100;
{attribute 'parameterCategory':='Config'}
fProportionalConstant : REAL;
{attribute 'parameterCategory':='Config'}
{attribute 'parameterUnit':= 's'}
fIntegralConstant : REAL;
{attribute 'parameterCategory':='Config'}
{attribute 'parameterUnit':= 's'}
fDerivativeConstant : REAL := 0;
{attribute 'parameterCategory':='Config'}
nDampConstant : UDINT;
{endregion}
END_VAR
Inputs
Name | Type | Description |
|---|---|---|
bEn | BOOL | Activation of the function block. |
fSetpoint | REAL | Setpoint. |
fCtrlVal | REAL | Feedback of the control value for calculating the control deviation from the setpoint. |
eActionPgm | Setting the control direction. | |
fMinOutputPgm | REAL | Lower controller output limit. |
fMaxOutputPgm | REAL | Upper controller output limit. |
bEnSync | BOOL | Enable synchronization. |
fValSync | REAL | Synchronization value. After a positive edge at bEnSync this value is written to fPresentValue. |
bHold | BOOL | By applying a TRUE signal to the bHold input, the controller interrupts its internal P, I and D part calculation. This freezes the fPresentValue output as long as bHold is TRUE. |
Inputs CONSTANT PERSISTENT
Name | Type | Description |
|---|---|---|
eOutputUnit | E_BA_Unit | Output unit. |
fCOVIncrement | REAL | Step size of the Present Value that triggers a COV Notification. |
eOpMode | E_BA_PIDMode | Pre- or parallel-set P part. |
eActionRm | E_BA_Action | Control direction. |
fNeutralZone | REAL | Neutral zone. |
fMinOutputRm | REAL | Minimum output value due to external override. |
fMaxOutputRm | REAL | Maximum output value due to external override. |
fProportionalConstant | REAL | Proportional constant. |
fIntegralConstant | REAL | Integral constant. |
fDerivativeConstant | REAL | Derivative constant. |
nDampConstant | UDINT | Damping constant. |
Requirements
Development environment | Required PLC library |
|---|---|
TwinCAT from v3.1.4024.35 | Tc3_XBA from v5.3.0.0 |
Outputs