15 logical comparisons in string execution, 1 equal to (==), 2 less than (<) – HEIDENHAIN TNC 407 (243 020) Technical Manual User Manual
Page 580

3.15 Logical Comparisons in STRING Execution
Two STRINGS are compared according to the argument as follows:
If STRING memory or Immediate STRING are entered in the command, both STRINGS are compared
character for character. The Logic Accumulator is reset after the first character for which the comparison
conditions are not fulfilled. The remaining characters are checked no further. For the purposes of
comparison, the number of the character in the ASCII table is always used. This results in, for example:
A < B
AA > A
If PLC-Error messages or PLC-Dialogue texts are entered, the position in the file (0 to 4095) is
compared, not the actual text as with Immediate STRING.
The execution times depend on the length of the STRINGS. The quoted times represent maximum
values. With the Immediate STRINGS, the length "n" of the STRINGS respectively must be added to
the command length. In the event that this is odd, the next larger even-numbered length must be
added.
3.15.1 EQUAL TO (==)
Abbreviation for PLC Editor:
== (
EQUAL
)
Execution time [µs]
< 100
Number of bytes
STRING memory
12
Immediate STRING
20 + n
STRING from error message or dialogue files
26
Operands: S
Operation:
With this command a direct transition from STRING- to logic execution takes place. The content of
the STRING Accumulator is compared with the STRING in the Argument.
If the STRING Accumulator and the operand are equal, the condition is true and the Logic
Accumulator is set to 1. If they are not equal the Logic Accumulator is set to 0.
3.15.2 LESS THAN (<)
Abbreviation for PLC Editor:
< (LESS THAN)
Execution time [µs]
< 100
Number of bytes
STRING memory
12
Immediate STRING
20 + n
STRING from error message or dialogue files
26
Operands: S
Operation:
With this command a direct transition from STRING to Logic execution takes place. The content of
the STRING Accumulator is compared with the STRING in the Argument. If the STRING Accumulator
is smaller than the operand, the condition is true and the Logic Accumulator is set to 1. If the STRING
Accumulator is greater than or equal to the operand the Logic Accumulator is set to 0.