What is a limit switch in the HVAC


TS8000 | TwinCAT PLC Lib: HVAC


This function block is used to control two-point valves or two-point flaps.


Name: Type eDataSecurityType: E_HVACDataSecurityType; bSetDefault: BOOL; bEnable: BOOL; bIn: BOOL; eCtrlModeActuator: E_HVAC2PointActuatorMode; bManSwitch: BOOL; bLimitSwitchClose: BOOL; bLimitSwitchOpen: BOOL; bCtrlVoltage: BOOL; bReset: BOOL;

eDataSecurityType:If eDataSecurityType: = eHVACDataSecurityType_Persistent the persistent VAR_IN_OUT variables of the function block are stored in the computer's flash when the value changes. For this it is absolutely necessary to instantiate the function block FB_HVACPersistentDataHandling once in the main program, which is called cyclically. Otherwise the instantiated FB will not be released internally.

A value change can be made from the building management system, a local operating device or from write access from TwinCAT. When the computer is restarted, the saved data is automatically read back from the flash to the RAM.

Application example: Example_PERSISTENT.zip

With eDataSecurityType: = eHVACDataSecurityType_Idle the persistently declared variables are not saved in a non-volatile manner.

Danger A cyclically changing variable must never be connected to the IN_OUT variable of a function block if eDataSecurityType: = eHVACDataSecurityType_Persistent is. It would lead to premature wear of the flash memory.

bSetDefault: If the variable is TRUE, the default values ​​of the VAR_IN_OUT variables are adopted.

bEnable: With the input variable bEnablethe block is released by the PLC program. If the module is not released, the final control element always remains closed. The exit bOut is permanently FALSE.

bIn: In automatic mode, the final control element is closed using a FALSE and opened using a TRUE.

eCtrlModeActuator: Enum that defines the operating mode.

bManSwitch:If the two-point drive has a manual / emergency switch in the control cabinet, this can be connected to the input bManSwitch connected, so the status of the manual / emergency switch is monitored. At bManSwitch= FALSE becomes the exit bOut of the drive is set to FALSE.

bLimitSwitchClose: Control element feedback TRUE when the control element is completely closed.

bLimitSwitchOpen: Control element feedback TRUE when the control element is completely open.

bCtrlVoltage: The parameter bCtrlVoltage is used to control the control voltage. The control voltage is present when the variable bCtrlVoltageIs TRUE. If the control voltage fails, the feedback control is suppressed.

bReset: Acknowledgment input in the event of a fault.


Name: Type bOut: BOOL; byState: BYTE; eStateModeActuator: E_HVAC2PointActuatorMode; bErrorLimitSwitch: BOOL; bInvalidParameter: BOOL;

bOut: The final control element is connected to this output (FALSE = close; TRUE = open).

byState: Shows the status of the activation of the final control element:
byState.0: = Enable
byState.1: = Manual Switch
byState.2: = Enable Feedback Control
byState.3: = Control Voltage
byState.4: = Reset
byState.5: = bOut

eStateModeActuator: Shows which operating mode the final control element is in.

bErrorLimitSwitch: Becomes TRUE if no limit switch has triggered after the set travel time. bErrorLimitSwitch becomes with a positive edge at the input bResetacknowledged.

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


Name: Type Persistent Default Range bEnableLimitSwitch: BOOL; x tStrokeTime: TIME; x t # 200s 0 .. 3600

bEnableLimitSwitch: If the input is TRUE, the function check of the drive is activated by means of the limit switch.

tStrokeTime: For the correct setting of the function check, the travel time of the drive from the fully closed to the fully opened drive must be specified.