Comparison Contact Instructions - Siemens Simatic S7-200 System Manual

Programmable controller
Hide thumbs Also See for Simatic S7-200:
Table of Contents

Advertisement

10.3 Comparison Contact Instructions

Compare Byte
L
n1
A
==B
D
n2
n1
>=B
n2
n1
<=B
n2
S
LDB=
T
AB=
L
OB=
LDB>=
AB>=
OB>=
LDB<=
AB<=
OB<=
212
214
Compare Word Integer
L
n1
A
==I
D
n2
n1
>=I
n2
n1
<=I
n2
S
LDW=
T
AW=
L
OW=
LDW>= n1, n2
AW>=
OW>=
LDW<= n1, n2
AW<=
OW<=
212
214
S7-200 Programmable Controller System Manual
C79000-G7076-C230-02
The Compare Byte instruction is used to compare two values:
n1 to n2. A comparison of n1 = n2, n1 >= n2, or n1 <= n2 can be
made.
Operands:
In LAD, the contact is on when the comparison is true.
In STL, the instructions Load, AND, or OR a 1 with the top of
stack when the comparison is true.
Byte comparisons are unsigned.
n1, n2
n1, n2
Note: You can create a <>, <, or > comparison by using the Not
n1, n2
instruction with the =, >=, or <= Compare instruction. The
following sequence is equivalent to a <> comparison of VB100
n1, n2
to 50:
n1, n2
n1, n2
LDB=
NOT
n1, n2
n1, n2
n1, n2
215
216
The Compare Word Integer instruction is used to compare two
values: n1 to n2. A comparison of n1 = n2, n1 >= n2, or
n1 <= n2 can be made.
Operands:
In LAD, the contact is on when the comparison is true.
In STL, the instructions Load, AND, or OR a 1 with the top of
stack when the comparison is true.
Word comparisons are signed (16#7FFF > 16#8000).
n1, n2
n1, n2
Note: You can create a <>, <, or > comparison by using the Not
n1, n2
instruction with the =, >=, or <= Compare instruction. The
following sequence is equivalent to a <> comparison of VW100
to 50:
n1, n2
n1, n2
LDW= VW100, 50
NOT
n1, n2
n1, n2
215
216
n1, n2:
VB, IB, QB, MB, SMB, AC, Constant,
*VD, *AC, SB
VB100, 50
n1, n2:
VW, T, C, IW, QW, MW, SMW, AC,
AIW, Constant, *VD, *AC, SW
Instruction Set
10-7

Advertisement

Table of Contents
loading

Table of Contents