Professional Documents
Culture Documents
SIMATIC S7
Siemens AG 2006. All rights reserved.
Date: File:
2/8/2012 PRO1_10E.1
Objectives
Upon completion of this chapter the participant will ...
... ... ... ... understand the purpose of global data blocks be familiar with elementary and complex data types be able to monitor a data block be familiar with the possibilities for addressing data block variables
SIMATIC S7
Siemens AG 2006. All rights reserved.
Date: File:
2/8/2012 PRO1_10E.2
Function FC20
DB5
SIMATIC S7
Siemens AG 2006. All rights reserved.
Date: File:
2/8/2012 PRO1_10E.3
Time type (DATE_AND_TIME) Complex data types (longer than 32 bits) Array (ARRAY) Structure (STRUCT)
SIMATIC S7
Siemens AG 2006. All rights reserved.
Date: File:
2/8/2012 PRO1_10E.4
Constants
MB70
WORD
DWORD CHAR
16
MW72 32 QD40 8
W#16#12AF
DW#16#ADAC1EF5 'w' DBB4 S5T#5s_200ms
S5TIME
16
MW30
INT DINT 16 32 MD80 123 #Value L#65539
REAL SIMATIC S7
Siemens AG 2006. All rights reserved.
32
Date: File: 2/8/2012 PRO1_10E.5
1.2 or 34.5E-12
DBD60
SITRAIN Training for
Automation and Industrial Solutions
Example
DT#01-08-24-12:14:55:234-1
STRING (character string with max. 254 characters) ARRAY (Group of elements of the same data type) STRUCT (Group of elements of different data types) UDT
8 * (number of This is a string characters +2) SIEMENS userdefined Measured values: ARRAY[1..20] INT
userdefined
Motor: STRUCT Speed : INT Current : REAL END_STRUCT UDT as block UDT as array element Drive: ARRAY[1..4]
userdefined
STRUCT
Speed : INT
Date: File:
2/8/2012 PRO1_10E.6
SIMATIC S7
Siemens AG 2006. All rights reserved.
Date: File:
2/8/2012 PRO1_10E.7
Declaration View
Data View
SIMATIC S7
Siemens AG 2006. All rights reserved.
Date: File:
2/8/2012 PRO1_10E.8
Load Memory
DB Initial values + Actual values
Work Memory
DB Actual values
CPU
with STEP 7 Program
DB
Initial values
DB is retentive until the next transmission PG CPU With every CPU startup (i.e. with every STOP-RUN transition) the DB data are reset to the initial loading state
x
SITRAIN Training for
Automation and Industrial Solutions
SIMATIC S7
Siemens AG 2006. All rights reserved.
Date: File:
2/8/2012 PRO1_10E.9
SIMATIC S7
Siemens AG 2006. All rights reserved.
Date: File:
2/8/2012 PRO1_10E.10
Traditional Access
symbolic
L "Parts".ACT_ Quantity
4.0
Number
INT
OPN DB 18 A DBX2.0
or
DB18.DBX2.0
or
A "Parts".FL_Aux
6.0
Weight[1]
REAL
OPN "Parts" T DBW 4
or
DB18.DBW4
or
T "Parts".Number
10.0
Weight[2]
REAL
OPN L
DB 18 DBD 10
or
DB18.DBD10
or
L "Parts".Weight[2]
SIMATIC S7
Siemens AG 2006. All rights reserved.
Date: File:
2/8/2012 PRO1_10E.11
SIMATIC S7
Siemens AG 2006. All rights reserved.
Date: File:
2/8/2012 PRO1_10E.12
Variables in STEP7
SIMATIC S7
Siemens AG 2006. All rights reserved.
Date: File:
2/8/2012 PRO1_10E.13
SIMATIC S7
Siemens AG 2006. All rights reserved.
Date: File:
2/8/2012 PRO1_10E.14
Example of an ARRAY
Measuring_point 1. Measuring_point, data type Real
SIMATIC S7
Siemens AG 2006. All rights reserved.
Date: File:
2/8/2012 PRO1_10E.15
Example of a STRUCTURE
Motor_data Speed, data type Integer Rated_current, data type Real Structure with the name "Motor_data" (several elements with different data types)
SIMATIC S7
Siemens AG 2006. All rights reserved.
Date: File:
2/8/2012 PRO1_10E.16
SIMATIC S7
Siemens AG 2006. All rights reserved.
Date: File:
2/8/2012 PRO1_10E.17