High−level Instructions
3 − 618
Description
The character string specified for “S1” is compared to that specified for S2, and the judgment result is output to
special internal relays R9009 to R900C (judgment flags for comparison instructions).
R9009 to R900C are assigned based on whether “S1” or “S2” is larger, as shown in the table below.
Relationship
Flag
of S1 and S2
R900A R900B R900C R9009
> = < Carry
S1<S2 OFF OFF ON Fluctuates
S1=S2 OFF ON OFF OFF
S1>S2 ON OFF OFF Fluctuates
Precautions during programming
If the number of characters is different, the greater/lesser relationship is as shown below.
S1 Greater/lesser S2
“ABCDE” = “ABCDE”
“ABCD” < “ABCDE”
“B” > “ABCDE”
Comparison of character strings is performed in sequence from byte 0, one character at a time.
If one character string has fewer characters than the other, it may still be handled as larger if a large character
code is used when the comparison is made.
Example: “B” > “ABCDE”
To specify a character string, indicate the number of the area in which the character size and number of
characters have been specified.
For detailed information about the table configuartion of data area
see page 3 − 615.
Flag conditions
・Error flag (R9007): Turns on and stays on when:
・Error flag (R9008): Turns on for an instant when:
− The specified range is exceeded when an index is modified.
− The number of characters is larger than the character string size.