Type
| Function |
Description
| Limits the value of the input parameter IN to the value range defined by the input parameters MN (minimum limit) and MX (maximum limit) as follows:OUT := MIN(MAX(IN,MN),MX)where the function MIN determines the minimum limit for the output value and the function MAX the maximum limit for the output value.
- The value connected to IN is written to the output if the value is in the range of MN and MX.
- If the value at IN1 is smaller than the MN value (IN1 < MN), the MN value is written to the output.
- If the value at IN1 is greater than the MX value (IN1 > MX), the MX value is written to the output.
|
Notes
|
- The function provides implicit data type conversion at its input and output parameters according to the rules defined by the IEC 61131 standard.
- The function is an overloaded function. It can operate on various input data types.
- The function is not extendable, no further inputs can be added.
|
Parameters
| Inputs
MN
Data type: | ANY_ELEMENTARY |
Description: | Minimum limit. |
IN
Data type: | ANY_ELEMENTARY |
Description: | Input value. |
MX
Data type: | ANY_ELEMENTARY |
Description: | Maximum limit. |
Output
OUT
Data type: | ANY_ELEMENTARY |
Description: | Output value. |
|
Error behavior | Error behavior
The following table shows the errors which may occur while executing the function and the value returned by the function in the corresponding error case.
Error case | Output value |
MIN > MAX | MIN(MAX(IN,MN),MX) (See the function description above) |
Any input = NaN | IN value |
Any input = Inf+ | IN value |
Any input = Inf- | IN value |
Resulted string too short | Empty string |
Note
String comparison: In case of a string error, the function returns the empty string ''. Furthermore, the controller runtime logs the error in its error catalog and a corresponding error message is shown in the Error List. |
Note
Controller stop on string error: The controller can be automatically stopped when a string error occurs. This allows you to locate the error in your project. To enable the automatic stop of the controller in case of a string error, activate the button in the Cockpit toolbar of the controller. |
|
Additional information
| EN/ENO behavior
The POU is only executed if TRUE is applied to the EN input. If EN = FALSE, the POU is not executed and ENO = FALSE indicates the inactivity.
If any of the errors listed under "Error behavior" occurs while executing the function, ENO is set to FALSE.
|