2-8
S7-200 Programmable Controller, CPU 210
C79000-G7076-C235-01
Entering Your Program in Statement List
The Statement List (STL) Editor is a free-form text editor which allows a certain degree of
flexibility in the way you choose to enter program instructions. Figure 2-6 shows an example
of a statement list program.
You can cut, copy, and paste in the STL Editor. STEP 7-Micro/WIN also includes
search-and-replace functions.
// Program for a Home Security System
NETWORK 1
//Sound the alarm!
LD
I0.3
// If (the panic alarm has been turned on)
LDW>=
T0, +600
// or (if the alert timer is >= 60 seconds
A
I0.2
// and the system is armed)
OLD
// then
S
M0.1, 1
// set the high-level alarm bit
S
Q0.3, 1
// set the modem dialer bit
R
M0.2, 1
// reset the low-level alarm bit
Network 2
//Evaluate the system status.
LDN
I0.0
// If zone 1 is open
ON
I0.1
// or if Zone 2 is open
STL Editor - project1.ob1
STL
To allow viewing the
program in STL or Ladder,
divide segments of code
with keyword NETWORK.
Figure 2-6
STL Editor Window with Sample Program
To enter an STL program, follow these guidelines:
S
Start each comment with a double slash (//). Each additional comment line must also
begin with a double slash.
S
End each line with a carriage return.
S
Separate each instruction from its address or parameter with a space or tab.
S
Do not use a space between the operand type and the address (for example, enter
I0.0
,
not
I 0.0
).
S
Separate each operand within an instruction with a comma, space, or tab.
S
Use quotation marks when entering symbol names. For example, if your symbol table
contains the symbol name Start1 for the address
I0.0
, enter the instruction as follows:
LD “Start1”
To be able to view an STL program in ladder, you must divide segments of code into
separate networks by entering the keyword NETWORK. (Network numbers are generated
automatically after you compile or upload the program.)
Compiling the Program
After completing a network or series of networks, you can check the syntax of your code by
selecting the menu command CPU
"
Compile or by clicking the Compile button:
Installing and Using the STEP 7-Micro/WIN Version 2.0 Software
Содержание Simatic S7-200 CPU 210
Страница 10: ...x S7 200 Programmable Controller CPU 210 C79000 G7076 C235 01 Contents ...
Страница 68: ...3 28 S7 200 Programmable Controller CPU 210 C79000 G7076 C235 01 Getting Started with a Sample Program ...
Страница 116: ...A 16 S7 200 Programmable Controller CPU 210 C79000 G7076 C235 01 CPU 210 Data Sheets ...
Страница 126: ...F 2 S7 200 Programmable Controller CPU 210 C79000 G7076 C235 01 CPU 210 Order Numbers ...
Страница 138: ...Index 12 S7 200 Programmable Controller CPU 210 C79000 G7076 C235 01 Index ...