# hxChart

## `hxChart` (FB)

FUNCTION\_BLOCK hxChart

### Short description

> Calculation of state variables of moist air based on the Mollier h,x diagram\
> Quantities: enthalpy, dew point temperature, absolute humidity\
> Typical application: calculation of the dew point temperature in a zone

### Representation

<figure><img src="/files/36c56f799ef6defa16fb09a0d5434931c0c6cb5e" alt=""><figcaption></figcaption></figure>

### Interfaces

#### Inputs

| Name  | Data type | Value range    | Initial value | Function                       |
| ----- | --------- | -------------- | ------------- | ------------------------------ |
| *rT*  | REAL      | -20.0 to +50.0 |               | Temperature in degrees Celsius |
| *rRH* | REAL      | 0.1 to 100.0   |               | Relative humidity in percent   |

#### Outputs

| Name   | Data type | Value range | Initial value | Function                                                          |
| ------ | --------- | ----------- | ------------- | ----------------------------------------------------------------- |
| *rH*   | REAL      |             |               | Enthalpy in kJ/kg                                                 |
| *rX*   | REAL      |             |               | Absolute humidity in grams of water vapor per kilogram of dry air |
| *rDP*  | REAL      |             |               | Dew point temperature in degrees Celsius                          |
| *xErr* | BOOL      |             |               | Aggregate fault                                                   |

#### Setpoints / parameters

| Name   | Data type | Value range     | Initial value | Function             |
| ------ | --------- | --------------- | ------------- | -------------------- |
| **rP** | REAL      | 800.0 to 1200.0 | 980           | Air pressure in mbar |

### Function description

#### General

This function block is used to calculate essential state variables of moist air based on the Mollier h,x diagram.\
For this purpose, the current values of air temperature in degrees Celsius and relative humidity in percent must be provided.\
Ideally, the current air pressure in mbar is available for high accuracy; however, it can be replaced by a constant adjusted for the measurement location's altitude (barometric altitude formula).

| Altitude above sea level (m) | Air pressure (mbar) | Constant |
| ---------------------------- | ------------------- | -------- |
| 0                            | 1013                | 10130    |
| 300                          | 980                 | 9800     |
| 400                          | 966                 | 9660     |
| 600                          | 943                 | 9430     |
| 800                          | 921                 | 9210     |
| 1000                         | 899                 | 8990     |
| 1500                         | 842                 | 8420     |
| 2000                         | 795                 | 7950     |

> **Temperature range in degrees Celsius&#x20;*****rT***
>
> The temperature in degrees Celsius may only take values between -20.0 and +50.0 degrees Celsius (inclusive).\
> Values outside the range will be automatically corrected to the appropriate limit.
>
> **Relative humidity range in percent&#x20;*****rRH***
>
> The relative humidity in percent may only take values between +0.1 and +100.0 percent (inclusive).\
> Values outside the range will be automatically corrected to the appropriate limit.

#### Aggregate fault *xErr*

This output is used to indicate violations of the permissible value ranges.\
It is activated (= TRUE) if the temperature in degrees Celsius falls below the limit -20.0 and/or exceeds the limit +50.0. It is also activated if the relative humidity in percent falls below the limit +0.1 and/or exceeds the limit +100.0.\
In all other situations the output is not active (= FALSE).

### CODESYS

InOut:

| Scope       | Name   | Type   | Initial |
| ----------- | ------ | ------ | ------- |
| Input       | `rT`   | `REAL` |         |
| Input       | `rRH`  | `REAL` |         |
| Input Const | `rP`   | `REAL` | 980.0   |
| Output      | `rH`   | `REAL` |         |
| Output      | `rX`   | `REAL` |         |
| Output      | `rDP`  | `REAL` |         |
| Output      | `xErr` | `BOOL` |         |


---

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