Technical data

Programming with STEP 7
Manual, 05/2010, A5E02789666-01 215
9 Creating Blocks and Libraries
9.1 Selecting an Editing Method
Depending on the programming language you use to create a program, you can enter your
program either in incremental input mode and/or free-edit (text) mode.
Incremental Editors for the Programming Languages Ladder Logic (LAD), Function Block
Diagram (FBD), Statement List (STL), or S7-GRAPH
In the incremental input mode editors for Ladder, FBD, STL, and S7-GRAPH, you create blocks
that are stored in the user program. You should choose to use incremental input mode if you want
to check what you have entered immediately. This edit mode is particularly suitable for beginners.
In incremental input mode, the syntax of each line or element is checked immediately after it has
been entered. Any errors are indicated and must be corrected before completing the entry. Entries
with correct syntax are automatically compiled and stored in the user program.
Any symbols used must be defined before editing the statements. If certain symbols are not
available, the block can not be fully compiled; this inconsistent interim version can, however, be
saved.
Source Code (Text) Editors for the Programming Languages STL, S7 SCL, or S7 HiGraph
In source code editors, you create source code files for subsequent compilation to generate
blocks.
We recommend you use source code editing, as this is a highly efficient program editing and
monitoring method.
The source code of the program or block is edited in a text file and then compiled.
The text files (source files) are stored in the sources folder of your S7 program, for example, as an
STL source file or SCL source file. A source file can contain code for one or multiple blocks. The
STL and SCL text editors allow you to generate source code for OBs, FBs, FCs, DBs, and UDTs
(user-defined data types), though you can use them to create a complete user program. One such
text file may contain the complete program (that is, all blocks) for a CPU.
When you compile the source file, the corresponding blocks will be generated and written to the
user program. All symbols used must be defined before you can compile them. Data errors are not
reported until the respective compiler interprets the source file.
It is imperative for compilation to stay conform with the prescribed syntax of the programming
language. A syntax check is only performed on account of a user instruction or when the source file
is compiled into blocks.