Programming concepts
5.5 Symbol table
S7-200 SMART
118
System Manual, V2.3, 07/2017, A5E03822230-AF
5.5
Symbol table
A symbol is a symbolic name you assign to a memory address or a constant. You can create
symbol names for the following memory types: I, Q, M, SM, AI, AQ, V, S, C, T, HC. Symbols
defined in the symbol table are global in scope. You can use your defined symbols in all of
the Program Organizational Units (Page 105) (POUs) of your program. If you make a
variable name assignment in a variable table (Page 121), the variable is local in scope. It
only applies to the POU where you defined it. This type of symbol is referred to as a "local
variable" to differentiate it from symbols that are global in scope. You can define symbols
either before or after you create your program logic.
WARNING
Risks with STEP 7-Micro/WIN Version 4.0 or greater (.mwp files) with absolute special
memory (SM) addressing
You can open a program (.mwp file) from an earlier version of STEP 7-Micro/WIN in STEP
7-Micro/WIN SMART. If that program uses symbolic special memory (SM) addressing, then
insert the System Symbol table in your project. The symbols map correctly to the current
SM addresses. If, however, the program uses absolute SM addressing, those absolute SM
addresses might no longer exist.
Programs based on inconsistent definitions of SM addresses can result in unexpected
machine or process operation. Unexpected machine or process operation can cause death
or serious injury to personnel, and/or damage to equipment.
If you open an .mwp file in STEP 7-Micro/WIN SMART, delete the "S7-200 Symbols" table
and insert the "System Symbols" table. The symbols in the former .mwp program map to
the current SM address scheme. Convert any absolute SM addresses to use the
corresponding symbol name.
Opening a symbol table
To open a symbol table from STEP 7-Micro/WIN SMART, use one of the following methods:
●
Click the Symbol Table button on the navigation bar (Page 29).
●
Select "Symbol Table" from the component drop down list in the Windows area of the
View menu.
●
Open the Symbol Table Folder in the project tree (Page 39); select a table name; then
press Enter or double-click the table name.
System symbol table
You can also use symbols from the System symbol table in your project. The pre-defined
table of system symbols provides access to commonly-used PLC special memory
(Page 799) addresses.
If the System symbol table is missing from your project, follow these steps to insert it:
1.
Right-click "Symbol Table" in the project tree
2.
Select the "Insert > System Symbol Table" command from the shortcut menu.