> For the complete documentation index, see [llms.txt](https://support.powerio.com/hub/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://support.powerio.com/hub/codesys-hvac/en/hvac-library/functionblocks/setpoint/curve_20xy_real_real.md).

# Curve\_20XY\_Real\_Real

## `Curve_20XY_Real_Real` (FB)

FUNCTION\_BLOCK Curve\_20XY\_Real\_Real

### Short description

> Input of 20 pairs of values (support points each with an X and Y value)\
> Boundary conditions:
>
> 1. The X values must be continuously either strictly increasing or strictly decreasing
> 2. Each X value may only be present once
> 3. Two adjacent support points are each connected by a straight line\
>    \
>    Typical application: Calculation of a heat pump's performance depending on the outdoor temperature

### Representation

<figure><img src="/files/260fce09dc8b9086de25aaa77124374c2b52b1a0" alt=""><figcaption></figcaption></figure>

### Interfaces

#### Inputs

| Name                   | Data type | Value range | Initial value | Function                            |
| ---------------------- | --------- | ----------- | ------------- | ----------------------------------- |
| <p><br>rInputValue</p> | REAL      |             | 0             | Current value of the input variable |

#### Outputs

| Name                     | Data type                       | Value range | Initial value                             | Function                                        |
| ------------------------ | ------------------------------- | ----------- | ----------------------------------------- | ----------------------------------------------- |
| <p><br>rOutputValue</p>  | REAL                            |             | 0.0                                       | Current value of the output variable            |
| <p><br>eOrderXValues</p> | eCurve\_20XY\_Real\_Real\_Order |             | eCurve\_20XY\_Real\_Real\_Order.Invalid   | Order of the X values (increasing / decreasing) |
| <p><br>eError</p>        | eCurve\_20XY\_Real\_Real\_Error |             | eCurve\_20XY\_Real\_Real\_Error.No\_Error | Cause of error                                  |
| <p><br>xError</p>        | BOOL                            |             | FALSE                                     | Error state (TRUE = error)                      |

#### Setpoints / parameters

| Name                           | Data type | Value range | Initial value | Function                                                 |
| ------------------------------ | --------- | ----------- | ------------- | -------------------------------------------------------- |
| <p><br>rOutputValue\_Subst</p> | REAL      |             | -1000         | Substitute value of the output variable in case of error |
| <p><br>rOutputValue\_Min</p>   | REAL      |             | 0             | Absolute minimum value of the output variable            |
| <p><br>rOutputValue\_Max</p>   | REAL      |             | 100           | Absolute maximum value of the output variable            |
| <p><br>rSP1\_X</p>             | REAL      |             | 1             | Support point 1 - X value                                |
| <p><br>rSP1\_Y</p>             | REAL      |             | 2             | Support point 1 - Y value                                |
| <p><br>rSP2\_X</p>             | REAL      |             | 2             | Support point 2 - X value                                |
| <p><br>rSP2\_Y</p>             | REAL      |             | 4             | Support point 2 - Y value                                |
| <p><br>rSP3\_X</p>             | REAL      |             | 3             | Support point 3 - X value                                |
| <p><br>rSP3\_Y</p>             | REAL      |             | 6             | Support point 3 - Y value                                |
| <p><br>rSP4\_X</p>             | REAL      |             | 4             | Support point 4 - X value                                |
| <p><br>rSP4\_Y</p>             | REAL      |             | 8             | Support point 4 - Y value                                |
| <p><br>rSP5\_X</p>             | REAL      |             | 5             | Support point 5 - X value                                |
| <p><br>rSP5\_Y</p>             | REAL      |             | 10            | Support point 5 - Y value                                |
| <p><br>rSP6\_X</p>             | REAL      |             | 6             | Support point 6 - X value                                |
| <p><br>rSP6\_Y</p>             | REAL      |             | 12            | Support point 6 - Y value                                |
| <p><br>rSP7\_X</p>             | REAL      |             | 7             | Support point 7 - X value                                |
| <p><br>rSP7\_Y</p>             | REAL      |             | 14            | Support point 7 - Y value                                |
| <p><br>rSP8\_X</p>             | REAL      |             | 8             | Support point 8 - X value                                |
| <p><br>rSP8\_Y</p>             | REAL      |             | 16            | Support point 8 - Y value                                |
| <p><br>rSP9\_X</p>             | REAL      |             | 9             | Support point 9 - X value                                |
| <p><br>rSP9\_Y</p>             | REAL      |             | 18            | Support point 9 - Y value                                |
| <p><br>rSP10\_X</p>            | REAL      |             | 10            | Support point 10 - X value                               |
| <p><br>rSP10\_Y</p>            | REAL      |             | 20            | Support point 10 - Y value                               |
| <p><br>rSP11\_X</p>            | REAL      |             | 11            | Support point 11 - X value                               |
| <p><br>rSP11\_Y</p>            | REAL      |             | 22            | Support point 11 - Y value                               |
| <p><br>rSP12\_X</p>            | REAL      |             | 12            | Support point 12 - X value                               |
| <p><br>rSP12\_Y</p>            | REAL      |             | 24            | Support point 12 - Y value                               |
| <p><br>rSP13\_X</p>            | REAL      |             | 13            | Support point 13 - X value                               |
| <p><br>rSP13\_Y</p>            | REAL      |             | 26            | Support point 13 - Y value                               |
| <p><br>rSP14\_X</p>            | REAL      |             | 14            | Support point 14 - X value                               |
| <p><br>rSP14\_Y</p>            | REAL      |             | 28            | Support point 14 - Y value                               |
| <p><br>rSP15\_X</p>            | REAL      |             | 15            | Support point 15 - X value                               |
| <p><br>rSP15\_Y</p>            | REAL      |             | 30            | Support point 15 - Y value                               |
| <p><br>rSP16\_X</p>            | REAL      |             | 16            | Support point 16 - X value                               |
| <p><br>rSP16\_Y</p>            | REAL      |             | 32            | Support point 16 - Y value                               |
| <p><br>rSP17\_X</p>            | REAL      |             | 17            | Support point 17 - X value                               |
| <p><br>rSP17\_Y</p>            | REAL      |             | 34            | Support point 17 - Y value                               |
| <p><br>rSP18\_X</p>            | REAL      |             | 18            | Support point 18 - X value                               |
| <p><br>rSP18\_Y</p>            | REAL      |             | 36            | Support point 18 - Y value                               |
| <p><br>rSP19\_X</p>            | REAL      |             | 19            | Support point 19 - X value                               |
| <p><br>rSP19\_Y</p>            | REAL      |             | 38            | Support point 19 - Y value                               |
| <p><br>rSP20\_X</p>            | REAL      |             | 20            | Support point 20 - X value                               |
| <p><br>rSP20\_Y</p>            | REAL      |             | 40            | Support point 20 - Y value                               |

### Function description

\
The output variable **rOutputValue** is cyclically calculated based on the input variable **rInputValue** and the characteristic curve defined by the 20 support points, provided no error is present (xError = FALSE).&#x20;

It is limited by the adjustable absolute minimum (rOutputValue\_Min) and maximum values (rOutputValue\_Max).\
In the event of an error (xError = TRUE), the fixed substitute value for the output variable 'rOutputValue' **rOutputValue\_Subst** is output.\
\
The X values of the 20 support points must meet the following boundary conditions:\
\
1\) The X values must be continuously either strictly increasing or strictly decreasing\
2\) Each X value may only be present once\
3\) Two adjacent support points are each connected by a straight line\
\
The updating of the characteristic curve takes place once immediately after initialization or once after each change of the support points.\
\
In the event of an error (identical X values, X values not strictly increasing / decreasing) a corresponding cause of error is shown at the output **eError** is displayed.\
At the same time, the fixed substitute value for the output variable 'rOutputValue' **rOutputValue\_Subst** is output.\
The output **xError** is active (= TRUE) if at the output **eError** an error is signaled.

