> 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/hvac-library/functionblocks/numeric/averagech16.md).

# AverageCh16

## `AverageCh16` (FB)

FUNCTION\_BLOCK AverageCh16

### Kurzbeschreibung

> Bildung eines Mittelwerts aus bis zu sechs gewichteten numerischen Eingangsgrößen\
> Typische Anwendung: Bildung eines Raumtemperaturmittelwerts aus verschiedenen Fühlern

### Darstellung

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

### Schnittstellen

#### Eingänge

| Name   | Datentyp | Wertebereich | Initialwert | Funktion                     |
| ------ | -------- | ------------ | ----------- | ---------------------------- |
| *rIn1* | REAL     |              |             | Analogwerteingang 1          |
| *rIn2* | REAL     |              |             | Analogwerteingang 2          |
| *rIn3* | REAL     |              |             | Analogwerteingang 3          |
| *rIn4* | REAL     |              |             | Analogwerteingang 4          |
| *rIn5* | REAL     |              |             | Analogwerteingang 5          |
| *rIn6* | REAL     |              |             | Analogwerteingang 6          |
| *xEn1* | BOOL     |              |             | Freigabe Analogwerteingang 1 |
| *xEn2* | BOOL     |              |             | Freigabe Analogwerteingang 2 |
| *xEn3* | BOOL     |              |             | Freigabe Analogwerteingang 3 |
| *xEn4* | BOOL     |              |             | Freigabe Analogwerteingang 4 |
| *xEn5* | BOOL     |              |             | Freigabe Analogwerteingang 5 |
| *xEn6* | BOOL     |              |             | Freigabe Analogwerteingang 6 |

#### Ausgänge

| Name   | Datentyp | Wertebereich | Initialwert | Funktion      |
| ------ | -------- | ------------ | ----------- | ------------- |
| *rOut* | REAL     |              |             | Mittelwert    |
| *xErr* | BOOL     |              |             | Sammelstörung |

#### Sollwerte / Parameter

| Name          | Datentyp | Wertebereich | Initialwert | Funktion                         |
| ------------- | -------- | ------------ | ----------- | -------------------------------- |
| **iLoading6** | INT      |              | 10          | Gewichtung - Analogwerteingang 6 |
| **iLoading5** | INT      |              | 10          | Gewichtung - Analogwerteingang 5 |
| **iLoading4** | INT      |              | 10          | Gewichtung - Analogwerteingang 4 |
| **iLoading3** | INT      |              | 10          | Gewichtung - Analogwerteingang 3 |
| **iLoading2** | INT      |              | 10          | Gewichtung - Analogwerteingang 2 |
| **iLoading1** | INT      |              | 10          | Gewichtung - Analogwerteingang 1 |

### Funktionsbeschreibung

#### Mittelwert *rOut*

Der Mittelwert wird gebildet, in dem die Analogwerteingänge *rInX* mit ihrer individuellen Gewichtung **iLoadingX** multipliziert und anschließend alle Produkte aufaddiert werden (Divident).\
Die Summe der Gewichtungen wird durch die Addition der individuellen Gewichtungen gebildet (= Divisor).\
Der sich so ergebende Quotient steht abschließend als Mittelwert *rOut* zur Verfügung.\
\
Die individuelle Gewichtung eines Analogwerteingangs X hat stets den Wert 0.0, solange die Freigabe des Analogwerteingangs X *xEnX* gesperrt ist (= FALSE).\
Ist die Summe der Gewichtungen (Divisor) = Null, so wird am Ausgang *rOut* konstant der Wert 0.0 ausgegeben.\
\
Legende: X = 1 bis 6

#### Sammelstörung *xErr*

Die Sammelstörung ist aktiv (= TRUE), falls mindestens einer der Analogwerteingänge *rInX* gesperrt ist (*xEnX* = FALSE).\
In allen übrigen Fällen ist die Sammelstörung nicht aktiv (= FALSE).

### CODESYS

InOut:

| Scope       | Name         | Type   | Initial |
| ----------- | ------------ | ------ | ------- |
| Input       | `rIn1`       | `REAL` |         |
| Input       | `rIn2`       | `REAL` |         |
| Input       | `rIn3`       | `REAL` |         |
| Input       | `rIn4`       | `REAL` |         |
| Input       | `rIn5`       | `REAL` |         |
| Input       | `rIn6`       | `REAL` |         |
| Input       | `rIn7`       | `REAL` |         |
| Input       | `rIn8`       | `REAL` |         |
| Input       | `rIn9`       | `REAL` |         |
| Input       | `rIn10`      | `REAL` |         |
| Input       | `rIn11`      | `REAL` |         |
| Input       | `rIn12`      | `REAL` |         |
| Input       | `rIn13`      | `REAL` |         |
| Input       | `rIn14`      | `REAL` |         |
| Input       | `rIn15`      | `REAL` |         |
| Input       | `rIn16`      | `REAL` |         |
| Input       | `xEn1`       | `BOOL` |         |
| Input       | `xEn2`       | `BOOL` |         |
| Input       | `xEn3`       | `BOOL` |         |
| Input       | `xEn4`       | `BOOL` |         |
| Input       | `xEn5`       | `BOOL` |         |
| Input       | `xEn6`       | `BOOL` |         |
| Input       | `xEn7`       | `BOOL` |         |
| Input       | `xEn8`       | `BOOL` |         |
| Input       | `xEn9`       | `BOOL` |         |
| Input       | `xEn10`      | `BOOL` |         |
| Input       | `xEn11`      | `BOOL` |         |
| Input       | `xEn12`      | `BOOL` |         |
| Input       | `xEn13`      | `BOOL` |         |
| Input       | `xEn14`      | `BOOL` |         |
| Input       | `xEn15`      | `BOOL` |         |
| Input       | `xEn16`      | `BOOL` |         |
| Input Const | `iLoading16` | `INT`  | 10      |
| Input Const | `iLoading15` | `INT`  | 10      |
| Input Const | `iLoading14` | `INT`  | 10      |
| Input Const | `iLoading13` | `INT`  | 10      |
| Input Const | `iLoading12` | `INT`  | 10      |
| Input Const | `iLoading11` | `INT`  | 10      |
| Input Const | `iLoading10` | `INT`  | 10      |
| Input Const | `iLoading9`  | `INT`  | 10      |
| Input Const | `iLoading8`  | `INT`  | 10      |
| Input Const | `iLoading7`  | `INT`  | 10      |
| Input Const | `iLoading6`  | `INT`  | 10      |
| Input Const | `iLoading5`  | `INT`  | 10      |
| Input Const | `iLoading4`  | `INT`  | 10      |
| Input Const | `iLoading3`  | `INT`  | 10      |
| Input Const | `iLoading2`  | `INT`  | 10      |
| Input Const | `iLoading1`  | `INT`  | 10      |
| Output      | `rOut`       | `REAL` |         |
| Output      | `xErr`       | `BOOL` |         |


---

# 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/hvac-library/functionblocks/numeric/averagech16.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.
