FB_HVACCmdCtrlSystem2Stage

This function block FB_HVACCmdCtrlSystem2Stage is a system switch. It is used, for example, to switch a two-stage ventilation system to automatic or manual operation mode. In automatic operation mode the system can be controlled via a timer program or via the request from a control panel. The FB_HVACCmdCtrlSystem2Stage function block is active if the input variable bEnable is TRUE and eCtrlModeActuator = eHVACActuatorMode_Auto_BMS or eHVACActuatorMode_Auto_OP.
VAR_INPUT
eDataSecurityType : E_HVACDataSecurityType;
bSetDefault : BOOL;
bEnable : BOOL;
eCtrlModeActuator : E_HVACActuatorMode;
bExternalRequest1 : BOOL;
bExternalRequest2 : BOOL;
bTimeScheduler1 : BOOL;
bTimeScheduler2 : 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.
bEnable: The function block is enabled if bEnable = TRUE. If bEnable = FALSE, then bOn1 and bOn2 are also FALSE.
eCtrlModeActuator: Enum that specifies the system operation modes Manual, Auto and Off (see E_HVACActuatorMode). If specified incorrectly, operation continues internally with the last valid operation mode. This is eHVACActuatorMode_Auto_BMS in the case of initial commissioning. bInvalidParameter is set in the case of an incorrect parameter specification.
bExternalRequest1: External request for the system in stage 1, e.g. from a control panel via a button or switch.
bExternalRequest2: External request for the system in stage 2, e.g. from a control panel via a button or switch.
bTimeScheduler1: Request for the system in stage 1 via a timer program.
bTimeScheduler2: Request for the system in stage 2 via a timer program.
bReset: Acknowledge input in the event of an error.
VAR_OUTPUT
bOn1 : BOOL;
bOn2 : BOOL;
eStateModeActuator : E_HVACActuatorMode;
bRequestScheduler1 : BOOL;
bRequestScheduler2 : BOOL;
bRequestExternal1 : BOOL;
bRequestExternal2 : BOOL;
bInvalidParameter : BOOL;
bOn1: The system is enabled for stage 1 by this output variable.
bOn2: The system is enabled for stage 2 by this output variable. If stage 2 is enabled, then stage 1 is automatically also enabled.
eStateModeActuator: Enum via which the state of the operation mode of the motor is fed back to the controller (see E_HVACActuatorMode).
bRequestScheduler1: This output indicates that the system is requested by the input variable bTimeScheduler1.
bRequestScheduler2: This output indicates that the system is requested by the input variable bTimeScheduler2.
bRequestExternal1: This output indicates that the system is requested by the input variable bExternalRequest1.
bRequestExternal2: This output indicates that the system is requested by the input variable bExternalRequest2.
bInvalidParameter: Indicates that an incorrect parameter is present at one of the variables eCtrlModeActuator,ePlantMode or eExternalRequestMode. An incorrect parameter entry does not lead to a standstill of the function block; see description of variables. After rectifying the incorrect parameter entry, the message bInvalidParameter must be acknowledged via bReset.
VAR_IN_OUT
ePlantMode : E_HVACPlantMode;
eExternalRequestMode: E_HVACExternalRequestMode;
tOffDelay1 : TIME;
tOffDelay2 : TIME;
ePlantMode: With this enumeration variable various system functions can be executed in automatic operation mode, depending on the input variables bExternalRequest1, bExternalRequest2, bTimeScheduler1 and bTimeScheduler2 (see E_HVACPlantMode).
ePlantMode = eHVACPlantMode_TimeSchedulingOnly: The system is switched to the respective stage exclusively via the input variables bTimeScheduler1 or bTimeScheduler2.
ePlantMode = eHVACPlantMode_TimeScheduling_And_ExternalRequest: The system is switched to stage 1 if the input variables bTimeScheduler1 AND bExternalRequest1 are both TRUE. If the input variables bTimeScheduler2 AND bExternalRequest2 are both TRUE, the system is switched to stage 2.
ePlantMode = eHVACPlantMode_TimeScheduling_Or_ExternalRequest: The system is switched to the respective stage via the input variables bExternalRequest1, bExternalRequest2 OR bTimeScheduler1, bTimeScheduler2.
ePlantMode = eHVACPlantMode_ExternalRequestOnly: The system is switched to the respective stage exclusively via the input variable bExternalRequest1 or bExternalRequest2.
If an incorrect variable value is present, then the last valid variable value, if one exists, will be taken. If there is no valid last value, operation continues with the default value. bInvalidParameter is set in the case of an incorrect parameter specification.
The variable is saved persistently. Preset to 0.
eExternalRequestMode: The enum eExternalRequestMode specifies the mode of operation of the input variables bExternal Request1 and bExternalRequest2 in automatic operation mode, depending on the enum ePlantMode (see E_HVACExternalRequestMode).
eExternalRequestMode = eHVACExternalRequestMode_ButtonOn_Off: The external request is set to TRUE following a rising edge on bExternalRequest1 or bExternalRequest2. A further rising edge resets the request to FALSE.
eExternalRequestMode = eHVACExternalRequestMode_ButtonOffDelay. Following a rising edge on the input variable bExternalRequest1 or bExternalRequest2, the external request extends or sets the utilization time of the system in the respective stage by the time setting of tOffDelay1 or tOffDelay2.
eExternalRequestMode = eHVACExternalRequestMode_SwitchOn_Off: The external request is active if bExternalRequest1 or bExternalRequest2 = TRUE. It is deactivated if bExternalRequest1 or bExternalRequest2 = FALSE.
If no correct variable value is present, then the last valid variable value, if one exists, will be taken. If there is no valid last value, operation continues with the default value. bInvalidParameter is set in the case of an incorrect parameter specification.
The variable is saved persistently. Preset to 0.
tOffDelay1: Time value for the extension of the system utilization time in stage 1. The extension of the utilization time can only be activated if eModeExternalRequest = 2. The variable is saved persistently. Preset to 30 min.
tOffDelay2: Time value for the extension of the system utilization time in stage 2. The extension of the utilization time can only be activated if eModeExternalRequest = 2. The variable is saved persistently. Preset to 30 min.
Behavior of the output value
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 |