FB_HVACSetpointRamp

The function block generates a sliding setpoint ramp. This function block must be called in every PLC cycle, because the calculation for reaching the final setpoint depends on the TaskTime.
VAR_INPUT
eDataSecurityType : E_HVACDataSecurityType;
bSetDefault : BOOL;
bEnable : BOOL;
rSetpointIn : 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: 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: Enables the function block.
rSetpointIn: Setpoint to which the output rSetpointOut is regulated, depending on the absolute temperature change rSetpointSlide per time change tRampTime. Each change of the setpoint starts a new calculation of the setpoint to the target value of the ramp. The target value is the current value of rSetpointIn. The starting value of the ramp is the last value before the change of rSetpointIn to the new target value; see fig. 1.1.
The value range for rSetpointIn is specified by the parameters rMaxSetpoint and rMinSetpoint.
If no correct variable value is present at rSetpointIn, then the last valid variable value, if one exists, will be taken. If no valid last value exists, operation continues internally with rMinSetpoint. bInvalidParameter will be set in the event of an incorrect variable value; the function block continues to work normally.
bReset: Acknowledge input in the event of a fault.
VAR_OUTPUT
rSetpointOut : REAL;
tRemainingTime : TIME;
bValueReached : BOOL;
bInvalidParameter : BOOL;
rSetpointOut: Output of the ramp generator
tRemainingTime: Time duration in which the output rSetpointOut has reached the target value rSetpointIn.
bValueReached: A TRUE at this output indicates that the output rSetpointOut has reached the target value rSetpointIn.
bInvalidParameter: Indicates that an incorrect parameter is present at one of the variables rSetpointSlide or tRampTime. An incorrect parameter entry does not lead to a standstill of the block; see description of variables. After rectifying the incorrect parameter entry, the message bInvalidParameter must be acknowledged via bReset.
VAR_IN_OUT
rMinSetpoint : REAL;
rMaxSetpoint : REAL;
rSetpointSlide : REAL;
tRampTime : TIME;
rMinSetpoint/rMaxSetpoint: The value range for rSetpointIn is specified by the parameters rMaxSetpoint and rMinSetpoint (-10000..10000). rMaxSetpoint must be greater than rMinSetpoint.
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 will be set in the event of an incorrect parameter entry; the function block continues to work normally. The variable is saved persistently. Preset to 10 or 40 respectively.
rSetpointSlide: Absolute temperature change in [Kelvin/tRampTime] with which the output is converted in sliding steps from a lower to a higher value or from a higher to a lower value, see fig. 1.1
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 will be set in the event of an incorrect parameter entry; the function block continues to work normally. The variable is saved persistently. Preset to 1.
tRampTime: Ramp time (1s..24h) during which the final setpoint is reached in sliding steps, depending on the absolute temperature change rSetpointSlide, see fig. 1.1
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 will be set in the event of an incorrect parameter entry; the function block continues to work normally. The variable is saved persistently. Preset to 3600 s.
Fig. 1.1:

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 |