RAMP_INT

Bibliothek: Util

The function block RAMP_INT smoothes the given input signal IN by limiting its rate of change and then outputs the resulting value in Out. The parameters ASCEND and DESCEND, together with the parameter TIMEBASE and the call frequency of the function block, determine the smoothing behaviour.

Attention

For the calculations within the function block, CODESYS uses the data type INTEGER! So also the change in value, given in the output signal, is an integer value. If this behaviour does not meet your requirements, please instead use the function block RAMP_REAL. RAMP_INT is a speed-optimized variant or RAMP_REAL.

See also

Input
Name Data type Description
IN INT (Discrete) value of the input signal
ASCEND INT

Limitation of acceleration: Maximum ascent per time base

Example: ASCEND := 25 and TIMEBASE := T#1s => Maximum ascent of 25 increments per second

DESCEND INT

Limitation of deceleration: Maximum descent per time base (DESCEND > 0)

Example: DESCEND := 20 uandnd TIMEBASE := T#500ms => Maximum ascent of 20 increments in 500 milliseconds

TIMEBASE TIME

Time base, to which the limitations ASCEND and DESCEND refer.

Example: t#1s

If TIMEBASE = t#0s, then the time base equals the task cycle time. In this case the limitation refers to a task cycle. Usually this corresponds exactly to one call of the function block RAMP_INT.

Note: If the time base TIMEBASE is smaller than the task, this will lead to a violation of the sampling theorem and might result in a loss of information in the output signal.

RESET BOOL

Reset of the function block

TRUE: The internal calculations are stopped and the function block gets reinitialized. The last output value OUT is maintained and will be used for the new calculation after a restart of the function block.

FALSE: The smoothed input signal is given in OUT.

Ausgang
Name Data type Description
OUT INT

(Discrete) value of the output signal

The value gets stored internally and will be used for the calculation of the ascent and the descent of the input signal.

Attention

The parameters ASCEND, DESCEND and TIMEBASE, in relation to the call frequency of the function block, might be determined in a way that does not match the sampling theorem. This might lead to a loss of information in the output signal.

Example in CFC

../_images/139811e71e8fd23fc0a8640e01947982
../_images/fbd28ddf1e8fd64fc0a8640e01947982