100BBasic instructions
7.4 Compare
S7-1200 Programmable controller
184
System Manual, 11/2011, A5E02486680-05
Table 7- 29 Comparison descriptions
Relation type
The comparison is true if ...
==
IN1 is equal to IN2
<>
IN1 is not equal to IN2
>=
IN1 is greater than or equal to IN2
<=
IN1 is less than or equal to IN2
>
IN1 is greater than IN2
<
IN1 is less than IN2
7.4.2
In-range and Out-of-range instructions
Table 7- 30 In Range and Out of Range instructions
LAD / FBD
SCL
Description
out := IN_RANGE(min, val,
max);
out := OUT_RANGE(min, val,
max);
Tests whether an input value is in or out of a specified value range.
If the comparison is TRUE, then the box output is TRUE.
1
For LAD and FBD: Click the "???" and select the data type from the drop-down list.
Table 7- 31 Data types for the parameters
Parameter
Data type
1
Description
MIN, VAL, MAX
SInt, Int, DInt, USInt, UInt, UDInt, Real, LReal, Constant
Comparator inputs
1
The input parameters MIN, VAL, and MAX must be the same data type.
●
The IN_RANGE comparison is true if: MIN <= VAL <= MAX
●
The OUT_RANGE comparison is true if: VAL < MIN or VAL > MAX