FB_HVACMotor1Speed
Application
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 only active if the operation mode eCtrlModeActuator is either eHVACActuatorMode_Auto_BMS or eHVACActuatorMode_Auto_OP.
If the input variable bAuto = TRUE, then the function block is instructed that the drive should run. If bAuto = FALSE, the drive will be switched off with a delay specified in the time variable tStopDelay.
eCtrlModeActuator: Enum that specifies the operation mode of the motor. In the event of an incorrect entry, operation continues internally with the last valid operating mode. This is eHVACActuatorMode_Auto_BMS in the case of initial commissioning. bInvalidParameter will be set in the event of an incorrect parameter entry.
bMotorProtec: input for the motor protection. There is a motor protection fault 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 from 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. 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.
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 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 1-stage 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: status message of the repair switch. TRUE indicates that the repair switch is switched off.
bStateManSwitch: status message 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.
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: returns all error messages and warnings of the function block.
byError.1 := bInvalidParameter;
byError.2 := bErrorGeneral;
byError.3 := bErrorMotorprotec;
byError.4 := bErrorFeedbContactor;
byError.5 := bErrorFeedbProcess;
bErrorMotorprotec: error motor protection, 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. See application example |
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 an incorrect variable value is present, the last valid variable value, if available, is used. If there is no valid last value, then the default value is used. bInvalidParameter will be set in the event of an incorrect parameter entry.
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 an incorrect variable value is present, the last valid variable value, if available, is used. If there is no valid last value, then the default value is used. bInvalidParameter will be set in the event of an incorrect parameter entry.
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 an incorrect variable value is present, the last valid variable value, if available, is used. If there is no valid last value, then the default value is used. bInvalidParameter will be set in the event of an incorrect parameter entry.
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 an incorrect variable value is present, the last valid variable value, if available, is used. If there is no valid last value, then the default value is used. bInvalidParameter will be set in the event of an incorrect parameter entry.
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 triggering of the input bFeedbProcess can be delayed by the time tDelayFeedbProcess (0s..3600s). The variable is saved persistently. Preset to 0 s.
If an incorrect variable value is present, the last valid variable value, if available, is used. If there is no valid last value, then the default value is used. bInvalidParameter will be set in the event of an incorrect parameter entry.