# LGF_LimRateOfChangeCI (FB / 3.0.1)

Overview

Author: Siemens Digital Industries

## Short description

This function limits the rate of change of an input variable. A jump function becomes a ramp function.

### Block Interface

| LGF_LimRateOfChangeCI (FB) |
--- | --- | ---
LReal |  |  | value |  | delayedValue |  |  | LReal
LReal |  |  | setChangeRate |  | error |  |  | Bool
LReal |  |  | defaultOutValue |  | status |  |  | Word
Bool |  |  | enDefaultOutValue |  | subfunctionStatus |  |  | Word
OB_CYCLIC |  |  | callOB |  |  |  |  |

### Input parameter

Identifier | Data type | Default value | Description
--- | --- | --- | ---
value | LReal | 0.0 | Signal to be processed and limited in its rate of change
setChangeRate | LReal | 0.0 | Rate of change of ramp function (1/second)
defaultOutValue | LReal | 0.0 | Value for pre-assignment of the output variable (`outputValue` = `defaultOutValue`)
enDefaultOutValue | Bool | FALSE | Assign default output value (`outputValue` = `defaultOutValue`)
callOB | OB_CYCLIC | --- | Calling wake-alarm interrupt OB (cyclic interrupt OB)

### Output parameter

Identifier | Data type | Description
--- | --- | ---
delayedValue | LReal | Output variable
error | Bool | FALSE: No error TRUE: An error occurred during the execution of the FB
status | Word | 16#0000-16#7FFF: Status of the FB 16#8000-16#FFFF: Error identification (see following Table)
subfunctionStatus | Word | Status or return value of called FB's, FC's and system blocks

### Status & Error codes

Code / Value | Identifier / Description
--- | ---
16#0000 | STATUS_FINISHED_NO_ERROR Status: Execution finished without errors
16#8200 | ERR_NEG_RATE_LIM Error: Negative rate of change. The parameter for the change rate must not be negative.
16#8600 | ERR_QRY_CINT Error in `QRY_CINT` command - check `subFunctionStatus` code
16#8601 | ERR_OB_UNAVAILABLE Error: OB on input `callOB` is not configured / present. Interconnect the constant name of a configured cyclic interrupt OB at the input `callOB`.

## Functional description

NOTE
  The status of called commands is output in `subFunctionStatus`. In this case, the output value in `status` indicates which command caused the error. In this case, refer to the TIA Portal Online Help section for information on the respective commands.

The ramp is a limit line and refers to a rate of change per second; if, for example, `setChangeRate = 10.0` is parameterized at a sampling time of 1s/100ms/10ms for every block call, then if `value > delayedValue`, 10.0/1.0/0.1 is added to `delayedValue` until `value` is reached.

The limitation of the rate of change applies to both positive and negative values for the rise and fall.

The output `delayedValue` can be preset or initialized.

The time interval of the calling cyclic interrupt OB is determined by interconnecting the calling cyclic interrupt OB at the input parameter `callOB`.

### Pre-assigning an output

If `enDefaultOutValue = TRUE` is set, the value at `defaultOutValue` is output. When changing from `TRUE` to `FALSE`, the output `delayedValue` is ramped from `defaultOutValue` to `value`. When changing from `FALSE` to `TRUE`, the output `delayedValue` immediately jumps to `defaultOutValue`.

### Functional processes

The Figure below shows the ramp function sequence:

## Change log

Version & Date | Change description
--- | ---
| 1.0.0 | Siemens Industry Online Support
| 21.06.2016 | First released version
| 1.0.1 | Siemens Industry Online Support
| 02.01.2017 | Upgrade: TIA Portal V14 Update 1
| 1.0.2 | Siemens Industry Online Support
| 17.08.2018 | Upgrade: TIA V15 Update 2
| 1.0.3 | Siemens Industry Online Support
| 23.11.2018 | Upgrade: TIA V15.1
| 1.0.6 | Simatic Systems Support
| 15.11.2019 | Regions, comments and constants are added
| 3.0.0 | Simatic Systems Support
| 23.04.2020 | Set version to V3.0.0, harmonize the version of the whole library
| 3.0.1 | Simatic Systems Support
| 22.03.2021 | Insert documentation