FB_HVACCmdCtrlSystem1Stage

FB_HVACCmdCtrlSystem1Stage 1:

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: 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 is 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.

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 (see E_HVACActuatorMode).

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 system functions can be executed in automatic mode, depending on the input variables bExternalRequest and bTimeScheduler (see E_HVACPlantMode).
ePlantMode = eHVACPlantMode_TimeSchedulingOnly: The system is switched on and off exclusively via the input variable bTimeScheduler.
ePlantMode = eHVACPlantMode_TimeScheduling_And_ExternalRequest: The system is switched on if the input variables bTimeScheduler AND bExternalRequest are TRUE.
ePlantMode = eHVACPlantMode_TimeScheduling_Or_ExternalRequest: The system is switched on via the input variable bTimeScheduler OR bExternalRequest.
ePlantMode = eHVACPlantMode_ExternalRequestOnly: The system is switched on and off exclusively via the input variable bExternalRequest.

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.

eExternalRequestMode: The enum eExternalRequestMode specifies the mode of operation of the input variable bExternalRequest in automatic 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 bExternalRequest. A further rising edge resets the request to FALSE.
eExternalRequestMode
= eHVACExternalRequestMode_ButtonOffDelay: Following a rising edge on the input variable bExternalRequest, the external request extends or sets the utilization time of the system by the time setting 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, 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.

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 2:

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:

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