LIMIT is an IEC selection operator in the CODESYS development system that limits a value to a range. It is written as OUT := LIMIT(Min, IN, Max) and is equivalent to OUT := MIN(MAX(IN, Min), Max), so a value above Max returns Max and a value below Min returns Min. The source gives the example Var1 := LIMIT(30,90,80); which returns 80.
| Language | structured text |
|---|---|
| Code | LIMIT |
| Group | selection operator |
| Syntax | OUT := LIMIT(Min, IN, Max) |
| Dialect | CODESYS |
| Name | Description | Data type |
|---|---|---|
| Min | Lower limit for the result. | |
| IN | Value to be limited. | all |
| Max | Upper limit for the result. | |
| OUT | Result of the limiting operation. | all |