FB_BA_RampLmt

The function block FB_BA_RampLmt limits the increase or decrease speed of an input signal.
As fIn rises, the output fOut is limited to the slope of (fHi-fLo)/nTiUp.
When fIn decreases, the output fOut is limited to the slope of (fHi-fLo)/nTiDwn.
When the function block is activated (rising edge on bEn), the function block output fOut is initially set equal to the input fIn before it begins to track fIn. If the function block is not active (bEn = FALSE), then fOut = 0.
![]() | fLo must be less than fHi. If fLo is greater than fHi, fLo is limited to fHi. According to the calculation shown, this means that the output fOut immediately follows the input fIn. |

Syntax
FUNCTION_BLOCK FB_BA_RampLmt
VAR_INPUT
bEn : BOOL;
fIn : REAL;
bSync : BOOL;
fSync : REAL;
fHi : REAL;
fLo : REAL;
nTiUp : UDINT;
nTiDwn : UDINT;
END_VAR
VAR_OUTPUT
fOut : REAL;
END_VAR
Inputs
Name | Type | Description |
|---|---|---|
bEn | BOOL | Function block enable; when a rising edge occurs, fOut is set to fIn. If bEn is FALSE, then fOut = 0.0. |
fIn | REAL | Input value of the ramp function |
bSync | BOOL | When a rising edge is applied to bSync, the output is set to fSync, so that in the next cycle, the system ramps up or down from this value. This functionality is enabled only if the function block is also enabled in the same cycle using bEn. |
fSync | REAL | Value to which the output is synchronized using bSync. |
fHi | REAL | Upper interpolation point for calculating the ramps |
fLo | REAL | Lower interpolation point for calculating the ramps. fHi must be greater than fLo; otherwise an error is output! |
nTiUp | UDINT | Rise time [s]. |
nTiDwn | UDINT | Fall time [s]. |

Outputs