|
Instructions The table below describes how to generate a symbol table with restriction in a single data block in STEP 7 V5.x.
| No. |
Procedure |
| 1 |
Open the symbol table in the SIMATIC Manager and export it to a designated path, on your hard drive, for example, by means of "Table > Export...".
- Before exporting the data, the file type must be set to "ASCII format (*ASC)".

Fig. 01
|
| 2 |
Open the exported ASC file using WordPad, for example, and delete any FB, FC, SFC, SFB and DB-type symbols there may be. There may only be symbols present for inputs, outputs and markers.

Fig. 02
|
| 3 |
Then delete the absolute addresses and line code (126) in every line, leaving only the symbol names and data types.

Fig. 03
|
| 4 |
Insert an STL source into the source folder in the SIMATIC Manager and open the source. Configure a template for the data block by means of the menu command "Insert > Block Template > DB". |
| 5 |
Copy the data range from the ASC file (Fig. 03) to the block template for the STL source between "STRUCT" and "END_STRUCT". Then add the syntax for the copied tags:
- colon after the symbol names and
- semicolon after the data types ("Emergency: BOOL;", for example),
- delete any comments which are not required (green text) from the DB template,
- also delete the tag "b0" from the declaration and the instruction "b0:= b#16#01" between "BEGIN" and "END_DATA_BLOCK".
Also change the number of the data block in accordance with your STEP 7 program.

Fig. 04
|
| 6 |
Save and compile the source data block via the disk and compiler icons or via "File > Save" and "File > Compile". Once the data block has been successfully compiled, the data block (in this case DB10) is generated and saved in the block folder.

Fig. 05
|
If you wish to generate larger data blocks with many input and output variables which are already contained in the symbol table, you can generate a data block with this method without having to re-enter the data once again.
Additional Keywords
Implementation, Conversion
|