Technical data

Creating STL Source Files
13.5 Creating STL Source Files
Programming with STEP 7
294 Manual, 05/2010, A5E02789666-01
13.5.6 Inserting Source Code from Existing Blocks in STL Source Files
You can insert the source code from other blocks into your STL source file which were created in
Ladder, Function Block Diagram, or Statement List. This is possible for organization blocks (OB),
function blocks (FB), functions (FC), data blocks (DB), and user-defined data types (UDT).
Proceed as follows:
1. Activate the window of the source file in which you want to insert a block.
2. Position the cursor at the location in the file after which you want to insert the source code from
the block.
3. Select the menu command Insert > Object > Block.
4. Select the required block in the dialog box which appears.
An equivalent source file is generated from the block. The contents of the source file are inserted
after the cursor position.
13.5.7 Inserting External Source Files
You can create and edit a source file with any ASCII editor, then import it into a project and compile
it into individual blocks using this application. To do this, you must import the source files into the
"Source Files" folder of the S7 program in whose S7 user program the blocks created during
compilation are to be stored.
To insert an external source file, proceed as follows:
1. Select the source file folder of the S7 program in which the external source files are to be
imported.
2. Select the menu command Insert > External Source File.
3. In the dialog box which appears, enter the source file you want to import.
The file name of the source file you are importing must have a valid file extension. STEP 7 uses the
file extension to determine the source file type. This means, for example, that STEP 7 creates an
STL source file when it imports a file with the extension .AWL. Valid file extensions are listed in the
dialog box under "File Type."
Note
You can also use the menu command Insert > External Source File to import source files you
created with STEP 7 version 1.