Basic instructions
8.4 Comparator operations
S7-1200 Programmable controller
250 System Manual, V4.2, 09/2016, A5E02486680-AK
Comparator operations
8.4.1
Compare values instructions
Table 8- 28 Compare instructions
or
IF in1 = in2
THEN out := 1;
ELSE out := 0;
Compares two values of the same data type. When the
LAD contact comparison is TRUE, then the contact is
activated. When the FBD box comparison is TRUE,
then the box output is TRUE.
For LAD and FBD: Click the instruction name (such as "==") to change the comparison type from the drop-down list.
Click the "???" and select data type from the drop-down list.
Table 8- 29 Data types for the parameters
IN1, IN2 Byte, Word, DWord, SInt, Int, DInt, USInt, UInt, UDInt, Real,
LReal, String, WString, Char, Char, Time, Date, TOD, DTL,
Values to compare
Table 8- 30 Comparison descriptions
The comparison is true if ...
IN1 is greater than or equal to IN2
IN1 is less than or equal to IN2