Siemens Simatic S7-200 System Manual page 116

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

Advertisement

Basic Concepts for Programming an S7-200 CPU
Understanding the Statement List Instructions
Statement list (STL) is a programming language in which each statement in your program
includes an instruction that uses a mnemonic abbreviation to represent a function of the
CPU. You combine these instructions into a program to produce the control logic for your
application.
Figure 6-4 shows the basic elements of a statement list program.
STL Editor - project1.ob1
STL
//Conveyor Line Program
NETWORK
LD
"Start1"
AN
"E-Stop1"
=
Q0.0
NETWORK
LD
I0.1
O
I0.3
R
Q0.0, 1
NETWORK
MEND
Figure 6-4
The STL instructions use a logic stack in the CPU for solving your control logic. As shown in
Figure 6-5, this logic stack is nine bits deep by one bit wide. Most of the STL instructions
work either with the first bit or with the first and the second bits of the logic stack. New values
can be "pushed" (or added) onto the stack; when the top two bits of the stack are combined,
the stack is "popped" (reduced by one bit).
While most STL instructions only read the values in the logic stack, many STL instructions
also modify the values stored in the logic stack. Figure 6-5 shows examples of how three
instructions use the logic stack.
6-6
//Start Motor:
//When I0.0 is on
//and I0.1 is not on,
//then turn on conveyor motor.
//E-stop Conveyor:
//When E-stop 1 is on
//or when E-stop 2 is on,
//turn off conveyor motor.
//End of Program
STL Editor Window with Sample Program
Begin each comment with a
double slash (//).
Instruction
Operand
S7-200 Programmable Controller System Manual
C79000-G7076-C230-02

Advertisement

Table of Contents
loading

Table of Contents