FB_BACnet_Loop_EX

FB_BACnet_Loop_EX 1:

Application

The function block FB_BACnet_Loop_EX can be used for reading and write access to a BACnet object of type Loop. The function block contains a standard PID controller (FB_BACnet_PidControl) and therefore covers a wide range of control tasks.

VAR_INPUT

bAutoTuning     : BOOL;
tTuningTimeout  : TIME:=T#15m;
eTuningMode     : E_BACNETPIDTUNINGMODE:=BACnetPIDTuningMode_PI;
fAccLimit       : REAL:=0.0;

bAutoTuning: Starts internal auto-tuning.

tTuningTimeout: Maximum duration of auto-tuning in [ms].

eTuningMode: Preselection of the control parameters to be determined (P, PI, PD, PID).

fAccLimit: Parameters for limiting the control value acceleration (ramp) 0 = unlimited or [1/s] (positive and negative).

VAR_OUPUT

bReady                   : BOOL;
bTuningActive            : BOOL;
bTuningWaitPV            : BOOL;
bTuningWaitCV            : BOOL;
bTuningDone              : BOOL;
bTuningAborted           : BOOL;
fSetPoint                : REAL;
fControlledValue         : REAL;
fPresentValue            : REAL;
fPropBand                : REAL;
bOverridden              : BOOL;
bOutOfService            : BOOL;
bFault                   : BOOL;
bInAlarm                 : BOOL;
bOpenLoop                : BOOL;
bCommFailure             : BOOL;
bOtherFault              : BOOL;
eEventState              : E_BACNETEVENTSTATE;
bAckedTrans_ToOffNormal  : BOOL;
bAckedTrans_ToFault      : BOOL;
bAckedTrans_ToNormal     : BOOL;
tObjectID                : T_BACnet_ObjectIdentifier:=16#FFFFFFFF;
bError                   : BOOL;
nErrorId                 : UINT;;
eMode                    : E_BACNETLOOPMODE;

bReady: Notification of general readiness. If this output is set, the other status outputs are valid (PresentValue, Overridden ...). If the output is FALSE, the corresponding function block FB_BACnet_Device does not report "Operational", or the block instance was not linked correctly in the TwinCAT System Manager.

bTuningActive: Auto-tuning is active.

bTuningWaitPV: Auto-tuning expects the specified set value jump to be reached.

bTuningWaitCV: Auto-tuning expects the actual value response to be reached.

bTuningAborted: Auto-tuning was aborted (see nErrorId).

fSetPoint: Feedback of the controller specification (W, set value).

fControlledValue: Feedback of the current process parameter (X, actual value).

fPresentValue: Feedback of the current control output (Y, control value). Attention: Present_Value and Controller_Variable_Value can easily lead to confusion (see also BACnet specification DIN EN ISO 16484-5 for BACnet object Loop and properties Present_Value, Controlled_Variable_Value and Controlled_Variable_Reference).

fPropBand: Feedback of the current control output in percent (-100%...+100%) in relation to the minimum and maximum control output (properties Minimum_Output and Maximum_Output).

bOverridden, bOutOfService, bFault, bInAlarm: See BACnet specification DIN EN ISO 16484-5 for BACnet object Loop and property Status_Flags.

bOpenLoop, bCommFailure, bOtherFault: See BACnet specification DIN EN ISO 16484-5 for BACnet object Loop and property Reliability.

eEventState: See BACnet specification DIN EN ISO 16484-5 for BACnet object Loop and property Event_State.

bAckedTrans_ToOffNormal, bAckedTrans_ToFault, bAckedTrans_ToNormal: Flags of property Acked_Transitions (see BACnet specification DIN EN ISO 16484-5 for BACnet object Loop and property Acked_Transitions).

tObjectID: Object ID of the BACnet object (object type and object instance).

bError: An error is pending.

nErrorId: see global constants BACnet_Globals.

eMode: Output of controller mode. A distinction is made between two modes: 1. Standard form and 2. Ideal form (see E_BACNETLOOPMODE). The mode is detected automatically based on the parameter unit set for parameter I and/or D as "Time_seconds" → Standard form. If they are configured as factors "Other_no_units ", the mode "Ideal form" is detected. The Ideal form is a pure parallel connection of the 3 control variables (P, I and D). The Ideal form enables practice-oriented controller configuration since the parameters can be optimized without direct dependency. Control parameters can be deduced directly from the path behavior, for example.

VAR_IN_OUT

Device               : FB_BACnet_Device;

Device: Specification of the instance of the local corresponding BACnet server block. For each BACnet adapter one BACnet server is possible. See FB_BACnet_Adapter and FB_BACnet_Device for further information.

Controller configuration

The controller is configured using the following BACnet properties: Action, Proportional_Constant (P-factor), Integral_Constant (I-factor), Derivative_Constant (D-factor), Bias (output offset), Maximum_Output (maximum control output) and Minimum_Output (minimum control output). See BACnet specification DIN EN ISO 16484-5 for BACnet object Loop.

Determining the control parameters in Ideal form mode, using temperature control as an example:

Usually, the Standard form is used. To determine the control parameters in Standard form, the first step usually involves analyzing the step response of the path, followed in the second step by the control behavior for the purpose of optimization.