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

# WetBulbTemperature

## `WetBulbTemperature` (FB)

FUNCTION\_BLOCK WetBulbTemperature

### Short description

> Calculation of the wet-bulb temperature in degrees Celsius\
> Quantities: temperature, relative humidity\
> Typical application: calculation of the wet-bulb temperature for adiabatic cooling

### Representation

<figure><img src="/files/3a3c114cd738f18b537a392bc5c903574c538cb3" alt=""><figcaption></figcaption></figure>

### Interfaces

#### Inputs

| Name                | Data type | Value range    | Initial value | Function                       |
| ------------------- | --------- | -------------- | ------------- | ------------------------------ |
| *rTemperature*      | REAL      | -20.0 to +50.0 | 0             | Temperature in degrees Celsius |
| *rRelativeHumidity* | REAL      | 5.0 to 99.0    | 5             | Relative humidity in percent   |

#### Outputs

| Name                  | Data type | Value range | Initial value | Function                                                                                        |
| --------------------- | --------- | ----------- | ------------- | ----------------------------------------------------------------------------------------------- |
| *rWetBulbTemperature* | REAL      |             | 0.0           | Wet-bulb temperature in °C (error: +/- 1.0 percent in the specified temperature/humidity range) |
| *xError*              | BOOL      |             | FALSE         | Output for indicating error states (TRUE = error)                                               |
| *sErrorCode*          | STRING    |             | ‘’            | Output for indicating error messages                                                            |

### Function description

#### General

This function block is used to calculate the wet-bulb temperature in degrees Celsius.\
For this purpose, the current values of air temperature in degrees Celsius and relative humidity in percent must be provided.

> **Temperature range in degrees Celsius&#x20;*****rTemperature***
>
> The temperature in degrees Celsius may only take values between -20.0 and +50.0 degrees Celsius (inclusive).\
> Values outside this range generate an error state ('xError' = TRUE) and a corresponding error message ('xErrorCode').\
> No calculation of the wet-bulb temperature is performed.
>
> **Relative humidity range in percent&#x20;*****rRelativeHumidity***
>
> The relative humidity in percent may only take values between +5.0 and +99.0 percent (inclusive).\
> Values outside this range generate an error state ('xError' = TRUE) and a corresponding error message ('xErrorCode').\
> No calculation of the wet-bulb temperature is performed.

#### Output for indicating error states *xError*

This output is used to indicate error states (= TRUE):

1. Temperature outside the allowable range of temperature in degrees Celsius *rTemperature*
2. Relative humidity outside the allowable range of relative humidity in percent *rRelHumidity*
3. Wet-bulb temperature 'rWetBulbTemperature' > temperature 'rTemperature'
4. Wet-bulb temperature 'rWetBulbTemperature' < (temperature 'rTemperature' - 50.0)

\
In all other situations the output is not active (= FALSE).

#### Output for indicating error messages *sErrorCode*

This output is used to display context-dependent error messages in plain text.

### CODESYS

InOut:

| Scope  | Name                  | Type          | Initial |
| ------ | --------------------- | ------------- | ------- |
| Input  | `rTemperature`        | `REAL`        | 0       |
| Input  | `rRelativeHumidity`   | `REAL`        | 5.0     |
| Output | `rWetBulbTemperature` | `REAL`        | 0       |
| Output | `xError`              | `BOOL`        | FALSE   |
| Output | `sErrorCode`          | `STRING(255)` | ‘’      |


---

# 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/energy/wetbulbtemperature.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.
