Академический Документы
Профессиональный Документы
Культура Документы
Contents Page
Objectives .................................................................................................................................... 2
Absolute and Symbolic Addressing ............................................................................................. 3
Symbolic Addressing .................................................................................................................. 4
The Symbol Table ....................................................................................................................... 5
Edit: Find and Replace ................................................................................................................ 6
View: Filter ................................................................................................................................... 7
View: Sort ................................................................................................................................... 8
Editing Symbols in the LAD/STL/FBD Editor ............................................................................... 9
Symbol Information in the LAD/STL/FBD Editor .......................................................................... 10
Symbol Selection in LAD/FBD .................................................................................................... 11
Symbol Table: Export .................................................................................................................. 12
Symbol Table: Import .................................................................................................................. 13
Exercise 1: Importing a Symbol Table …………………………..................................................... 14
A I0.0 A "SYSTEM_ON"
= Q8.0 = "LED_ON"
A I0.4 A "M_FORW"
= Q20.5 = "MOTOR_FOR"
Call FC18 Call "COUNT"
Absolute In absolute addressing, you specify the address (such as input I 1.0) directly. In
Addressing this case you don‘t need a symbol table, but the program is harder to read.
Symbolic In symbolic addressing, you use symbols (such as MOTOR_ON) instead of the
Addressing absolute addresses.
You store the symbols for inputs, outputs, timers, counters, bit memories and
blocks in the symbol table.
Where are symbols used? Where are they stored? With what are they created?
Global Symbols Global symbols are declared in the symbol table and can be used in all blocks
of a program.
The name in the symbol table must be unique, that is, a symbolic name must
appear only once in the table.
Local Symbols Local symbols are declared in the declaration part of a block. They can be used
only within that block.
The same symbolic name can be used again in the declaration part of another
block.
Notes The LAD/STL/FBD Editor always displays symbols declared in the global
symbol table in quotation marks. Local address symbols (local variables and
parameters) are always displayed with a # (hash or pound mark) in front of
them.
You don‘t have to include the quotation marks or the hash mark when you enter
symbolic addresses. The program editor automatically adds these for you.
Opening the Every "S7 program" has its own symbol table. You can open a symbol table
Symbol Table from the SIMATIC Manager, among other ways, with a double-click on the
"Symbols" icon.
You can also open the symbol table from the LAD/STL/FBD Editor using the
Options Æ Symbol Table menu option.
Table Structure In the symbol table, a line is created for every variable. You then enter the
symbol name, the address, the data type and a comment for the variable in the
columns. A blank line is automatically added at the end of the table for defining
a new symbol.
"Status" Column Invalid symbol definitions are marked as follows in this column:
= The symbol name or address is identical to another entry in the symbol
table.
x The symbol is incomplete (the symbol name and/or the address is missing).
Note As soon as a symbol table has been created, the declared symbols are also
available in all other tools (such as LAD/STL/FBD Editor, HW-Config, and
Monitor/Modify Variables etc.).
Find and Replace A number of options are available for finding and replacing text in the current
window:
• Find what:
Enter the text you are looking for.
• Replace with:
Enter the replacement text.
• From cursor down:
Searches downwards to the last line in the symbol table.
• From cursor up:
Searches upwards to the first line in the symbol table.
• Match case:
Only searches for the specified text with identical use of uppercase and
lowercase letters.
• Find whole words only:
Searches for the specified text as a separate word, not as part of a longer
word.
• All:
Searches through the whole symbol table, starting from the cursor position.
• Selection:
Searches only the selected symbol lines.
Note When looking for addresses, you must insert a wildcard after the address
identifier (? for one character, * for several characters), otherwise the address
cannot be found.
Example: For find and replace:
for example, replace all outputs that have address 8. with address 4.:
View: Filter Only the symbols which meet the active filter criteria ("symbol properties") are
displayed in the current window.
You can apply several criteria at once. The following filter criteria can be linked
with one another:
Name, Address, Data Type, Comment, Operator Control & Monitoring,
Communication, Message.
Permissible wildcards are ? for one character and * for several characters.
Examples • Name: M*
Only the names that begin with "M" and that contain any number of
additional characters are displayed in the symbol table.
• Name: SENSOR_?
Only the names that begin with "SENSOR_" and that contain one other
character are displayed in the symbol table.
• Address: I*.*
Only the inputs are displayed.
• Valid, Invalid
The symbols must be unique, that is, a symbol or an address must exist
only once in the symbol table. If a symbol or an address appears more than
once, the lines in which it appears are displayed in "Bold". If your symbol
table is long, and you want to find such ambiguous symbols or addresses
more quickly, you can display only these lines of the symbol table by
selecting the menu option View Æ Filter and the attribute "Invalid".
Sort The entries in the symbol table can be displayed in alphabetical order. You use
the View Æ Sort menu option to specify the column to be used as the point of
reference for sorting in the current window.
There is an alternative way to sort:
1. Click the column heading "Symbol, Address, Data type or Comment" for
sorting in ascending order in this column. Answer "Yes" when prompted.
2. Click the column heading once more for sorting in descending order in this
column. Answer "Yes" when prompted.
Edit Symbols With the menu option Edit Æ Symbols..., or a right mouse-click on the address
followed by the menu option Edit Symbols..., you can also assign symbolic
names to absolute addresses at a later point in time. These assigned names
are automatically entered into the symbol table.
If you assign a name that is already in the symbol table, it will be displayed in a
different color. Duplicate names cannot be used in the symbol table.
Addressing In the LAD/STL/FBD Editor you can choose to display the addresses in one of
the following two ways when you select the View Æ Display with Æ Symbolic
Representation menu option:
• Symbolic Addressing or
• Absolute Addressing.
You can display the symbolic and absolute address assignments used in the
network along with their comments by selecting the View Æ Display with Æ
Symbol Information menu option.
The assignments are found under the network in LAD/FBD and in STL they are
found in the statement line.
Symbol Information In the LAD/STL/FBD Editor settings you can select whether the symbol
information for the addresses is to be displayed directly at the address (see
right picture) or at the lower edge of the network (see left picture).
Note If you position the mouse pointer on an address, a "Tooltip" appears with the
symbol information for this address.
Introduction To simply writing a symbolic program , you can use the View Æ Display with Æ
Symbol Selection menu option to show a selection of symbols.
When you label the address and you enter the first letter of a symbol name, a
section of the symbol table pops up that starts with this letter.
All valid addresses for this block are displayed. These are all global variables
(even those declared in data blocks), local variables (temporary and static) and
the parameters of the affected block.
In the first column of the symbol selection you can either display the symbol or
the absolute address. To make the choice, select the Options Æ Settings Æ
View tab menu options in the LAD / FBD / STL Editor and define how you
would like to sort the selection list.
General The Symbol Table Æ Export menu option enables you to store symbol tables in
different file formats so that you can work on them with other programs. You
can select the following file formats:
• ASCII Format (*.ASC)
- Notepad
- Word
• Data Interchange Format (*.DIF)
- EXCEL
• System Data Format (*.SDF)
- ACCESS
• Assignment List (*.SEQ)
- STEP 5 assignment list
General The Symbol Table Æ Import menu option enables you to import symbol tables
that were created with other user programs.
Task You are to import a prepared system table that has, for example, been created
in a spread-sheet program (Excel) into your S7 project.
What to Do 1. In the SIMATIC Manager, open your S7 project called "My_Project" and
select the S7 program of the CPU.
2. Open the still empty symbol table by double-clicking on "Symbols"
3. Import the given symbol table "Symbols_e.dif"
Table Æ Import -> select <Drive>:\S7_Courses\Archive\PRO1 -> Choose
the file "Symbols_e.dif" -> open -> Answer ‘Yes‘ to the message that pops
up that asks if possible comments are to be accepted from the import file.
4. Save the symbol table.
Result All addresses that were assigned a symbolic name in the symbol table can be
addressed absolute or symbolic in the program creation with the LAD/FBD/STL
Editor. Comments from the symbol table can be displayed as "symbol
information".
You can add your own entries to this symbol table at any time, however, you
should not change the already prepared symbol assignments.