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 input IN2 and sets OUT to TRUE if IN1 is not equal to IN2, otherwise OUT is set to FALSE.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'.For the purposes of comparison of two strings of unequal length, the shorter string shall be considered to be extended on the right to the length of
the longer string by characters with the value zero. |
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 and IN2 are not equal. FALSE if IN1 and IN2 are equal. |
|
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 |
Any input = Single Inf+ | TRUE |
Any input = Single Inf- | TRUE |
Mix of Inf+ and Inf- at inputs | FALSE, if all inputs are the
same |
|
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.
|