# CrossVentilation\_Sulzer

## `CrossVentilation_Sulzer` (FB)

FUNCTION\_BLOCK CrossVentilation\_Sulzer

### Short description

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

### Representation

<figure><img src="/files/5d8d672d3a484f742b8c87c3d9488f6c59c1e98b" alt=""><figcaption></figcaption></figure>

### Interfaces

#### Inputs

| Name                     | Data type | Value range | Initial value | Function                                                                                                                                                                 |
| ------------------------ | --------- | ----------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| *xStartCrossVentilation* | BOOL      |             | FALSE         | Start of cross-ventilation (on each rising edge)                                                                                                                         |
| *xAbortCrossVentilation* | BOOL      |             | FALSE         | Abort cross-ventilation (on each rising edge)                                                                                                                            |
| *xEn\_WT*                | BOOL      |             | FALSE         | Enable / disable 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 manual abort of the opening duration (on each 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 each 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 duration (\_OT = Opening Time)                                                                         |
| *xActive\_OT*            | BOOL      |             | FALSE         | Feedback - Active opening time duration (TRUE = active) (\_OT = Opening Time)                                                                    |
| *rDegreeCurve\_WDOO\_OT* | REAL      |             | 0.0           | Current window degree of opening \[ % ] depending on outside temperature from the curve (\_WDOO = Windows Degree Of Opening, \_OT = OutsideTemp) |
| *rDegreeCurve\_WDOO\_WS* | REAL      |             | 0.0           | Current window degree of opening \[ % ] depending on wind speed from the curve (\_WDOO = Windows Degree Of Opening, \_WS = Wind Speed)           |
| *rDegree\_WDOO*          | REAL      |             | 0.0           | Current window degree of opening \[ % ] (\_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 threshold, below which no window opening will be initiated. |

### 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 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): Curve ‘Opening time depending on outside temperature’
2. Index \_WDOO\_OT (\_WDOO = Windows Degree Of Opening, \_OT = Outside Temp): Curve ‘Degree of opening depending on outside temperature’
3. Index \_WDOO\_WS (\_WDOO = Windows Degree Of Opening, \_WS = Wind Speed): Curve ‘Degree of opening depending on outside wind speed”
4. Index \_WT (Waiting Time): 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 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 time duration is calculated from curve 1.\
The degree of opening is determined and output from curves 2 and 3. After the window opening is completed, the waiting time calculated from 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 curves contain valid data (xValidData\_XX = TRUE)
4. The outside temperature exceeds the absolute minimum limit (rOutsideTemp > rOutsideTempLimit)

#### Opening duration

After successful start of cross-ventilation, the opening time duration is calculated once from curve 1 depending on the current\
outside temperature. During the opening time duration, the status indicator ‘xActive\_OT’ is active and the remaining time duration is output on 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 successful start of cross-ventilation, the degree of opening is determined once from the two curves 2 and 3 depending on the current outside temperature\
and the current outside wind speed:\
\
Variable Z = ((Value from curve 2) X (Value from 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 determined degree of opening is output at the output ‘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 duration must generally be enabled (xEn\_WT = TRUE). At the start of the waiting time, the duration is determined once from curve 4 depending on the outside temperature.\
During the active waiting time the status indicator ‘xActive\_WT’ is active and the remaining time duration is output at the output ‘tRemainingTime\_WT’.\
The waiting time ends when the duration expires or when the waiting time is disabled (xEn\_WT = FALSE).

#### End of opening time

The opening time ends immediately when the duration elapses (xEnComplete\_OT = FALSE).\
The opening time ends after the duration elapses (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 outside temperature

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

#### Input ‘xResError’

Each rising edge on this input resets the outputs ‘xError’ and ‘sErrorCode’ to their respective no-error state.

#### 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 is present.\
Currently the following error states are defined:\
‘1’: xValidData\_OT = FALSE (Curve 1 without valid data)\
‘2’: xValidData\_WDOO\_OT = FALSE (Curve 2 without valid data)\
‘3’: xValidData\_WDOO\_WS = FALSE (Curve 3 without valid data)\
‘4’: xValidData\_WT = FALSE (Curve 4 without valid data)

#### This function block can be applied as follows:

The output ‘xActive\_WDOO’ (= TRUE) signals the request to open the windows for cross-ventilation, the output ‘rDegree\_WDOO’ the window opening degree in the range 0.0 - 100.0% (0.0% = closed).\
This function block can be applied as follows:

<figure><img src="/files/1cdf48e8399e6b79e2fa63414a5788fdd6ba139d" alt=""><figcaption></figcaption></figure>

### 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)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://support.powerio.com/hub/codesys-hvac/en/hvac-library/functionblocks/components/crossventilation_sulzer.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
