# DampingT1

## `DampingT1` (FB)

FUNCTION\_BLOCK DampingT1

### Short description

> Temporal filtering of an analog input signal\
> \
> Typical application: filtering of a sensor raw value

### Representation

<figure><img src="/files/6124e5409335807fd560b42242237e398cf781cb" alt=""><figcaption></figcaption></figure>

### Interfaces

#### Inputs

| Name  | Data type | Value range | Initial value | Function           |
| ----- | --------- | ----------- | ------------- | ------------------ |
| *rIn* | REAL      |             |               | Analog value input |

#### Outputs

| Name   | Data type | Value range | Initial value | Function                     |
| ------ | --------- | ----------- | ------------- | ---------------------------- |
| *rOut* | REAL      |             |               | Filtered analog value output |

#### Setpoints / parameters

| Name              | Data type | Value range | Initial value    | Function                       |
| ----------------- | --------- | ----------- | ---------------- | ------------------------------ |
| **tTimeConstant** | TIME      | 5s…         | T#10s            | Filter - time constant         |
| **rInitValue**    | REAL      |             | 100              | Initial value                  |
| **eInitial**      | eInit     |             | eInit.InputValue | Selection of the initial value |
| **tInitDelay**    | TIME      |             | T#5s             | Start delay - initialization   |

### Function description

#### General

The analog input signal *rIn* is examined at intervals of the sampling time (here: 1s, fixed) for changes in its value.\
If the current value at the input *rIn* at time t differs from the value at the output *rOut* at time t-sampling time, then the current output value *rOut* at time t is calculated according to the following algorithm:\
\
\
\&#xNAN;*rOut* = *rOut* (t-sampling time) + ((*rIn* - *rOut* (t-sampling time)) \* (sampling time / **tTimeConstant**))\
\
\
Legend:&#x20;

1. *rOut* = filtered analog value output at time t
2. *rOut* (t-sampling time) = filtered analog value output at time t-sampling time
3. *rIn* = analog value input at time t
4. Sampling time = 1s
5. **tTimeConstant** = filter - time constant
6. t = current time

{% hint style="info" %}
**Rules for setting the filter time constant tTimeConstant**

**tTimeConstant** > (sampling time \* 5)\
**tTimeConstant** = 0: *rOut = rIn*
{% endhint %}

#### Type of initialization **eInitial**

This setpoint / parameter determines the type of initialization of the analog value input *rIn* is defined.\
The initialization is performed once after each CPU restart.\
\
The following options are possible:

| Type                    | Initialization value | Note                       |
| ----------------------- | -------------------- | -------------------------- |
| eInit.InitValue         | **rInitValue**       | Configurable initial value |
| eInit.InputValue        | *rIn*                | Input value                |
| eInit.InputValueDelayed | *rIn*                | Delayed input value        |

The initialization is performed continuously regardless if the setpoint / parameter **tTimeConstant** has the value T#0s.

### CODESYS

InOut:

| Scope       | Name            | Type   | Initial          |
| ----------- | --------------- | ------ | ---------------- |
| Input       | `rIn`           | `REAL` |                  |
| Input Const | `tTimeConstant` | `TIME` | TIME#10s0ms      |
| Input Const | `rInitValue`    | `REAL` | 100              |
| Input Const | `eInitial`      | eInit  | eInit.InputValue |
| Input Const | `tInitDelay`    | `TIME` | TIME#5s0ms       |
| Output      | `rOut`          | `REAL` |                  |


---

# 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/damping/dampingt1.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.
