FB_HVACRedundancyCtrl
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 bForceChange. 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 shock in the pumps, an overlap time can be set via tOverlap1Actuator. This applies only to cases where an exchange between two actuators takes place.
In order to determine the runtimes, the function block FB_HVACWork is instanced internally and the IN-OUT variables are relayed to the outside (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
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 hour meters.
bResetAllCounter: Resets all switch-on meters.
bReset: Acknowledge input in the event of a fault.
VAR_OUTPUT
bQ1 - bQ8 : BOOL;
eErrorCode : E_HVACErrorCodes;
bErrorGeneral : BOOL;
bInvalidParameter : BOOL;
bQ1 - 8: Actuator feedback.
eErrorCode: Indicates which actuator has not returned an operating feedback within the prespecified time interval (see E_HVACErrorCodes). The recognition of this group of errors 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 has occurred during the plausibility check. The message must be acknowledged with bReset.
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.
Requirements
Development environment | required library | required function |
---|---|---|
TwinCAT 3.1 build 4022.16 or higher | Tc2_HVAC V3.3.1.0 | TF8000 | TC3 HVAC V1.0.0.0 |