FB_HVACRedundancyCtrlEx

FB_HVACRedundancyCtrlEx 1:

Application

This function block serves to control a certain number of actuators, e.g. of pumps, from a pool of 8 actuators. From all enabled actuators, the logic searches for those with the shortest runtimes and switches them on according to the runtime order. This continues until the number specified via iCountCtrl is reached. The actuators are routed internally via a FIFO memory so that they can be switched off again in the same order. Changeover during operation can be performed with the time specification uiMaxOnLevel or by the trigger bForceChnage. The actuator that has been switched on longest is switched off, and the one with the shortest runtime is switched on. In order to avoid a hydraulic stroke in the pumps, an overlap time can be set via tOverlap1Actuator. This time is only valid for the case when a change between two actuators takes place.
In contrast to the FB_HVACRedundancyCtrl no internal timer is used for the determination of the running times, but the times must be applied as hourly values from outside as Var_Input.

VAR_INPUT

eDataSecurityType       : E_HVACDataSecurityType;
bSetDefault             : BOOL;
iCountCtrl              : INT;
bEn1 - bEn8             : BOOL;
bFeedBack1 - bFeedBack8 : BOOL;
bForceChange            : BOOL;
rHours1-rHours8         : REAL;

eDataSecurityType:if eDataSecurityType:= eHVACDataSecurityType_Persistent, the persistent VAR_IN_OUT variables of the function block are stored in the flash of the computer if a value changes. For this to work, the function block FB_HVACPersistentDataHandling must be instanced once in the main program, which is called cyclically. Otherwise the instanced FB is not released internally.

A change of value can be initiated by the building management system, a local operating device or via a write access from TwinCAT. When the computer is restarted, the saved data are automatically read back from the flash into the RAM.

Application example: FB_HVACRedundancyCtrlEx 2:Example_PERSISTENT.zip

If eDataSecurityType:= eHVACDataSecurityType_Idle the persistently declared variables are not saved in a fail-safe manner.

Notice

A cyclically changing variable must never be linked with the IN_OUT variable of a function block, if eDataSecurityType:= eHVACDataSecurityType_Persistent. It would lead to early wear of the flash memory.

bSetDefault: If the variable is TRUE, the default values of the VAR_IN_OUT variables are adopted.

iCountCtrl : number of actuators to be switched on

bEn1 - 8: enables the corresponding actuator.

bFeedBack1 - 8: operating feedback from the actuator. Evaluation only takes place if tNoFeedbActuator > t#0s .

bForceChange: a positive edge at the input switches off the first actuator in the FIFO and switches on the actuator from the pool that has the shortest runtime.

rHours: operating hours

VAR_IN_OUT

tOverlap1Actuator  : TIME;
uiMaxOnLevel       : UINT;
tNoFeedbActuator   : TIME;

tOverlap1Actuator: overlap time for the case where an exchange between two actuators takes place (0ms..1min). The variable is saved persistently. Preset to 20 s.

uiMaxOnLevel: max. time in hours that an actuator may be switched on (0h..1000h). Forces an actuator change only if an actuator is available to be switched on. The variable is saved persistently. Preset to 200 h.

tNoFeedbActuator: time that is allowed to elapse before the lack of an operating feedback from the actuator leads to bErrorGeneral = TRUE (0ms..60s). There is no evaluation if the time = 0. The variable is saved persistently. Preset to 3 s

VAR_OUTPUT

bQ1 - bQ8         : BOOL;
arrFiFo           : Array[1..8] of INT;
eErrorCode        : E_HVACErrorCodes;
bErrorGeneral     : BOOL;
bInvalidParameter : BOOL;

bQ1 - 8: actuator on signal.

arrFiFo: table containing the information showing which actuator is switched on (actuator number). The order specifies the switch-off sequence. arFifo[1] = no. of the actuator that will be switched off next.

eErrorCode: indicates which actuator has not returned an operating feedback within the prespecified timespan. The detection of this error group is activated by a time greater than 0 in the variable tNoFeedbActuator. eHVACErrorCodes_Error_NoFeedbackActuator1 := 15,
eHVACErrorCodes_Error_NoFeedbackActuator2 := 16,
eHVACErrorCodes_Error_NoFeedbackActuator3 := 17,
eHVACErrorCodes_Error_NoFeedbackActuator4 := 18,
eHVACErrorCodes_Error_NoFeedbackActuator5 := 19,
eHVACErrorCodes_Error_NoFeedbackActuator6 := 20,
eHVACErrorCodes_Error_NoFeedbackActuator7 := 21,
eHVACErrorCodes_Error_NoFeedbackActuator8 := 22,

bErrorGeneral: error during evaluation of the operating feedback.

bInvalidParameter: TRUE if an error occurs during the plausibility check. The message must be acknowledged with bReset.