CrossVentilation_Sulzer

CrossVentilation_Sulzer (FB)

FUNCTION_BLOCK CrossVentilation_Sulzer

Short description

Control of cross ventilation using window elements via four independently adjustable characteristic curves Characteristic curve 1: Opening time depending on outside temperature Characteristic curve 2: Degree of opening depending on outside temperature Characteristic curve 3: Degree of opening depending on wind speed Characteristic curve 4: Waiting time depending on outside temperature Typical application: Control of cross ventilation by the room CO2 measured value\

Representation

Interfaces

Inputs

Name
Data type
Value range
Initial value
Function

xStartCrossVentilation

BOOL

FALSE

Start of cross ventilation (on every rising edge)

xAbortCrossVentilation

BOOL

FALSE

Abort cross ventilation (on every rising edge)

xEn_WT

BOOL

FALSE

Enable / disable the waiting time (TRUE = enabled)

xEnComplete_OT

BOOL

FALSE

Enable / disable the input 'xComplete_OT' (FALSE = disabled) (_OT = Opening Time)

xComplete_OT

BOOL

FALSE

Enable / disable the manual abort of the opening duration (on every rising edge, if xEnComplete_OT = TRUE) (e.g. abort via CO2 level after the opening duration has elapsed)

rOutsideTemp

REAL

0.0

Outside temperature

rOutsideWindSpeed

REAL

0.0

Wind speed

xResError

BOOL

FALSE

Reset of the outputs 'xError' and 'sErrorCode' (on every rising edge)

xValidData_OT

BOOL

FALSE

Validity of the data of the curve 'Opening Time - Outside Temperature' (_OT = Opening Time) (TRUE = valid)

xValidData_WDOO_OT

BOOL

FALSE

Validity of the data of the curve 'Window Degree Of Opening - Outside Temperature' (_WDOO = Windows Degree Of Opening, _OT = OutsideTemp) (TRUE = valid)

xValidData_WDOO_WS

BOOL

FALSE

Validity of the data of the curve 'Window Degree Of Opening - Wind Speed' (_WDOO = Windows Degree Of Opening, _WS = Wind Speed) (TRUE = valid)

xValidData_WT

BOOL

FALSE

Validity of the data of the curve 'Waiting Time - Outside Temperature' (_WT = Waiting Time) (TRUE = valid)

Inputs and outputs

Name
Data type
Value range
Initial value
Function

arData_OT

stCurve_Real_Time

Array with the support points for the curve 'Opening Time - Outside Temperature' (_OT = Opening Time)

arData_WDOO_OT

stCurve_Real_Real

Array with the support points for the curve 'Window Degree Of Opening - Outside Temperature' (_WDOO = Windows Degree Of Opening, _OT = OutsideTemp)

arData_WDOO_WS

stCurve_Real_Real

Array with the support points for the curve 'Window Degree Of Opening - Wind Speed' (_WDOO = Windows Degree Of Opening, _WS = Wind Speed)

arData_WT

stCurve_Real_Time

Array with the support points for the curve 'Waiting Time - Outside Temperature' (_WT = Waiting Time)

Outputs

Name
Data type
Value range
Initial value
Function

tTimeCurve_OT

TIME

T#0s

Current opening time duration from the curve (_OT = Opening Time)

tRemainingTime_OT

TIME

T#0s

Remaining time of the active opening time (_OT = Opening Time)

xActive_OT

BOOL

FALSE

Feedback - Active opening time (TRUE = active) (_OT = Opening Time)

rDegreeCurve_WDOO_OT

REAL

0.0

Current window opening degree [%] depending on outside temperature from the curve (_WDOO = Windows Degree Of Opening, _OT = OutsideTemp)

rDegreeCurve_WDOO_WS

REAL

0.0

Current window opening degree [%] depending on wind speed from the curve (_WDOO = Windows Degree Of Opening, _WS = Wind Speed)

rDegree_WDOO

REAL

0.0

Current window opening degree [%] (_WDOO = Windows Degree Of Opening)

