FB_BACnet_Loop

The following function block is used for linking a BACnet object of the local BACnet server. The function block for the corresponding BACnet object is linked with the aid of process data.

The process data can be created manually in the BACnet object, linked manually, or they can be generated automatically via PLC automapping. The comments required for PLC automapping ( (* ~ (BACnet... | ??? | ??? ) *) ) are already included in the declaration of the function block.

FB_BACnet_Loop 1:

Use

The function block "FB_BACnet_Loop" provides the object functionality for the BACnet stack. To this end the BACnet object was created under a local BACnet server. The BACnet object on the BACnet stack side (System Manager) serves as interface to the BACnet world. The control and therefore functionality of the BACnet object is provided by the PLC instance of the block "FB_BACnet_Loop".

This approach has the advantage that existing, customer-specific controllers from a PLC project can easily be linked with the BACnet world. Only the process data of the BACnet-Loop object have to be provided and processed.

The function block "FB_BACnet_Loop" of the TcBACnet-Lib contains a standard PID controller (FB_BACnet_PidControl) and therefore covers a wide range of control tasks.

FB_BACnet_Loop 2:
Fig. 1: Example of a BACnet-LOOP object under a local BACnet server.

VAR_INPUT

bEnable      : BOOL;

bEnable: Enables the control. FALSE at the input sets the state of BACnet object to Out_Of_Service (see BACnet specification DIN EN ISO 16484-5 for BACnet object Loop and property Out_Of_Service).

VAR_OUTPUT

bReady           : BOOL;
fSetPoint        : REAL;
fControlledValue : REAL;
fPresentValue    : REAL;
fPropBand        : REAL;
bOverridden      : BOOL;
bOutOfService    : BOOL;
bFault           : BOOL;
bInAlarm         : BOOL;
bOpenLoop        : BOOL;
bOtherFault      : BOOL;
bError           : BOOL;
nErrorId         : UINT;

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 System Manager.

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, bOtherFault: See BACnet specification DIN EN ISO 16484-5 for BACnet object Loop and property Reliability.

bError: An error is pending.

nErrorId: Error number
0 = no error
2 = incorrect process data mapping detected (check mapping in the System Manager; if necessary compile complete PLC project and reload)
3 = the corresponding BACnet server is not ready (bOperational = FALSE at instance of the FB_BACnet_Device)
The error numbers can be queried as block constants via the FB instance (FB_BACnet_???.nERR_xxx).

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.