FB_HVACMotor1Speed

This function block serves to control a single-stage drive in HVAC systems. It is suitable for fans.
VAR_INPUT
eDataSecurityType : E_HVACDataSecurityType;
bSetDefault : BOOL;
bEnable : BOOL;
bAuto : BOOL;
eCtrlModeActuator : E_HVACActuatorMode;
bMotorProtec : BOOL;
bFeedbContactor : BOOL;
bFeedbProcess : BOOL;
bRepairSwitch : BOOL;
bManSwitch : BOOL;
bCtrlVoltage : 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, the drive will be switched off via the specified time variable tStopDelay.
bAuto: bAuto is then only active if the operation mode eCtrlModeActuator is set either to eHVACActuatorMode_Auto_BMS or to eHVACActuatorMode_Auto_OP.
If the input variable bAuto = TRUE, the function block will be instructed that the drive is to run. If bAuto = FALSE, the drive will be switched off with a delay via the specified time variable tStopDelay.
eCtrlModeActuator: Enum that specifies the operation mode of the motor (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.
bMotorProtec: Input for the motor protection switch. There is a motor protection switch error if the input bMotorProtec = FALSE (quiescent current principle). In the event of a fault, the output bMotor = FALSE; the fault is indicated at the output of the function block by bErrorMotorprotec. The motor can only be restarted if the fault has been rectified and acknowledged at the input bReset.
bFeedbContactor: Feedback for the power section of the motor. The operating feedback is present if the input bFeedbContactor = TRUE. If, after switching on the motor, this feedback is not present after the time delay set by tDelayFeedbContactor, the output bErrorFeedbContactor is set in order to indicate the fault. The output bMotor becomes FALSE in the event of a fault. The motor can only be restarted if the fault has been rectified and acknowledged at the input bReset. If no feedback from the power section of the motor is present, the output variable bMotor must be applied to the input bFeedbContactor.
![]() | If no feedback from the power section of the motor is present, the output variable bMotor must be applied to the input bFeedbContactor. |
bFeedbProcess: A process feedback signal, for example from a v-belt monitor or a flow monitor can be connected to the input bFeedbProcess. The process feedback is present if the input bFeedbProcess = TRUE (quiescent current principle). If, in the start-up phase after switching on the motor, the process feedback is not present after the time set by tFeedbProcessTimer, the drive switches off and indicates a fault at the output bErrorFeedbProcess. The motor can only be restarted if the fault has been rectified and acknowledged at the input bReset. In order to avoid undesired switching off of the drive during operation due to the process monitoring, e.g. in the event of short-term pressure fluctuations, the triggering of the input bFeedbProcess can be delayed by the time tDelayFeedbProcess.
bRepairSwitch: The state of the repair switch is monitored with the input bRepairSwitch. The motor can only be switched on if bRepairSwitch= TRUE (quiescent current principle). If the repair switch is switched off, bRepairSwitch = FALSE and the output bMotor becomes FALSE.
bManSwitch: The state of the manual/emergency switch is monitored with the input bManSwitch. The motor can only be switched on if bManSwitch = TRUE (quiescent current principle). If the manual/emergency switch is switched off, bManSwitch = FALSE and the output bMotor becomes FALSE.
bCtrlVoltage: The state of the control voltage is monitored with the input bCtrlVoltage. The motor can only be switched on if bCtrlVoltage = TRUE (quiescent current principle). If the control voltage is switched off, bCtrlVoltage = FALSE and the output bMotor becomes FALSE. In order to avoid a torrent of error messages if the control voltage fails, the error messages of the function block are suppressed. If the control voltage is restored, the error messages are enabled again.
bReset: Acknowledge input in the event of a fault.
VAR_OUTPUT
bMotor : BOOL;
byState : BYTE;
bStateAuto : BOOL;
bStateRepairSwitch : BOOL;
bStateManSwitch : BOOL;
eStateModeActuator : E_HVACActuatorMode;
bErrorGeneral : BOOL;
byError : BYTE;
bErrorMotorprotec : BOOL;
bErrorFeedbContactor : BOOL;
bErrorFeedbProcess : BOOL;
bInvalidParameter : BOOL;
bMotor: Output variable for controlling a single-speed motor.
byState: Status byte indicating the operating state of the function block.
byState.0 := bEnable;
byState.1 := bMotor;
byState.2 := bStateAuto;
byState.5 := bStateRepairSwitch;
byState.6 := bStateManSwitch;
byState.7 := bCtrlVoltage;
bStateAuto: Indicates the state for automatic preselection if the operation mode eCtrlModeActuator is either eHVACActuatorMode_Auto_BMS or eHVACActuatorMode_Auto_OP and stage 1 was activated via the input variable bAuto.
bStateRepairSwitch: Indicates the state of the repair switch. TRUE indicates that the repair switch is switched off.
bStateManSwitch: Indicates the state of the manual/emergency switch. A TRUE signals that the manual/emergency operating level is activated.
eStateModeActuator: Enum via which the state of the operation mode of the motor is fed back to the controller (see E_HVACActuatorMode).
bErrorGeneral: The error message bErrorGeneral becomes TRUE as soon as one of the error messages bErrorMotorprotec, bErrorFeedbContactor or bErrorFeedbProcess = TRUE. The output bMotor is then set to FALSE and is only enabled again when the fault has been rectified and acknowledged via bReset.
byError: Delivers all error messages and warnings from the function block.
byError.1 := bInvalidParameter;
byError.2 := bErrorGeneral;
byError.3 := bErrorMotorprotec;
byError.4 := bErrorFeedbContactor;
byError.5 := bErrorFeedbProcess;
bErrorMotorprotec: Motor protection switch error, see input variable bMotorProtec.
bErrorFeedbContactor: Power section feedback error, see input variable bFeedbContactor.
![]() | If no feedback from the power section of the motor is present, the output variable bMotor must be applied to the input bFeedbContactor. |
bErrorFeedbProcess: Process feedback error, see input variable bFeedbackProcess.
bInvalidParameter: Indicates that an incorrect parameter is present at one of the variables eCtrlModeActuator, tStartDelay, tStopDelay, tDelayFeedbContactor, tFeedbProcessTimer or tDelayFeedbProcess. An incorrect parameter specification 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
tStartDelay : TIME;
tStopDelay : TIME;
tDelayFeedbContactor : TIME;
tFeedbProcessTimer : TIME;
tDelayFeedbProcess : TIME;
tStartDelay: The start-up of the motor after enabling and switching on via the operation mode of the motor is delayed by the time tStartDelay [s] (0s..3600s). The variable is saved persistently. Preset to 0 s.
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.
tStopDelay: The switching off of the motor via the operation mode of the motor is delayed by the time tStopDelay [s] (0s..3600s). The variable is saved persistently. Preset to 0 s.
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.
tDelayFeedbContactor: Time delay [ms] of the feedback of the power section after switching on the motor. If this time has elapsed and bFeedbContactor = FALSE, then this is fed back to the controller via the error message bErrorFeedbContactor (100ms..3600ms). The variable is saved persistently. Preset to 100 ms.
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.
tFeedbProcessTimer: Time delay of the process feedback bFeedbProcess [s] after switching on the motor. If this time has elapsed and bFeedbProcess = FALSE, then this is fed back to the controller via the error message bErrorFeedbProcess (0s..3600s). The variable is saved persistently. Preset to 0 s.
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.
tDelayFeedbProcess: In order to avoid undesired switching off of the drive during operation due to the process monitoring bFeedbProcess, e.g. in the event of short-term pressure fluctuations, the response of the input bFeedbProcess can be delayed by the time tDelayFeedbProcess [s] (0s..3600s). The variable is saved persistently. Preset to 0 s.
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.
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 |