FB_HVACFixedLimit

FB_HVACFixedLimit 1:

Application

This function block represents a limit switch, whose output signal is switched depending on the time delaystDealyHighLimit / tDelayLowLimit, the mode bModeFixedLimit, the limit values rHighLimit / rLowLimit and the input signal rInputValue.

VAR_INPUT

eDataSecurityType: E_HVACDataSecurityType;
bSetDefault      : BOOL;    
bEnable          : BOOL;
rInputValue      : REAL;
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: FB_HVACFixedLimit 2: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: the default values of the VAR_IN_OUT variables are adopted with a rising edge at this input variable.

bEnable: the function block is enabled if bEnable = TRUE.

rInputValue: input signal

bReset: input for acknowledging an incorrect parameter entry via a rising edge.

VAR_OUTPUT

bEvent           : BOOL;
bEdgeHighLimit   : BOOL;
bEdgeLowLimit    : BOOL;
bInvalidParameter: BOOL;

bEvent: output signal which is switched depending on the time delays tDelayHighLimit / tDelayLowLimit, the mode bModeFixedLimit, the input signal rInputValue and the limit values rHighLimit / rLowLimit is switched.

bEdgeHighLimit: is TRUE for one PLC cycle after the input signal rInputValue has exceeded the variable rHighLimit for the duration of tDelayHighLimit.

bEdgeLowLimit: is TRUE for one PLC cycle after the input signal rInputValue has undershot the variable rLowLimit for the duration of tDelayLowLimit.

bInvalidParameter: indicates that an incorrect parameter is present at one of the variables rHighLimit, rLowLimit, tDelayHighLimit or tDelayHighLimit. An incorrect parameter entry 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

bModeFixedLimit  : BOOL;
rHighLimit       : REAL;
rLowLimit        : REAL;
tDelayHighLimit  : TIME;
tDelayLowLimit   : TIME;   

bModeFixedLimit: if bModeFixedLimit = TRUE, then the output variable bEvent becomes TRUE, if the input signal rInputValue has exceeded the variable rHighLimit for the duration of tDelayHighLimit. If bEvent = TRUE, then bEdgeHighLimit is set for one PLC cycle. If the input signal rInputValue falls below the variable rLowLimit for the duration of tDelayLowLimit, then bEvent becomes FALSE and bEdgeLowLimit is set for one PLC cycle.
If bModeFixedLimit = FALSE, then the output variable bEvent becomes TRUE if the input signal rInputValue has fallen below the variable rLowLimit for the duration of tDelayLowLimit. If bEvent = TRUE, then bEdgeLowLimit is set for one PLC cycle. If the input signal rInputValue exceeds the variable rHighLimit for the duration of tDelayHighLimit, then bEvent becomes FALSE and bEdgeHighLimit is set for one PLC cycle.

The variable is saved persistently. Preset to 1.

rHighLimit: upper limit value.
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. The function block continues to operate normally.

The variable is saved persistently. Preset to 22.

rLowLimit: lower limit value.
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. The function block continues to operate normally.

The variable is saved persistently. Preset to 18.

tDelayHighLimit: switching delay [s] when the upper limit value is exceeded.
If an incorrect variable value is present, the last valid variable value is used, if available. 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. The function block continues to operate normally.

The variable is saved persistently. Preset to 1 s.

tDelayLowLimit: switching delay [s] when falling below the lower limit value.
If an incorrect variable value is present, the last valid variable value is used, if available. 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. The function block continues to operate normally.

The variable is saved persistently. Preset to 1 s.

Behavior of the output value

FB_HVACFixedLimit 3: