The table below describes how to generate a symbol table with restriction in a single data block in STEP 7 V5.x.
||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)".
||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.
||Then delete the absolute addresses and line code (126) in every line, leaving only the symbol names and data types.
||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".|
||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.
||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.
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.