# Ramp

## `Ramp` (FB)

FUNCTION\_BLOCK Ramp

### Short description

> Limitation of the signal change of an analog input signal\
> Typical application: damping / filtering

### Representation

<figure><img src="/files/1d6883d02130ab49f9b041d1008f145f500e9b65" 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      |             |               | Analog value output |
| *xRampActive* | BOOL      |             |               | Status - ramp       |

#### Setpoints / parameters

| Name           | Data type | Value range | Initial value    | Function                        |
| -------------- | --------- | ----------- | ---------------- | ------------------------------- |
| **rVariation** | REAL      | 0 …         | 100              | Maximum change per unit of time |
| **tTime**      | TIME      |             | T#10s            | Time unit                       |
| **rInitValue** | REAL      |             | 0                | Initial value                   |
| **eInitial**   | eInit     |             | eInit.InputValue | Selection of the initial value  |
| **tInitDelay** | TIME      |             | T#5s             | Start delay                     |

### Function description

#### General

The analog input signal *rIn* is continuously monitored for its value changes.\
If the signal at the analog value output *rOut* deviates from the input signal, it follows the input signal with the maximum signal change rate.

> **Setting of the time unit tTime**
>
> This setpoint / parameter may only take values >= 0.\
> The maximum signal change rate is formed by the quotient of the setpoints / parameters **rVariation** and **tTime** formed (**tTime** > 0s).

The maximum signal change rate is formed by the quotient of the setpoints / parameters **rVariation** and task cycle time (**tTime** = 0s).\
The maximum signal change rate applies to both positive and negative value changes at the input *rIn* effective.

#### 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 **tTime** has the value T#0s.

### CODESYS

InOut:

| Scope       | Name          | Type   | Initial          |
| ----------- | ------------- | ------ | ---------------- |
| Input       | `rIn`         | `REAL` |                  |
| Input Const | `rVariation`  | `REAL` | 100              |
| Input Const | `tTime`       | `TIME` | TIME#10s0ms      |
| Input Const | `rInitValue`  | `REAL` | 0                |
| Input Const | `eInitial`    | eInit  | eInit.InputValue |
| Input Const | `tInitDelay`  | `TIME` | TIME#5s0ms       |
| Output      | `rOut`        | `REAL` |                  |
| Output      | `xRampActive` | `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/damping/ramp.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.
