Skip to main content

Operator: LIMIT

The IEC selection operator is used for limiting.

OUT := LIMIT(Min, IN, Max)

That means: OUT := MIN (MAX (IN, Min), Max)

Max is the upper limit and Min is the lower limit for the result. If the IN value is above the Max upper limit, then LIMIT yields Max. If the value of IN is below the Min lower limit, then the result is Min.

Permitted data types for IN and OUT: all

Example 125. Examples

Result in Var1: 80

ST

Var1 := LIMIT(30,90,80);