FB_RateLimiter (Function Block)
Limits the rate of change of the input signal.
The output tracks the input but cannot change faster than RisingLimit
units per second when increasing, or FallingLimit units per second when
decreasing. A limit of zero removes the restriction in that direction, allowing
the output to change freely.
Calling Reset() snaps the output to the current input immediately.
Note
The block is FINAL and must be instantiated, not extended.
Use FB_init to set fRisingLimit and fFallingLimit at
declaration time.
Extends: FB_SisoComponent
Properties
FallingLimit
Type: LREAL
Gets or sets the maximum rate of decrease in units per second.
The output will not fall faster than this value regardless of how quickly the input changes. A value of zero removes the falling limit entirely. Values below zero are clamped to zero.
RisingLimit
Type: LREAL
Gets or sets the maximum rate of increase in units per second.
The output will not rise faster than this value regardless of how quickly the input changes. A value of zero removes the rising limit entirely. Values below zero are clamped to zero.
Methods
FB_init
Inputs
Name |
Type |
Description |
|---|---|---|
|
|
if TRUE, the retain variables are initialized (warm start / cold start) |
|
|
if TRUE, the instance afterwards gets moved into the copy code (online change) |
|
|
Maximum rate of increase in units per second. Zero means no limit. |
|
|
Maximum rate of decrease in units per second. Zero means no limit. |
Reset
Snaps the output to the current input, bypassing the rate limit.
Run
Advances the rate limiter by one time step.
Note
Must be called once per cycle on a single PLC task. If the measured cycle time is zero the method returns early without updating the output.