xActive_WDOO

BOOL

FALSE

Feedback - Active window opening (TRUE = active) (_WDOO = Windows Degree Of Opening)

tTimeCurve_WT

TIME

T#0s

Current waiting time from the curve (_WT = Waiting Time)

tRemainingTime_WT

TIME

T#0s

Remaining time of the active waiting time (_WT = Waiting Time)

xActive_WT

BOOL

FALSE

Feedback - Active waiting time (TRUE = active) (_WT = Waiting Time)

xError

BOOL

FALSE

Error state (FALSE = no error, TRUE = error)

sErrorCode

STRING

‘’

String with the numbers of the active errors

Setpoints / Parameters

Name
Data type
Value range
Initial value
Function

rOutsideTempLimit

REAL

-15

Outside temperature limit value; if this is undershot no window opening will be started anymore.

Function description

Characteristic curves

The total of four freely adjustable characteristic curves (each with 10 support points, FB 'Curve_10XY_Real' or FB 'Curve_10XY_Real_Time') are connected to the associated data inputs (arData_XX), as well as the outputs of the characteristic curves that signal the validity of the data (xValidData_XX). The assignment of the characteristic curves to the inputs is fixed as follows:\

  1. Index _OT (Opening Time): Characteristic curve 'Opening time depending on outside temperature'

  2. Index _WDOO_OT (_WDOO = Windows Degree Of Opening, _OT = Outside Temp): Characteristic curve 'Degree of opening depending on outside temperature'

  3. Index _WDOO_WS (_WDOO = Windows Degree Of Opening, _WS = Wind Speed): Characteristic curve 'Degree of opening depending on outside wind speed

  4. Index _WT (Waiting Time): Characteristic curve 'Waiting time depending on outside temperature'

If an input value ( = X value ) outside the range specified by support points 1 and 10 is passed to a characteristic curve, the Y value of the nearest support point is returned (example: support point 1 (1, 10), support point 10 (10, 100), X value = -5 — Y value = 10)

Procedure

Cross ventilation is started with a rising edge at the input 'xStartCrossVentilation'. The opening duration is calculated from characteristic curve 1. The degree of opening is determined and output from characteristic curves 2 and 3. After the completion of the window opening the waiting time, calculated from characteristic curve 4, is started, which temporarily prevents another cross ventilation.

Start of cross ventilation

Cross ventilation is started with a rising edge at the input 'xStartCrossVentilation' if all of the following conditions are met:\

  1. The waiting time is not active (xActive_WT = FALSE)

  2. The opening time is not active (xActive_OT = FALSE)

  3. All four characteristic curves contain valid data (xValidData_XX = TRUE)

  4. The outside temperature exceeds the absolute minimum limit (rOutsideTemp > rOutsideTempLimit)

Opening duration

After the successful start of cross ventilation the opening duration is calculated once from characteristic curve 1 depending on the current outside temperature. During the opening duration the status indicator 'xActive_OT' is active and the remaining time is output at the output 'tRemainingTime_OT'.

Abort

The active cross ventilation can be aborted at any time by a rising edge at the input 'xAbortCrossVentilation'.

Degree of opening

After the successful start of cross ventilation the degree of opening is determined once from the two characteristic curves 2 and 3 depending on the current outside temperature and the current outside wind speed: Variable Z = (( value from characteristic curve 2 ) X ( value from characteristic curve 3 )) / 100 The variable Z is then compared with fixed predefined range limits and the degree of opening assigned to the respective range is output: 0 <= Z < 15: Degree of opening = 0% 15 <= Z < 25: Degree of opening = 25% 25 <= Z < 50: Degree of opening = 50% 50 <= Z < 75: Degree of opening = 75% Z > 75 : Degree of opening = 100% The thus determined degree of opening is output at 'rDegree_WDOO', the output 'xActive_WDOO' signals an active window opening (= TRUE).

Waiting time

