
4-5
Ladder Logic (LAD) for S7-300 and S7-400
C79000-G7076-C504-02
4.3 Editing the Declaration Table
When you create single shared data blocks or UDTs, you must declare their
elements (variables) and their data types. For this you use the declaration
table in the declaration view. When working with data blocks, you change to
this view with the menu command View
"
Declaration View.
This does not apply to data blocks assigned to a UDT or FB since the
declaration is already defined by the UDT or FB.
The declaration view of a data block shows the addresses, the declaration
types (only for instance DBs), the variable names (symbols), initial values
and comments. Figure 4-3 shows an example:
DB15 - <Offline>
Address Symbol Data Type Initial Value Comment
speed
runtime
motor_on
STRUCT
INT
DINT
BOOL
100
L#0
0.0
+0.0
+2.0
+6.0
+10.0
history REAL
motor_off BOOL+10.1
END_STRUCT
FALSE
=12.0
0.000000e+000
FALSE
Maximum RPM
Figure 4-3 Declaring a Data Block
The columns have the same significance as those in the declaration table for
logic blocks (see Section 3.3).
To enter a new declaration, type in the required declaration type, variable
name, data type, initial value (optional) and comment (optional). You can
move the cursor from one cell to the next using the
TAB or RETURN keys. At
the end of each row, an address is allocated to the variable.
The syntax is checked after each cell has been edited and errors are shown in
red. You can continue to make your entries and correct any errors later.
Note
Editing in the declaration view is the same as editing the variable declaration
table of logic blocks (see Section 3.4). The editing and input procedures are
identical and you should also proceed in the same way when entering arrays
or structures.
Purpose of the
Declaration View
Structure of the
Table in the
Declaration View
Procedure
Creating Data Blocks and User-Defined Data Types
Kommentare zu diesen Handbüchern