-

LT / LT_S

Type Function

Available 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 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'.

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

IN2

Output

OUT
Error behavior Error behavior
Additional information EN/ENO behavior