Priority controller

This example shows the use of the function blocks ending with _5P (5 priorities). From the available 16 priorities of the BACnet standard, 5 priorities were selected, which are sufficient for building automation projects in most cases:

LifeSafety (1): For example, emergency shutdown

Critical Equipment Control (5): For example, frost protection

Manual Local Operator (7): For example on-site operation at the control cabinet

Manual Operator (8): For example operator at the BACnet management and operating level

PLC (15): Priority of the PLC program

The number in brackets indicates the default value of the priority. This can be changed globally in the BACnet_Param section of the Tc3_BACnetRev14 library.

The following boolean flags are available for controlling the priority:

bEnSfty: Override of the LifeSafety priority by the PLC program. The value is given by the variables fValSfty (analog), bValSfty (binary) and nValSfty (multistate).

bEnCrit: Override of the critical equipment priority. The value is given by the variables fValCrit (analog), bValCrit (binary) and nValCrit (multistate).

bEnManLoc: Override of the manual operator priority. The value is given by the variables fValManLoc (analog), bValManLoc (binary) and nValManLoc (multistate).

bEnPgm: PLC priority override. The value is given by the variables fValPgm (analog), bValPgm (binary) and nValPgm (multistate).

bEnManualOperator: Override of the operator priority. The value is given by the variables fValManualOperator (analog), bValManualOperator (binary) and nValManualOperator (multistate).

Priority controller 1:

This priority level is used in BACnet projects for access by the MBE (management operating equipment) and should therefore only be used if this access is not to be made on the part of BACnet or in the absence of an MBE.

Variables

// Analog objects supporting 5 priorities
fbAO5P : FB_BACnet_AO_5P;
fbAOIO5P : FB_BACnet_AO_IO5P;
fbAORaw5P : FB_BACnet_AO_RAW5P;
fbAV5P : FB_BACnet_AV_5P;

// Binary objects supporting 5 priorities
fbBO5P : FB_BACnet_BO_5P;
fbBOIO5P : FB_BACnet_BO_IO5P;
fbBORaw5P : FB_BACnet_BO_RAW5P;
fbBV5P : FB_BACnet_BV_5P;

// Multistate objects supporting 5 priorities
fbMO5P : FB_BACnet_MO_5P;
fbMOIO5P : FB_BACnet_MO_IO5P;
fbMORaw5P : FB_BACnet_MO_RAW5P;
fbMV5P : FB_BACnet_MV_5P;


Code

fbAO5P();
fbAOIO5P();
fbAORaw5P();
fbAV5P();
fbBO5P();
fbBOIO5P();
fbBORaw5P();
fbBV5P();
fbMO5P();
fbMOIO5P();
fbMORaw5P();

// example access to critical equipment control priority
fbMV5P.bEnCrit := TRUE;
fbMV5P.nValCrit := 3; // select state no. 3
fbMV5P();