### Representation of an example characteristic curve

<figure><img src="/files/0ce49729e1618553738c6d8e297c1092062fffa7" alt=""><figcaption></figcaption></figure>

### CODESYS

InOut:

| Scope       | Name                 | Type                            | Initial                                   |
| ----------- | -------------------- | ------------------------------- | ----------------------------------------- |
| Input       | `rInputValue`        | `REAL`                          | 0                                         |
| Output      | `rOutputValue`       | `REAL`                          | 0                                         |
| Output      | `eOrderXValues`      | eCurve\_20XY\_Real\_Real\_Order | eCurve\_20XY\_Real\_Real\_Order.Invalid   |
| Output      | `eError`             | eCurve\_20XY\_Real\_Real\_Error | eCurve\_20XY\_Real\_Real\_Error.No\_Error |
| Output      | `xError`             | `BOOL`                          | FALSE                                     |
| Input Const | `rSP20_Y`            | `REAL`                          | 40                                        |
| Input Const | `rSP20_X`            | `REAL`                          | 20.0                                      |
| Input Const | `rSP19_Y`            | `REAL`                          | 38.0                                      |
| Input Const | `rSP19_X`            | `REAL`                          | 19.0                                      |
| Input Const | `rSP18_Y`            | `REAL`                          | 36.0                                      |
| Input Const | `rSP18_X`            | `REAL`                          | 18.0                                      |
| Input Const | `rSP17_Y`            | `REAL`                          | 34.0                                      |
| Input Const | `rSP17_X`            | `REAL`                          | 17.0                                      |
| Input Const | `rSP16_Y`            | `REAL`                          | 32.0                                      |
| Input Const | `rSP16_X`            | `REAL`                          | 16.0                                      |
| Input Const | `rSP15_Y`            | `REAL`                          | 30.0                                      |
| Input Const | `rSP15_X`            | `REAL`                          | 15.0                                      |
| Input Const | `rSP14_Y`            | `REAL`                          | 28.0                                      |
| Input Const | `rSP14_X`            | `REAL`                          | 14.0                                      |
| Input Const | `rSP13_Y`            | `REAL`                          | 26.0                                      |
| Input Const | `rSP13_X`            | `REAL`                          | 13.0                                      |
| Input Const | `rSP12_Y`            | `REAL`                          | 24.0                                      |
| Input Const | `rSP12_X`            | `REAL`                          | 12.0                                      |
| Input Const | `rSP11_Y`            | `REAL`                          | 22.0                                      |
| Input Const | `rSP11_X`            | `REAL`                          | 11.0                                      |
| Input Const | `rSP10_Y`            | `REAL`                          | 20.0                                      |
| Input Const | `rSP10_X`            | `REAL`                          | 10.0                                      |
| Input Const | `rSP9_Y`             | `REAL`                          | 18.0                                      |
| Input Const | `rSP9_X`             | `REAL`                          | 9.0                                       |
| Input Const | `rSP8_Y`             | `REAL`                          | 16.0                                      |
| Input Const | `rSP8_X`             | `REAL`                          | 8.0                                       |
| Input Const | `rSP7_Y`             | `REAL`                          | 14.0                                      |
| Input Const | `rSP7_X`             | `REAL`                          | 7.0                                       |
| Input Const | `rSP6_Y`             | `REAL`                          | 12.0                                      |
| Input Const | `rSP6_X`             | `REAL`                          | 6.0                                       |
| Input Const | `rSP5_Y`             | `REAL`                          | 10.0                                      |
| Input Const | `rSP5_X`             | `REAL`                          | 5.0                                       |
| Input Const | `rSP4_Y`             | `REAL`                          | 8.0                                       |
| Input Const | `rSP4_X`             | `REAL`                          | 4.0                                       |
| Input Const | `rSP3_Y`             | `REAL`                          | 6.0                                       |
| Input Const | `rSP3_X`             | `REAL`                          | 3.0                                       |
| Input Const | `rSP2_Y`             | `REAL`                          | 4.0                                       |
| Input Const | `rSP2_X`             | `REAL`                          | 2.0                                       |
| Input Const | `rSP1_Y`             | `REAL`                          | 2.0                                       |
| Input Const | `rSP1_X`             | `REAL`                          | 1.0                                       |
| Input Const | `rOutputValue_Max`   | `REAL`                          | 100.0                                     |
| Input Const | `rOutputValue_Min`   | `REAL`                          | 0.0                                       |
| Input Const | `rOutputValue_Subst` | `REAL`                          | -1000.0                                   |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://support.powerio.com/hub/codesys-hvac/en/hvac-library/functionblocks/setpoint/curve_20xy_real_real.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
