100BBasic instructions
7.4 Compare
S7-1200 Programmable controller
System Manual, 11/2011, A5E02486680-05
183
Type shown in counter instruction (for preset
and count values)
Corresponding structure Type shown in FB
interface
INT
IEC_Counter
SINT
IEC_SCounter
DINT
IEC_DCounter
UINT
IEC_UCounter
USINT
IEC_USCounter
UDINT
IEC_UDCounter
1.
Open the block that will use this FB.
2.
Place this FB at the desired location. Doing so results in the creation of an instance data
block for this FB.
3.
Open the instance data block created when you placed the FB in the editor.
4.
Under Static, locate the counter structure of interest. In the Retain column for this counter
structure, check the box to make this structure retentive.
7.4
Compare
7.4.1
Compare
Table 7- 27 Compare instructions
LAD
FBD
SCL
Description
out := in1 == in2;
or
IF in1== in2,
THEN out := 1;
ELSE out := 0;
END_IF;
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.
1
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 7- 28 Data types for the parameters
Parameter
Data type
Description
IN1, IN2
SInt, Int, DInt, USInt, UInt, UDInt, Real, LReal, String, Char,
Time, DTL, Constant
Values to compare