Type
| FunctionAvailable as standard (non-safety-related) and safety-related type (*_S). For the safety-related type, the safety-related data types (SAFE*) are expected at the formal parameters. |
Description
| Compares the operand connected to input IN1 with the operand connected to IN2 and sets OUT to TRUE if IN1 is less than or equal to IN2, otherwise OUT is set to FALSE. Comparison proceeds from left to right.A string/wstring comparison is also possible (observe the note below). The comparison also proceeds from left to right. The character 'Z' is greater than the character 'A'. Therefore the string 'Z' is greater than 'AZ' and 'AZ' is greater than 'ABC'.In order to compare two strings of unequal length, the shorter string should be extended by zeros on its right side until it has the same length as the longer string. |
Notes
|
- This function is not extendable, no further inputs can be added.
- OUT can be negated.Note: The negation of formal parameters is not supported in safety-related code (SNOLD).
- The function provides implicit data type conversion at its inputs according to the rules defined by the IEC 61131 standard.
- A WSTRING value must not be compared with a STRING value. If you want to do this comparison, first convert the STRING value to a WSTRING value using the TO_WSTRING function and then do the comparison.
|
Parameters
| Inputs
IN1
Data type: | ANY_(SAFE)ELEMENTARY |
Description: | First input value. |
IN2
Data type: | ANY_(SAFE)ELEMENTARY |
Description: | Second input value. |
Output
OUT
Data type: | (SAFE)BOOL |
Description: | TRUE if IN1 is less than or equal to IN2.
FALSE if IN1 is greater than IN2. |
|
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 |
Any input = NaN | TRUE
Note: The output value should actually be FALSE (internal error that is not issued). |
Any input = Inf+ or Inf- | TRUE / FALSE (depends on
comparison) |
|
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.
|