CLAMP

Clamps the input process variable to the range IPmin to IPmax.
OUT = Min(Max(PV, IPmin), IPmax)
clamp_block
Parameter values for the CLAMP function block:
Parameter
Data Type
Description
IPmin
REAL
Minimum input range parameter. Infinity or Not a Number (NaN) values are not supported by this input.
PV
REAL
Process variable having a REAL value
IPmax
REAL
Maximum input range parameter. Infinity or Not a Number (NaN) values are not supported by this input.
OUT
REAL
When PV is < IPmin or > IPmax, sets the IPmin or IPmax value respectively.
When PV is within range, sets to PV.
LIMIT
BOOL
TRUE when clamped, that is, LIMIT = (PV < IPmin) or (PV > IPmax)
FALSE when PV is within range of IPmin and IPmax.
When IPmax < IPmin, the function block assumes that the values are reversed and swaps them. The
ERRSTAT
Reversed error counter increments each time the function swaps the parameters.
When PV is Not a Number (NaN) value, OUT sets to IPmin, LIMIT to FALSE and the
ERRSTAT
Param error counter increments.
Function Block Diagram Example
clamp_fbdexample
Structured Text Example
CLAMP(MinValue, Input, Maxvalue); OutValue := CLAMP.OUT; Result := CLAMP.LIMIT;
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal