S7-200 Programmable Controller System Manual
Compare String
The Compare String instruction compares two strings of
ASCII characters:
IN1 = IN2
IN1 <> IN2
When the comparison is true, the Compare instruction turns
the contact (LAD) or output (FBD) on, or the compare
instruction Loads, ANDs or ORs a 1 with the value on the
top of the stack (STL).
Notice
The following conditions are fatal errors and cause your
S7-200 to immediately stop the execution of your
program:
H Illegal indirect address is encountered (any compare
instruction)
H A string with a length greater than 254 characters is
encountered (Compare String instruction)
H A string whose starting address and length are such
that it will not fit in the specified memory area
(Compare String instruction)
To prevent these conditions from occurring, ensure that
you properly initialize pointers and memory locations that
are intended to hold ASCII strings prior to executing
compare instructions that use these values. Ensure that
the buffer reserved for an ASCII string can reside
completely within the specified memory area.
Compare instructions are executed regardless of the state
of power flow.
Table 6-16
Valid Operands for the Compare String Instructions
Inputs/Outputs
IN1
IN2
Output (OUT)
98
Type
Operands
STRING
VB, LB, *VD, *LD, *AC, constant
STRING
VB, LB, *VD, *LD, *AC
BOOL
I, Q, V, M, SM, S, T, C, L, Power Flow