← Analog and Scaling

Clamp with Overflow

medium

Constrains a numeric input between Min and Max bounds and raises flags when limits are hit.

What it teaches

A clamp that also reports when its limits engage. Pin the value to Max (and raise a 'too high' flag) or to Min (and raise a 'too low' flag); inside the range, the value passes through with both flags off. Useful when downstream logic needs to know the rail was hit.

Parameters

TagDirectionTypeDefaultDescription
In_ValueInputREAL0Input value to clamp
Cfg_MinInputREAL10Lower bound limit
Cfg_MaxInputREAL90Upper bound limit
Out_ClampedOutputREAL0Constrained output value
Sts_TooHighOutputBOOL0Too high flag
Sts_TooLowOutputBOOL0Too low flag

Required behavior