> 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/setpointcorrection.md).

# SetPointCorrection

## `SetPointCorrection` (FB)

FUNCTION\_BLOCK SetPointCorrection

### Short description

> Generation of a setpoint temperature depending on the room deviation\
> Principle: Linear shift\
> Typical application: Adjustment of a supply setpoint temperature

### Representation

<figure><img src="https://2592874069-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQR4vCFzt6ixgsqlR3pdR%2Fuploads%2Fgit-blob-faf1cfca587c9ebc5f735358e03e09c044aca8c5%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

### Interfaces

#### Inputs

| Name            | Data type | Value range | Initial value | Function                                       |
| --------------- | --------- | ----------- | ------------- | ---------------------------------------------- |
| *rSupplyTempIn* | REAL      |             | 0             | Supply setpoint temperature from heating curve |
| *rSetPointRoom* | REAL      |             | 0             | Room setpoint temperature                      |
| *rRoomTemp*     | REAL      |             | 0             | Current room temperature                       |

#### Outputs

| Name             | Data type | Value range | Initial value | Function                                                                                   |
| ---------------- | --------- | ----------- | ------------- | ------------------------------------------------------------------------------------------ |
| *rSupplyTempOut* | REAL      |             |               | corrected supply setpoint temperature                                                      |
| *xMax*           | BOOL      |             |               | Exceedance of the maximum room temperature difference. (FALSE = not active, TRUE = active) |
| *rCorrection*    | REAL      |             |               | Display of the current correction                                                          |
| *xAuto*          | BOOL      |             |               | Manual/Auto override display: (FALSE = Manual, TRUE = Auto)                                |
| *tDelay*         | TIME      |             |               | Display of reset delay after exceedance                                                    |

#### Setpoints / Parameters

| Name          | Data type | Value range               | Initial value | Function                                                                                   |
| ------------- | --------- | ------------------------- | ------------- | ------------------------------------------------------------------------------------------ |
| **tAlaTime**  | TIME      |                           | 120           | Restart time of the correction after the alarm begins.                                     |
| **rAlaLevel** | REAL      |                           | 5.0           | Temperature deviation for alarm state. In this state, the correction is no longer applied. |
| **rCorNeg**   | REAL      | <= 0                      | -2.0          | Maximum negative correction.                                                               |
| **rCorPos**   | REAL      | >= 0                      | 2.0           | Maximum positive correction.                                                               |
| **rFactor**   | REAL      |                           | 1.0           | Correction of the setpoint per degree of room temperature deviation.                       |
| **rManValue** | REAL      |                           | 0.0           | Manual override: Manual value                                                              |
| **eManModeN** | eMANNUM   | eMANNUM.Auto, eMANNUM.Man |               | Manual override: Operating mode                                                            |

### Functional description

#### General

The correction is performed proportionally between the room temperature setpoint rSetPointRoom and the room temperature measurement rRoomTemp.\
The deviation is multiplied by the adjustable correction factor.\
This correction is applied to the supply setpoint rSetPointIn. The corrected setpoint is available at the output rSetpointOut.\
Maximum and minimum values can be freely parameterized for the correction.\
If the correction reaches the parameterized alarm level, it is considered a significant fault of the heated room\
and the setpoint is no longer corrected (e.g. window open). In this case, the correction is deactivated (rCorrection=0, rSetpointOut=W)\
and the binary output xMax is set to 1. After the parameterized restart time, the function attempts to reactivate the correction.\
If the correction is reactivated, the binary signal xMax is reset to 0.\
The applied correction can be continuously observed at the output rCorrection.

#### Diagram

W = rSupplyTempIn (Supply setpoint temperature from heating curve)\
Wi = rSetPointRoom (Room setpoint temperature)\
Ti = rRoomTemp (Current room temperature)\
Wc = rSupplyTempOut (corrected supply setpoint temperature)\
Max = xMax (Exceedance of the maximum room temperature difference. (FALSE = not active, TRUE = active))

<figure><img src="https://2592874069-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQR4vCFzt6ixgsqlR3pdR%2Fuploads%2Fgit-blob-3c5243237e4da563431392e390d73ae4ad6ec00f%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

### CODESYS

InOut:

| Scope       | Name             | Type    | Initial      |
| ----------- | ---------------- | ------- | ------------ |
| Input       | `rSupplyTempIn`  | `REAL`  | 0            |
| Input       | `rSetPointRoom`  | `REAL`  | 0            |
| Input       | `rRoomTemp`      | `REAL`  | 0            |
| Input Const | `tMaxTime`       | `TIME`  | TIME#2m0s0ms |
| Input Const | `rMaxLevel`      | `REAL`  | 5            |
| Input Const | `rCorNeg`        | `REAL`  | -2           |
| Input Const | `rCorPos`        | `REAL`  | 2            |
| Input Const | `rFactor`        | `REAL`  | 1            |
| Input Const | `rManValue`      | `REAL`  | 0            |
| Input Const | `eManModeN`      | eManNum | eManNum.Auto |
| Output      | `rSupplyTempOut` | `REAL`  |              |
| Output      | `xMax`           | `BOOL`  |              |
| Output      | `rCorrection`    | `REAL`  |              |
| Output      | `xAuto`          | `BOOL`  |              |
| Output      | `tDelay`         | `TIME`  |              |


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
