Symbols PDF

You might also like

You are on page 1of 14

Symbols

SIMATIC S7 Date: 22.08.2007


SITRAIN Training for
Automation and Drives
Siemens AG 2000. All rights reserved. File: PRO1_05E.1

Contents Page

Absolute and Symbolic Addressing ............................................................................................. 2


Symbolic Addressing - Overview ….............................................................................................. 3
Opening the Symbol Table ................................................................................................................ 4
Edit: Find and Replace …............................................................................................................. 5
View: Filter .................................................................................................................................. 6
View: Sort …................................................................................................................................. 7
Symbol Table: Export ..................................................................................................................... 8
Symbol Table: Import ..................................................................................................................... 9
Editing Symbols (in the LAD/STL/FBD Editor) ............................................................................... 10
Symbol Information (in the LAD/STL/FBD Editor) .......................................................................... 11
Symbol Selection (in the LAD/STL/FBD Editor) ............................................................................. 12
"Leading Symbol" .......................................................................................................................... 13
Exercise: Creating a Symbol Table for the Conveyor Model ........................................................ 14

SITRAIN Training for ST-7PRO1


Automation and Drives Page 1 Symbols
Absolute and Symbolic Addressing

A I 0.0 A "SYSTEM_ON"
= Q8.0 = "ON_INDIC"
A I 0.4 A "M_FORW"
= Q20.5 = "MOTOR_FORW"
Call FC18 Call "COUNT"

Symbol Address Data Type Comment


MOTOR_FORW Q20.5 BOOL Motor forwards
COUNT FC18 FC18 Count bottles
SYSTEM_ON I 0.0 BOOL Switch on system
ON_INDIC Q8.0 BOOL Indicator: System is “On”
M_FORW I 0.4 BOOL M.-con.switch: Motor forwards

(max. 24 characters) (max. 80 characters)

SIMATIC S7 Date: 22.08.2007


SITRAIN Training for
Automation and Drives
Siemens AG 2000. All rights reserved. File: PRO1_05E.2

Absolute In absolute addressing, you specify the address (e.g. input I 1.0) direct. In this
Addressing case you don‘t need a symbol table, but the program is harder to read.

