FB_HVACCmdCtrlSystem2Stage
Application
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 function block FB_HVACCmdCtrlSystem2Stage 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 = FALSE.
eCtrlModeActuator: enum that specifies the system operation modes Manual, Auto and Off. In the event of an incorrect entry, operation continues internally with the last valid operating mode. This is eHVACActuatorMode_Auto_BMS in the case of initial commissioning. bInvalidParameter will be set in the event of an incorrect parameter entry.
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: this output variable enables the system for stage 1.
bOn2: this output variable enables the system for stage 2. 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.
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: this enumeration variable can be used to perform various functions of the plant in automatic mode depending on the input variables bExternalRequest1, bExternalRequest2, bTimeScheduler1 and bTimeScheduler2.
ePlantMode = eHVACPlantMode_TimeSchedulingOnly: the plant is switched on exclusively via the input variables bTimeScheduler1 or bTimeScheduler2into the respective stage.
ePlantMode = eHVACPlantMode_TimeScheduling_And_ExternalRequest: the plant is switched on in stage 1 if the input variables bTimeScheduler1 AND bExternalRequest1 = TRUE. If the input variables bTimeScheduler2 AND bExternalRequest2 = TRUE, the plant is switched on in stage 2.
ePlantMode = eHVACPlantMode_TimeScheduling_Or_ExternalRequest: the plant is switched on in the respective stage via the input variables bExternalRequest1, bExternalRequest2, OR bTimeScheduler1, bTimeScheduler2.
ePlantMode = eHVACPlantMode_ExternalRequestOnly: the plant is switched on exclusively via the input variable bExternalRequest1or bExternalRequest2 into the respective stage.
If an incorrect variable value is present, the last valid variable value is used, if available. If there is no valid last value, operation continues with the default value. bInvalidParameter will be set in the event of an incorrect parameter entry.
The variable is saved persistently. Preset to 0.
eExternalRequestMode: the enum eExternalRequestMode defines the mode of operation of the input variable bExternalRequest1 and bExternalRequest2 in automatic mode depending on the enum ePlantMode.
eExternalRequestMode = eHVACExternalRequestMode_ButtonOn_Off: the external request is set to TRUE after a rising edge of bExternalRequest1 or bExternalRequest2. Another rising edge resets the request to FALSE again.
eExternalRequestMode = eHVACExternalRequestMode_ButtonOffDelay. The external request extends or sets the utilization time of the plant in the respective stage after a rising edge at the input variable bExternalRequest1 or bExternalRequest2 by the set time 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 an incorrect variable value is present, then the last valid variable value is used, if available. If there is no valid last value, operation continues with the default value. bInvalidParameter will be set in the event of an incorrect parameter entry.
The variable is saved persistently. Preset to 0.
tOffDelay1: time value for the utilization time extension of the plant in stage 1. The utilization time extension can only be activated if eModeExternalRequest = 2. The variable is saved persistently. Preset to 30 min.
tOffDelay2: time value for the utilization time extension of the plant in stage 2. The utilization time extension can only be activated if eModeExternalRequest = 2. The variable is saved persistently. Preset to 30 min.
Behavior of the output value