FB_HVACMotor3Speed

This function block serves to control a three-speed drive in HVAC systems. The function block always runs in stage 1, the lowest power stage, and switches to stage 2 or stage 3 depending on requirements. It cannot be switched on directly in stage 2 or 3. In the event of a restart, disablement, an error or switching off of the motor via the operation mode, restart of the motor is blocked for the duration of tDelaySpeed2ToSpeed1 + tDelaySpeed3ToSpeed2.
VAR_INPUT
eDataSecurityType : E_HVACDataSecurityType;
bSetDefault : BOOL;
bEnable : BOOL;
bAutoSpeed1 : BOOL;
bAutoSpeed2 : BOOL;
bAutoSpeed3 : BOOL;
eCtrlModeActuator : E_HVACActuatorMode;
bMotorProtecSpeed1 : BOOL;
bMotorProtecSpeed2 : BOOL;
bMotorProtecSpeed3 : BOOL;
bFeedbContactorSpeed1 : BOOL;
bFeedbContactorSpeed2 : BOOL;
bFeedbContactorSpeed3 : 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 in the respective switch-on stage with a delay via the specified time variable tStopDelay.
If an enable is present, a restart of the motor is blocked for the duration of tDelaySpeed2ToSpeed1 + tDelaySpeed3ToSpeed2.
bAutoSpeed1: bAutoSpeed1 is then only active if the operation mode eCtrlModeActuator is either eHVACActuatorMode_Auto_BMS or eHVACActuatorMode_Auto_OP.
If the input variable bAutoSpeed1 is TRUE and the input variables bAutoSpeed2 and bAutoSpeed3 are FALSE, then the function block is instructed that the drive should run at speed 1.
If bAutoSpeed1 = FALSE, the drive will be switched off with a delay via the specified time variable tStopDelay.
bAutoSpeed2: bAutoSpeed2 is then only active if the operation mode eCtrlModeActuator is either eHVACActuatorMode_Auto_BMS or eHVACActuatorMode_Auto_OP.
If the input variables bAutoSpeed1 and bAutoSpeed2 are TRUE and the input variable bAutoSpeed3 is FALSE, then the function block is instructed that the drive should run at speed 2.
If bAutoSpeed1 and bAutoSpeed2 are both FALSE, the drive will be switched off with a delay via the specified time variable tStopDelay.
bAutoSpeed3: bAutoSpeed3 is then only active if the operation mode eCtrlModeActuator is either eHVACActuatorMode_Auto_BMS or eHVACActuatorMode_Auto_OP.
If the input variables bAutoSpeed1, bAutoSpeed2 and bAutoSpeed3 are TRUE, then the function block is instructed that the drive should run at speed 3.
If bAutoSpeed1, bAutoSpeed2 and bAutoSpeed3 are all 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.
bMotorProtecSpeed1: Input for the motor protection speed 1. There is a motor protection error if the input bMotorProtecSpeed1 = FALSE (quiescent current principle). In the event of a fault, the outputs bMotorSpeed1, bMotorSpeed2 and bMotorSpeed3 are all FALSE; the fault is indicated at the output of the function block by bErrorMotorprotecSpeed1. The motor can only be restarted if the fault has been rectified and acknowledged at the input bReset.
bMotorProtecSpeed2: Input for the motor protection speed 2. There is a motor protection error if the input bMotorProtecSpeed2 = FALSE (quiescent current principle). In the event of a fault, the outputs bMotorSpeed1, bMotorSpeed2 and bMotorSpeed3 are all FALSE; the fault is indicated at the output of the function block by bErrorMotorprotecSpeed2. The motor can only be restarted if the fault has been rectified and acknowledged at the input bReset.
bMotorProtecSpeed3: Input for the motor protection speed 3. There is a motor protection error if the input bMotorProtecSpeed3 = FALSE (quiescent current principle). In the event of a fault, the outputs bMotorSpeed1, bMotorSpeed2 and bMotorSpeed3 are all FALSE; the fault is indicated at the output of the function block by bErrorMotorprotecSpeed3. The motor can only be restarted if the fault has been rectified and acknowledged at the input bReset.
bFeedbContactorSpeed1: Feedback from the power section of the motor for speed 1. The operating feedback is present if the input bFeedbContactorSpeed1 = TRUE. If, after switching on the motor, this feedback is not present after the time delay set by tDelayFeedbContactorSpeed1, the output bErrorFeedbContactorSpeed1 is set in order to indicate a fault. In the event of a fault, the outputs bMotorSpeed1, bMotorSpeed2 and bMotorSpeed3 are all FALSE. 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 for speed 1, the output variable bMotorSpeed1 must be applied to the input bFeedbContactorSpeed1.
![]() | If no feedback from the power section of the motor is present, the output variable bMotorSpeed1 must be applied to the input bFeedbContactorSpeed1. See application example |
bFeedbContactorSpeed2: Feedback from the power section of the motor for speed 2. The operating feedback is present if the input bFeedbContactorSpeed2 = TRUE. If, after switching on the motor, this feedback is not present after the time delay set by tDelayFeedbContactorSpeed2, the output bErrorFeedbContactorSpeed2 is set in order to indicate a fault. In the event of a fault, the outputs bMotorSpeed1, bMotorSpeed2 and bMotorSpeed3 are all FALSE. 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 for speed 2, the output variable bMotorSpeed2 must be applied to the input bFeedbContactorSpeed2.
![]() | If no feedback from the power section of the motor is present, the output variable bMotorSpeed2 must be applied to the input bFeedbContactorSpeed2. See application example |
bFeedbContactorSpeed3: Feedback from the power section of the motor for speed 3. The operating feedback is present if the input bFeedbContactorSpeed3 = TRUE. If, after switching on the motor, this feedback is not present after the time delay set by tDelayFeedbContactorSpeed3, the output bErrorFeedbContactorSpeed3 is set in order to indicate a fault. In the event of a fault, the outputs bMotorSpeed1, bMotorSpeed2 and bMotorSpeed3 are all FALSE. 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 for speed 3, the output variable bMotorSpeed3 must be applied to the input bFeedbContactorSpeed3.
![]() | If no feedback from the power section of the motor is present, the output variable bMotorSpeed3 must be applied to the input bFeedbContactorSpeed3. See application example |
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.
The process feedback is active if either bMotorSpeed1, bMotorSpeed2 or bMotorSpeed3 = TRUE.
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 outputs bMotorSpeed1, bMotorSpeed2 and bMotorSpeed3 are all FALSE. If the state of the repair switch is TRUE, a restart of the motor is blocked for the duration of tDelaySpeed2ToSpeed1 + tDelaySpeed3ToSpeed2.
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, then bManSwitch is FALSE and the outputs bMotorSpeed1, bMotorSpeed2 and bMotorSpeed3 are all FALSE. If the state of the manual/emergency switch is TRUE, a restart of the motor is blocked for the duration of tDelaySpeed2ToSpeed1 + tDelaySpeed3ToSpeed2.
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 outputs bMotorSpeed1, bMotorSpeed2 and bMotorSpeed3 are all 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. If control voltage is present, a restart of the motor is blocked for the duration of tDelaySpeed2ToSpeed1 + tDelaySpeed3ToSpeed2.
bReset: Input for acknowledgement of faults via a rising edge.
VAR_OUTPUT
bMotorSpeed1 : BOOL;
bMotorSpeed2 : BOOL;
bMotorSpeed3 : BOOL;
wState : WORD;
bStateAutoSpeed1 : BOOL;
bStateAutoSpeed2 : BOOL;
bStateAutoSpeed3 : BOOL;
bStateRepairSwitch : BOOL;
bStateManSwitch : BOOL;
eStateModeActuator : E_HVACActuatorMode;
bErrorGeneral : BOOL;
wError : WORD;
bErrorMotorprotecSpeed1 : BOOL;
bErrorMotorprotecSpeed2 : BOOL;
bErrorMotorprotecSpeed3 : BOOL;
bErrorFeedbContactorSpeed1 : BOOL;
bErrorFeedbContactorSpeed2 : BOOL;
bErrorFeedbContactorSpeed3 : BOOL;
bErrorFeedbProcess : BOOL;
bInvalidParameter : BOOL;
bMotorSpeed1: Output variable for controlling speed 1 of the three-speed drive.
bMotorSpeed2: Output variable for controlling speed 2 of the three-speed drive.
bMotorSpeed3: Output variable for controlling speed 3 of the three-speed drive.
wState: Status word indicating the operating state of the function block.
wState.0 := bEnable;
wState.1 := bMotorSpeed1;
wState.2 := bMotorSpeed2;
wState.3 := bMotorSpeed3;
wState.4 := bStateAutoSpeed1;
wState.5 := bStateAutoSpeed2;
wState.6 := bStateAutoSpeed3;
wState.7 := bStateRepairSwitch;
wState.8 := bStateManSwitch;
wState.9 := bCtrlVoltage;
bStateAutoSpeed1: Indicates the state for automatic preselection of speed 1 if the operation mode eCtrlModeActuator is either eHVACActuatorMode_Auto_BMS or eHVACActuatorMode_Auto_OP and speed 1 was activated via the input variable bAutoSpeed1.
bStateAutoSpeed2: Indicates the state for automatic preselection of speed 2 if the operation mode eCtrlModeActuator is either eHVACActuatorMode_Auto_BMS or eHVACActuatorMode_Auto_OP and speed 2 was activated via the input variable bAutoSpeed2.
bStateAutoSpeed3: Indicates the state for automatic preselection of speed 3 if the operation mode eCtrlModeActuator is either eHVACActuatorMode_Auto_BMS or eHVACActuatorMode_Auto_OP and speed 3 was activated via the input variable bAutoSpeed3.
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 operation mode status of the motor is fed back to the controller.
bErrorGeneral: The error message bErrorGeneral becomes TRUE as soon as one of the error messages bErrorMotorprotecSpeed1, bErrorMotorprotecSpeed2, bErrorMotorprotecSpeed3, bErrorFeedbContactorSpeed1, bErrorFeedbContactorSpeed2, bErrorFeedbContactorSpeed23 or bErrorFeedbProcess = TRUE. The outputs bMotorSpeed1, bMotorSpeed2 and bMotorSpeed3 are then set to FALSE and are only enabled again when the fault has been rectified and acknowledged via bReset. After rectification of the fault a restart of the motor is blocked for the duration of tDelaySpeed2ToSpeed1 + tDelaySpeed3ToSpeed2.
wError: Delivers all error messages and warnings from the function block.
wError.1 := bInvalidParameter;
wError.2 := bErrorGeneral;
wError.3 := bErrorMotorprotecSpeed1;
wError.4 := bErrorMotorprotecSpeed2;
wError.5 := bErrorMotorprotecSpeed3;
wError.6 := bErrorFeedbContactorSpeed1;
wError.7 := bErrorFeedbContactorSpeed2;
wError.8 := bErrorFeedbContactorSpeed3;
wError.9 := bErrorFeedbProcess;
bErrorMotorprotecSpeed1: Motor protection error, see input variable bMotorProtecSpeed1.
bErrorMotorprotecSpeed2: Motor protection error, see input variable bMotorProtecSpeed2.
bErrorMotorprotecSpeed3: Motor protection error, see input variable bMotorProtecSpeed3.
bErrorFeedbContactorSpeed1: Power section feedback error, see input variable bFeedbContactorSpeed1.
![]() | If no feedback from the power section of the motor is present, the output variable bMotorSpeed1 must be applied to the input bFeedbContactorSpeed1. |
bErrorFeedbContactorSpeed2: Power section feedback error, see input variable bFeedbContactorSpeed2
![]() | If no feedback from the power section of the motor is present, the output variable bMotorSpeed2 must be applied to the input bFeedbContactorSpeed2. |
bErrorFeedbContactorSpeed3: Power section feedback error, see input variable bFeedbContactorSpeed3
![]() | If no feedback from the power section of the motor is present, the output variable bMotorSpeed3 must be applied to the input bFeedbContactorSpeed3. |
bErrorFeedbProcess: Process feedback error, see input variable bFeedbackProcess.
bInvalidParameter: Indicates that an incorrect parameter is present at one of the variables eCtrlModeActuator, tStartDelay, tStopDelay, tDelayFeedbContactorSpeed1, tDelayFeedbContactorSpeed2, tDelayFeedbContactorSpeed3, tFeedbProcessTimer, tDelayFeedbProcess, tDelaySpeed1, tDelaySpeed2, tDelaySpeed1ToSpeed2ToSpeed3, tDelaySpeed2ToSpeed1 or tDelaySpeed3ToSpeed2. 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;
tDelayFeedbContactorSpeed1 : TIME;
tDelayFeedbContactorSpeed2 : TIME;
tDelayFeedbContactorSpeed3 : TIME;
tFeedbProcessTimer : TIME;
tDelayFeedbProcess : TIME;
tDelaySpeed1 : TIME;
tDelaySpeed2 : TIME;
tDelaySpeed1ToSpeed2ToSpeed3 : TIME;
tDelaySpeed2ToSpeed1 : TIME;
tDelaySpeed3ToSpeed2 : 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 in the respective switch-on stage, either by switching the enable bEnable to FALSE, or by switching off via the operation mode eCtrlModeActuator, or in automatic operation mode by switching the input variables bAutoSpeed1, bAutoSpeed2 and bAutoSpeed3 to FALSE, is delayed by the time tStopDelay [s]. Once the delayed switch-off of the motor has been activated it can no longer be canceled (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.
tDelayFeedbContactorSpeed1: Time delay of the feedback of the power section after switching on the motor. If this time has elapsed and bFeedbContactorSpeed1 = FALSE, then this is fed back to the controller via the error message bErrorFeedbContactorSpeed1 (100ms..3600s). 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.
tDelayFeedbContactorSpeed2: Time delay of the feedback of the power section after switching on the motor. If this time has elapsed and bFeedbContactorSpeed2 = FALSE, then this is fed back to the controller via the error message bErrorFeedbContactorSpeed2 (100ms..3600s). 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.
tDelayFeedbContactorSpeed3: Time delay of the feedback of the power section after switching on the motor. If this time has elapsed and bFeedbContactorSpeed3 = FALSE, then this is fed back to the controller via the error message bErrorFeedbContactorSpeed3 (100ms..3600s). 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.
tFeedbackProcessTimer: Time delay [s] of the process feedback bFeedbProcess during the motor start-up phase. 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.
tDelaySpeed1: Time delay [s] for the start-up phase of the motor in speed 1 (1s..3600s). The variable is saved persistently. Preset to 3 s.
After this time has elapsed the motor can be switched from the first to the second speed if the operation mode for speed 2 has been selected.
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.
tDelaySpeed2: Time delay [s] for the start-up phase of the motor in speed 2 (1s..3600s). The variable is saved persistently. Preset to 3 s.
After this time has elapsed the motor can be switched from the second to the third speed if the operation mode for speed 3 has been selected.
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.
tDelaySpeed1ToSpeed2ToSpeed3: Time delay for the motor switchover phase from speed 1 to speed 2, or from speed 2 to speed 3, so that the outputs bMotorSpeed1, bMotorSpeed2 and bMotorSpeed3 are all FALSE for a short while (1s..3600s). The variable is saved persistently. Preset to 250 ms. The purpose of this time delay is to preserve the motor windings.
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.
tDelaySpeed2ToSpeed1: Time delay [s] for the motor switchover phase from speed 2 to speed 1 (1s..3600s). The variable is saved persistently. Preset to 10 s. In this phase the outputs bMotorSpeed1, bMotorSpeed2 and bMotorSpeed3 are FALSE for the time tDelaySpeed2ToSpeed1 in order to reduce the speed of the motor when switching to speed 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 is set in the case of an incorrect parameter specification.
tDelaySpeed3ToSpeed2: Time delay [s] for the motor switchover phase from speed 3 to speed 2 (1s..3600s). The variable is saved persistently. Preset to 10 s. In this phase the outputs bMotorSpeed1, bMotorSpeed2 and bMotorSpeed3 are FALSE for the time tDelaySpeed2ToSpeed2 in order to reduce the speed of the motor when switching to speed 2.
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 |