Symbolic In symbolic addressing, you use symbols (e.g. 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.

Note When you enter symbol names, you don‘t have to include quotation marks. The
Program Editor adds these for you.

SITRAIN Training for ST-7PRO1


Automation and Drives Page 2 Symbols
Symbolic Addressing - Overview

Where are symbols used? Where are they stored? With what are they created?

Global Data: Symbol Table Symbol Editor


- Inputs
- Outputs
- Bit mem., timers, counters
- Peripheral I/O

Local Block Data: Declaration part of Program Editor


- Block parameters the block
- local / temporary data

Jump Labels Code section of Program Editor


the block
Block Names: Symbol Table Symbol Editor
- OB
- FB
- FC
- DB
- VAT
- UDT

Data Block Components Declaration part of the DB Program Editor

SIMATIC S7 Date: 22.08.2007


SITRAIN Training for
Automation and Drives
Siemens AG 2000. All rights reserved. File: PRO1_05E.3

Global Symbols Global symbols declared in the symbol table can be used in all blocks of a
program.
The name in the symbol table must be unique, that is, a symbolic name must
only appear once in the table.

Local Symbols Local symbols are declared in the declaration part of a block. They can only be
used within that block.
The same symbolic name can be used again in the declaration part of another
block.

SITRAIN Training for ST-7PRO1


Automation and Drives Page 3 Symbols
Opening the Symbol Table

SIMATIC S7 Date: 22.08.2007


SITRAIN Training for
Automation and Drives
Siemens AG 2000. All rights reserved. File: PRO1_05E.4

Symbol Table You open the symbol table by selecting the menu options Options -> Symbol
Table in the LAD/STL/FBD Editor.
You can also open the symbol table from the SIMATIC Manager: Select the
program in the left-hand pane of the project window and double-click the
“Symbols” object.

Table Structure When you open a symbol table, an additional window is opened. It consists of
columns for the symbol name, the address, the data type and a comment for a
symbol. Each symbol occupies one line of the table. A blank line is automatically
added at the end of the table for defining a new symbol.

Note The symbol table is a common database and can be used by all STEP 7 tools.

SITRAIN Training for ST-7PRO1


Automation and Drives Page 4 Symbols
Edit: Find and Replace

SIMATIC S7 Date: 22.08.2007


SITRAIN Training for
Automation and Drives
Siemens AG 2000. All rights reserved. File: PRO1_05E.5

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 upper-case and lower-
case 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 you are looking for addresses, you should insert a wildcard after the
address identifier, otherwise the address cannot be found.

Example of Find and Replace (replace all outputs with address 8. with address
4.):

Find what: Replace with:


Q*8.* Q 4.

SITRAIN Training for ST-7PRO1


Automation and Drives Page 5 Symbols
View: Filter

SIMATIC S7 Date: 22.08.2007


SITRAIN Training for
Automation and Drives
Siemens AG 2000. All rights reserved. File: PRO1_05E.6

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 specified filter criteria are linked with
one another.

Symbol You can select various filters and link them according to the following properties:
Properties Name, Address, Data type, Comment, Operator control and monitoring,
Communication, Message.

Permissible wildcards are * and ?.

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: E*.*
Only the inputs are displayed.

Valid, Invalid The symbols must be unique, that is, a symbol or an address must only exist
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 options View -> Filter and the attribute
“Invalid".

SITRAIN Training for ST-7PRO1


Automation and Drives Page 6 Symbols
View: Sort

SIMATIC S7 Date: 22.08.2007


SITRAIN Training for
Automation and Drives
Siemens AG 2000. All rights reserved. File: PRO1_05E.7

Sort The entries in the symbol table can be displayed in alphabetical order. You use
the menu options View -> Sort 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 on the column heading for sorting in ascending order in this column.
2. Click on the column heading once more for sorting in descending order in
this column.

SITRAIN Training for ST-7PRO1


Automation and Drives Page 7 Symbols
Symbol Table: Export

Where do you want to store the table?

In which format do you want to store


the table?

SIMATIC S7 Date: 22.08.2007


SITRAIN Training for
Automation and Drives
Siemens AG 2000. All rights reserved. File: PRO1_05E.8

General The menu option Symbol Table -> Export enables you to store symbol tables in
a different file format 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

SITRAIN Training for ST-7PRO1


Automation and Drives Page 8 Symbols
Symbol Table: Import

Select directory path here

Enter file name

Select file format

SIMATIC S7 Date: 22.08.2007


SITRAIN Training for
Automation and Drives
Siemens AG 2000. All rights reserved. File: PRO1_05E.9

General The menu option Symbol Table -> Import enables you to import symbol tables
that were created with other user programs.
What to do:
1. Activate the menu options Symbol Table -> Import.
2. Select the file format in the “Import” dialog window.
You will find the same formats as for Export.
3. Select the directory path in the “Find in:" list box.
4. Enter the file name in the “File Name:" box
5. Confirm with "OK" .

File Types You can import 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

SITRAIN Training for ST-7PRO1


Automation and Drives Page 9 Symbols
Editing Symbols (in the LAD/STL/FBD Editor)

SIMATIC S7 Date: 22.08.2007


SITRAIN Training for
Automation and Drives
Siemens AG 2000. All rights reserved. File: PRO1_05E.10

Edit Symbols The menu option Edit -> Symbol, or a click with the right mouse button on the
address and then the menu option Edit Symbol, enables you to assign symbolic
names to absolute addresses later on. The assigned names are automatically
entered in the symbol table.
Names that are already in the symbol table are displayed in a different color.
They cannot be used again in the symbol table.

SITRAIN Training for ST-7PRO1


Automation and Drives Page 10 Symbols
Symbol Information (in the LAD/STL/FBD Editor)

SIMATIC S7 Date: 22.08.2007


SITRAIN Training for
Automation and Drives
Siemens AG 2000. All rights reserved. File: PRO1_05E.11

Addressing In the LAD/STL/FBD Editor you can choose to display the addresses in one of
the following two ways by selecting the menu options View -> Display ->
Symbolic Representation:
• Symbolic Addressing or
• Absolute Addressing .
You can display the symbolic and absolute address assignments used in the
network by selecting the menu options View -> Display -> Symbol Information.
The assignments are found under the network in LAD/FBD and in STL they are
found in the statement line.

Note If you position the mouse pointer on an address, a "Tooltip" appears with the
symbol information for this address.

SITRAIN Training for ST-7PRO1


Automation and Drives Page 11 Symbols
Symbol Selection (in the LAD/STL/FBD Editor)

SIMATIC S7 Date: 22.08.2007


SITRAIN Training for
Automation and Drives
Siemens AG 2000. All rights reserved. File: PRO1_05E.12

Introduction You can use the menu options View -> Display -> Symbol Selection to simplify
the writing of a symbolic program.

When you label the adddress, a section of the symbol table pops up, as soon as
you enter the first letter of a symbol name. This section contains all symbols
which begin with this letter. By clicking on the desired symbol it is taken into
your program.

SITRAIN Training for ST-7PRO1


Automation and Drives Page 12 Symbols
"Leading Symbols"

Symbol Table
Priority: Priority:
Absolute Value Old Entry:
System ON = Q8.0 Symbols

New Entry:
System ON = Q4.0

SIMATIC S7 Date: 22.08.2007


SITRAIN Training for
Automation and Drives
Siemens AG 2000. All rights reserved. File: PRO1_05E.13

Introduction If you want to change the assignments in the symbol table of an already existing
program, you can also decide whether the absolute address or the symbolic
address has priority.

Selection In the SIMATIC Manager, select, with the right mouse button, the "Blocks" object
of an S7 program. Select the menu option Properties and then the "Blocks" tab.
You can choose between "Absolute Value" or "Symbol" in the “Priority" field.

Priority: With this setting, the absolute address of an operand does not change, if you
Absolute Value change the address assignment in the symbol table later on.
In the example above, the output Q8.0 (symbol name "System On") was
changed to output Q4.0 in the symbol table. With the "Priority: Absolute Value"
setting, the program continues to use the output Q8.0.

Priority: Symbol With this setting, the absolute address of the operand is changed to the new
entry in the symbol table.
In the example above, the output Q8.0 (symbol name "System On") was
changed to output Q4.0 in the symbol table. With the "Priority: Symbols" setting,
the address is changed from Q8.0 to Q4.0 throughout the entire program.
The changed address also keeps its symbol name. That way you can change
the absolute addresses in an existing symbolic user program.

SITRAIN Training for ST-7PRO1


Automation and Drives Page 13 Symbols
Exercise: Creating a Symbol Table for the Conveyor Model

Version A Version B
16 channel 32 channel
Modules Modules

SIMATIC S7 Date: 22.08.2007


SITRAIN Training for
Automation and Drives
Siemens AG 2000. All rights reserved. File: PRO1_05E.14

Task Create a symbol table for the sensors and actuators of the conveyor model.

What To Do 1. In the SIMATIC Manager, select the S7 Program "My_Program"


2. Start the Symbol Editor by double-clicking on the symbol table
3. Edit the symbol table according to your training area (see slide)
4. Save your symbol table

Result All addresses that had a symbolic name assigned to them in the symbol table
can be addressed symbolically or absolutely during program creation with the
LAD/FBD/STL Editor. As well, you can display the comments from the symbol
table as "Symbol Information".

SITRAIN Training for ST-7PRO1


Automation and Drives Page 14 Symbols

You might also like