FB_HVAC2PointCtrl

FB_HVAC2PointCtrl 1:

Application

This function block represents a 2-point controller. The controller is enabled via bEnable = TRUE and is then active.


VAR_INPUT

eDataSecurityType     : E_HVACDataSecurityType;
bSetDefault           : BOOL;                               
bEnable               : BOOL;                               
rW                    : REAL;
rX                    : REAL;
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_HVAC2PointCtrl 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 controller is enabled via a TRUE and is then active.

rW: The setpoint is transferred with the variable rW.

rX: the actual value of the control loop is transferred with the rX variable.

bReset: acknowledge input in the event of a fault.

VAR_OUTPUT

bOut                  : BOOL;              
bInvalidParameter     : BOOL;

bOut: switching output of the on-off controller.

bInvalidParameter: TRUE if an error occurs during the plausibility check. The message must be acknowledged with bReset.

VAR_IN_OUT

rHighLimit        : REAL;
rLowLimit         : REAL;
bDirection        : BOOL;
tDelayOn          : TIME;
tDelayOff         : TIME;

rHighLimit: upper limit of the control deviation (0..32767). The variable is saved persistently. Preset to 0.

rLowLimit: lower limit of the control deviation (0..32767). The variable is saved persistently. Preset to 0.

bDirection: the control direction of the controller is determined by bDirection. FALSE = heating mode;  TRUE = cooling mode. The variable is saved persistently. Preset to 0.

tDelayOn: switch-on delay [s]. The variable is saved persistently. Preset to 0 s.

tDelayOff: switch-off delay [s]. The variable is saved persistently. Preset to 0 s.

Timing characteristics

Figure 1:

Curve of switching output bOut for a on-off controller in relation to the upper/lower limits of the control deviation, with no switch-on or switch-off delay.

FB_HVAC2PointCtrl 3:

Figure 2:

Curve of switching output bOut for a on-off controller in relation to the upper limit rHighLimit = 3 and the lower limit rLowLimit = 8 with a switch-on delay of tDelayOn = 4 s and a switch-off delay of tDelayOff = 6 s.

FB_HVAC2PointCtrl 4: