FB_HVACAnalogOutputEx
Application
This function block is used to control continuous actuators such as valves or dampers with a positional feedback.
Compared to FB_HVACAnalogOutput, a scaling function is integrated in this function block. The function is: y=m*x +b.
Application example:
Damper actuator operating range 2-10 V with the KL4404 (signal voltage 0-10 V)
rX1 = 0 iY1 = 6553
rX2 = 100 iY2 = 32767
VAR_INPUT
eDataSecurityType : E_HVACDataSecurityType;
bSetDefault : BOOL;
bEnable : BOOL;
rSetpoint : REAL;
bCtrlVoltage : BOOL;
eCtrlModeAnalogOutput: E_HVACAnalogOutputMode;
rYManual : REAL;
rFeedb : REAL;
bFrost : 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 the function block is not enabled the value zero is output at the output rY.
rSetpoint: the setpoint for the analog output is transferred to the function block with the variable rSetpoint.
bCtrlVoltage: the control voltage is present if the bCtrlVoltage variable is TRUE. The feedback control is deactivated in the event of failure of the control voltage so that no false alarms occur.
eCtrlModeAnalogOutput: Enum that defines the operation mode.
TYPE E_HVACAnalogOutputMode :
(
eHVACAnalogOutputMode_Auto_BMS := 0,
eHVACAnalogOutputMode_Manual_BMS := 1,
eHVACAnalogOutputMode_Auto_OP := 2,
eHVACAnalogOutputMode_Manual_OP := 3
);
END_TYPE
rYManual: analog input value, which is relayed to the output rY in manual mode.
rFeedb: analog position feedback from the actuator.
bFrost: this input serves to protect an air heater against frost. As soon as the input bFrost is TRUE, rY is set to the maximum size (rRangeHigh) and iYTerminal to 32767. The outputs rY and iYTerminal remain set until the input bFrost is FALSE again.
bReset: acknowledge input in the event of a fault.
VAR_OUTPUT
rY : REAL;
iYTerminal : INT;
eStateModeAnalogOutput : E_HVACAnalogOutputMode;
bManualMode : BOOL;
byState : BYTE;
bErrorFeedb : BOOL;
bErrorGeneral : BOOL;
byError : BYTE;
bInvalidParameter : BOOL;
rY: indicates the current magnitude of the control signal in % (0%..100%).
iYTerminal: represents the size of the output signal scaled to the value range 0 to 32767.
eStateModeAnalogOutput: Enum that indicates the operation mode.
bManualMode: the analog output is in manual operation mode.
byState: status byte indicating the operating state of the function block.
byState.0 := bEnable;
byState.1 := bManualMode;
byState.2 := bFrost;
byState.7 := bCtrlVoltage;
bErrorFeedb: error feedback signal.
bErrorGeneral: this is a collective message for all function block errors.
byError: supplies all error messages and warnings.
byError.1 := bInvalidParameter
byError.2 := bErrorGeneral
byError.3 := bErrorFeedb
bInvalidParameter: TRUE if an error occurs during the plausibility check. The message must be acknowledged with bReset.
VAR_IN_OUT
rX2 : REAL;
rX1 : REAL;
iY2 : INT;
iY1 : INT;
bDirection : BOOL;
bEnableFeedbCtrl : BOOL;
rHysteresisFeedbCtrl : REAL;
tDelayFeedbCtrl : TIME;
rX2: upper limit value on the X axis (-32767..32767). The variable is saved persistently.
rX1: lower limit value on the X axis (-32767..32767). The variable is saved persistently.
rY2: upper limit value on the Y axis (0..32767). The variable is saved persistently.
rY1: lower limit value on the Y axis (0..32767). The variable is saved persistently.
bDirection: the output signal of rY is inverted by the variable bDirection. FALSE corresponds to the direct control direction. The variable is saved persistently.
bEnableFeedbCtrl: continuous actuators often have positional feedback. The function of the actuator is monitored by means of the positional feedback. Positional feedback monitoring is activated if the variable bEnableFeedbCtrl is TRUE. The variable is saved persistently.
rHysteresisFeedbCtrl: due to the stroke time of typical drives used in heating and air conditioning systems, the feedback signal always lags in the case of a setpoint step-change for the position of the actuator. Using the variable rHysteresisFeedbCtrl, a range is specified within which the position setpoint rY of the actuator may deviate from the feedback signal (0..32767). The variable is saved persistently.
tDelayFeedbCtrl: if the difference between the set position and the actual position of the actuator is greater than +/- rHysteresisFeedbCtrl, then the response of the output bErrorFeedb is delayed by the time of the timer tDelayFeedbCtrl (0s..50s). The variable is saved persistently.