FB_HVACRedundancyCtrl
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.
To determine the running times, the function block FB_HVACWork is instantiated internally and the IN-OUT variables are passed on externally (rHours and uiCount). The recording of the operating time is controlled by the Feedback inputs. If no feedback signal from the actuator is available, the actuator output must be fed back to the feedback input.
VAR_INPUT
VAR_INPUT
eDataSecurityType : E_HVACDataSecurityType;
bSetDefault : BOOL;
iCountCtrl : INT;
bEn1 - bEn8 : BOOL;
bFeedBack1 - bFeedBack8 : BOOL;
bForceChange : BOOL;
dtSystemTime : DT;
bSysTakt1Hz : BOOL;
bResetAllHours : BOOL;
bResetAllCounter : BOOL;
bReset : BOOL;
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: 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 (0..8).
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.
dtSystemTime: system time.
bSysTakt1Hz: 1 Hz clock signal as a replacement for dtSystemTime; if dtSystemTime is not available, or does not change its value for longer than 2 s, then the clock signal is used as a replacement.
bResetAllHours: resets all operating hours counters.
bResetAllCounter: resets all switch-on counters.
bReset: acknowledge input in the event of a fault.
VAR_IN_OUT
rHours : REAL;
uiCount : UINT;
tOverlap1Actuator : TIME;
uiMaxOnLevel : UINT;
tNoFeedbActuator : TIME;
rHours[1..8]: operating hours [h] with a resolution of 1/100 hours (internally with 1 s). The variable is saved persistently.
uiCount[1..8]: switch-on cycle counter. The variable is saved persistently.
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 [h] 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;
eErrorCode : E_HVACErrorCodes;
bErrorGeneral : BOOL;
bInvalidParameter : BOOL;
bQ1 - 8: actuator on signal.
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.