Directly after the end of the opening duration a possible waiting time until the next activation of cross ventilation begins. For this the waiting time must generally be enabled (xEn_WT = TRUE). At the beginning of the waiting time the duration is determined once from characteristic curve 4 depending on the outside temperature. During the active waiting time the status indicator 'xActive_WT' is active and the remaining time is output at 'tRemainingTime_WT'. The waiting time ends when the duration elapses or when the waiting time is disabled (xEn_WT = FALSE).

End of the opening time

The opening time ends immediately when the duration elapses (xEnComplete_OT = FALSE). The opening time ends after the duration has elapsed (xEnComplete_OT = TRUE) if a rising edge is detected at the input 'xComplete_OT'. This serves to extend the opening duration until an acceptable CO2 level is reached.

Blocking cross ventilation via the outside temperature

Cross ventilation is only started if the current outside temperature at the start time exceeds the adjustable limit 'rOutsideTempLimit'.

Input 'xResError'

Any rising edge on this input resets the outputs 'xError' and 'sErrorCode' to their respective non-error states.

Output 'xError'

The output is active (= TRUE) if at least one error has been detected ('sErrorCode <> ''')

Output 'sErrorCode'

This output signals the current error status. An empty string '' indicates that no error was present. Currently the following error states are defined: '1': xValidData_OT = FALSE (Characteristic curve 1 without valid data) '2': xValidData_WDOO_OT = FALSE (Characteristic curve 2 without valid data) '3': xValidData_WDOO_WS = FALSE (Characteristic curve 3 without valid data) '4': xValidData_WT = FALSE (Characteristic curve 4 without valid data)

Typical application

The output 'xActive_WDOO' (= TRUE) signals the request to open the windows by cross ventilation, the output 'rDegree_WDOO' the degree of window opening in the range 0.0 - 100.0% (0.0% = closed). This function block can be used as follows:

CODESYS

InOut:

Scope
Name
Type
Initial

Input

xStartCrossVentilation

BOOL

FALSE

Input

xAbortCrossVentilation

BOOL

FALSE

Input

xEn_WT

BOOL

TRUE

Input

xEnComplete_OT

BOOL

FALSE

Input

xComplete_OT

BOOL

FALSE

Input

rOutsideTemp

REAL

0.0

Input

rOutsideWindSpeed

REAL

0.0

Input

xResError

BOOL

FALSE

Input

xValidData_OT

BOOL

FALSE

Input

xValidData_WDOO_OT

BOOL

FALSE

Input

xValidData_WDOO_WS

BOOL

FALSE

Input

xValidData_WT

BOOL

FALSE

Input

arData_OT

POINTER TO stCurve_Real_Time

Input

arData_WDOO_OT

POINTER TO stCurve_Real_Real

Input

arData_WDOO_WS

POINTER TO stCurve_Real_Real

Input

arData_WT

POINTER TO stCurve_Real_Time

Output

tTimeCurve_OT

TIME

TIME#0ms

Output

tRemainingTime_OT

TIME

TIME#0ms

Output

xActive_OT

BOOL

FALSE

Output

rDegreeCurve_WDOO_OT

REAL

0.0

Output

rDegreeCurve_WDOO_WS

REAL

0.0

Output

rDegree_WDOO

REAL

0.0

Output

xActive_WDOO

BOOL

FALSE

Output

tTimeCurve_WT

TIME

TIME#0ms

Output

tRemainingTime_WT

TIME

TIME#0ms

Output

xActive_WT

BOOL

FALSE

Output

xError

BOOL

FALSE

Output

sErrorCode

STRING

‘’

Input Const

rOutsideTempLimit

REAL

-15.0

Methods:

mCalculateCurveSectionValue_Real_Real

mCalculateCurveSectionValue_Real_Time

mCalculateCurveValue_Real_Real

mCalculateCurveValue_Real_Time

mResData

Structure:

  • mCalculateCurveSectionValue_Real_Real (Method)

  • mCalculateCurveSectionValue_Real_Time (Method)

  • mCalculateCurveValue_Real_Real (Method)

  • mCalculateCurveValue_Real_Time (Method)

  • mResData (Method)

Last updated