Program instructions
7.4 Compare
S7-200 SMART
System Manual, 09/2015, A5E03822230-AC
193
OB= IN1, IN2
AB= IN1, IN2
Compare two unsigned byte values:
The result is TRUE, if IN1 = IN2
OW= IN1, IN2
AW= IN1, IN2
Compare two signed integer values:
The result is TRUE, if IN1 = IN2
OD= IN1, IN2
AD= IN1, IN2
Compare two signed double integer values:
The result is TRUE, if IN1 = IN2
OR= IN1, IN2
AR= IN1, IN2
Compare two signed real values:
The result is TRUE, if IN1 = IN2
Note
The following conditions cause a non-fatal error, set power flow to OFF (ENO bit = 0), and
use value 0 as the result of the comparison
•
Illegal indirect address is encountered (any compare instruction)
Illegal real number (for example, NaN) is encountered for compare real instruction
To prevent these conditions from occurring, ensur
e that you properly initialize pointers and
values that contain real numbers before executing compare instructions that use these
values.
Compare instructions are executed regardless of the state of power flow
.