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
Illustration
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;
END_VAR
VAR_OUTPUT
fPresentValue : REAL;
END_VAR
VAR_INPUT CONSTANT PERSISTENT
{region 'Variable Parameters'}
eOutputUnit : E_BA_Unit := E_BA_Unit.eOther_Percent;
fCOVIncrement : REAL := BA_Param.fDefCOVIncrement;
eOpMode : E_BA_PIDMode := BA_Param.nLoop_DefOpMode;
eActionRm : E_BA_Action := E_BA_Action.eDirect;
fNeutralZone : REAL:= 0;
fMinOutputRm : REAL:= 0;
fMaxOutputRm : REAL:= 100;
fProportionalConstant : REAL;
fIntegralConstant : REAL;
fDerivativeConstant : REAL := 0;
nDampConstant : UDINT;
stStepDelay : ST_BA_StepDelayParam;
{endregion}
END_VAR
VAR
{region 'Output-Properties'}
fCtrlDeviation : REAL;
{endregion}
END_VAR
VAR
{region 'Hardware'}
eActionSource : E_BA_ProcessSignalSource;
eMinMaxOutputSource : E_BA_ProcessSignalSource;
{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. |
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. |
VAR
Name | Type | Description |
---|---|---|
fCtrlDeviation | REAL | Control deviation |
eActionSource | Definition of whether the control direction is to be treated as a variable or as a parameter. | |
eMinMaxOutputSource | Definition whether the output source is to be treated as a variable or as a parameter. |
Requirements
Development environment | Required PLC library |
---|---|
TwinCAT from v3.1.4024.35 | Tc3_XBA from v5.3.0.0 |