Siemens SIMATIC S7-200 System Manual page 111

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

Advertisement

Example: Compare Instructions
S7-200 Instruction Set
Network 1
//Turn analog adjustment potentiometer 0
//to vary the SMB28 byte value.
//Q0.0 is active when the SMB28 value
//is less than or equal to 50.
//Q0.1 is active when the SMB28 value
//is greater than or equal to 150.
//The status indicator is on when
//the comparison is true.
LD
I0.0
LPS
AB<=
SMB28, 50
=
Q0.0
LPP
AB>=
SMB28, 150
=
Q0.1
Network 2
//Load V memory addresses with
//low values that make the comparisons
//false and that turn
//the status indicators off.
LD
I0.1
MOVW
- -30000, VW0
MOVD
- -200000000, VD2
MOVR
1.012E- -006, VD6
Network 3
//Load V memory addresses with
//high values that make the
//comparisons true and that turn
//the status indicators on.
LD
I0.2
MOVW
+30000, VW0
MOVD
- -100000000, VD2
MOVR
3.141593, VD6
Network 4
//The Integer Word comparison tests
//to find if VW0 > +10000 is true.
//Uses program constants to show the
// different data types. You can also
//compare two values
//stored in programmable memory
//like: VW0 > VW100
LD
I0.3
LPS
AW>
VW0, +10000
=
Q0.2
LRD
AD<
- -150000000, VD2
=
Q0.3
LPP
AR>
VD6, 5.001E- -006
=
Q0.4
Chapter 6
97

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents