FB_HVACCmdCtrlSystem1Stage

FB_HVACCmdCtrlSystem1Stage 1:

Application

This function block FB_HVACCmdCtrlSystem1Stage is a system switch. It is used, for example, to switch a single-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_HVACCmdCtrlSystem1Stage 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;
bExternalRequest  : BOOL;
bTimeScheduler    : 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: FB_HVACCmdCtrlSystem1Stage 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.

bEnable: the function block is enabled if bEnable = TRUE. If bEnable = FALSE, then bOn = 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.

bExternalRequest: external request for the system, e.g. from a control panel via a button or switch.

bTimeScheduler: request for the system via a timer program.

bReset: acknowledge input in the event of an error

VAR_OUTPUT

bOn               : BOOL;
eStateModeActuator: E_HVACActuatorMode;
bRequestScheduler : BOOL;
bRequestExternal  : BOOL;
bInvalidParameter : BOOL;

bOn: this output variable enables the system.

eStateModeActuator: Enum via which the state of the operation mode of the motor is fed back to the controller.

bRequestScheduler: this output indicates that the system is requested by the input variable bTimeScheduler.

bRequestExternal: this output indicates that the system is requested by the input variable bExternalRequest.

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;
tOffDelay            : TIME;

ePlantMode: with this enumeration variable various functions of the system can be performed in automatic operation mode, depending on the input variables bExternalRequest and bTimeScheduler.
ePlantMode = eHVACPlantMode_TimeSchedulingOnly: the plant is switched on and off exclusively via the input variable bTimeScheduler.
ePlantMode = eHVACPlantMode_TimeScheduling_And_ExternalRequest: the plant is switched on if the input variables bTimeScheduler AND bExternalRequest = TRUE.
ePlantMode = eHVACPlantMode_TimeScheduling_Or_ExternalRequest: the plant is switched on by the input variables bTimeScheduler OR bExternalRequest.
ePlantMode = eHVACPlantMode_ExternalRequestOnly: the plant is switched on and off exclusively via the input variable bExternalRequest.
If an incorrect variable value is present, the last valid variable value, if available, is used. 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 bExternalRequest in automatic mode depending on the enum ePlantMode.
eExternalRequestMode = eHVACExternalRequestMode_ButtonOn_Off: the external request is set to TRUE after a rising edge of bExternalRequest. Another rising edge resets the request to FALSE again.
eExternalRequestMode
= eHVACExternalRequestMode_ButtonOffDelay: the external request extends or sets the utilization time of the plant after a rising edge at the input variable bExternalRequest by the set time of tOffDelay.
eExternalRequestMode = eHVACExternalRequestMode_SwitchOn_Off: the external request is active if bExternalRequest = TRUE. It is deactivated if bExternalRequest = 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.

tOffDelay: time value for the extension of the system utilization time. 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

FB_HVACCmdCtrlSystem1Stage 3:

FB_HVACCmdCtrlSystem1Stage 4:

FB_HVACCmdCtrlSystem1Stage 5:

FB_HVACCmdCtrlSystem1Stage 6:

FB_HVACCmdCtrlSystem1Stage 7:

FB_HVACCmdCtrlSystem1Stage 8:

FB_HVACCmdCtrlSystem1Stage 9:

FB_HVACCmdCtrlSystem1Stage 10:

FB_HVACCmdCtrlSystem1Stage 11:

FB_HVACCmdCtrlSystem1Stage 12:

FB_HVACCmdCtrlSystem1Stage 13:

FB_HVACCmdCtrlSystem1Stage 14: