Presentation is loading. Please wait.

Presentation is loading. Please wait.

Date:16.01.2014 File:PRO1_10E.1 SIMATIC S7 Siemens AG 1999. All rights reserved. Information and Training Center Knowledge for Automation Data Storage.

Similar presentations


Presentation on theme: "Date:16.01.2014 File:PRO1_10E.1 SIMATIC S7 Siemens AG 1999. All rights reserved. Information and Training Center Knowledge for Automation Data Storage."— Presentation transcript:

1 Date: File:PRO1_10E.1 SIMATIC S7 Siemens AG All rights reserved. Information and Training Center Knowledge for Automation Data Storage in Data Blocks

2 Date: File:PRO1_10E.2 SIMATIC S7 Siemens AG All rights reserved. Information and Training Center Knowledge for Automation Bit memories PIQ PII Storage Areas for Data Data blocks DBx DBy DBz... I/O area L stack

3 Date: File:PRO1_10E.3 SIMATIC S7 Siemens AG All rights reserved. Information and Training Center Knowledge for Automation Data Blocks (DBs) Function FC10 Function FC20 Function block FB1 OB1 Global data DB20 Accessible to all blocks Instance data DB5 Instance DB for FB1

4 Date: File:PRO1_10E.4 SIMATIC S7 Siemens AG All rights reserved. Information and Training Center Knowledge for Automation Overview of Data Types in STEP 7 Elementary data types (up to 32 bits) Complex data types (longer than 32 bits) User-defined data types (longer than 32 bits) Bit data types (BOOL, BYTE, WORD, DWORD, CHAR) Mathematical data types (INT, DINT, REAL) Time types (S5TIME, TIME, DATE, TIME_OF_DAY) Time (DATE_AND_TIME) Array (ARRAY) Structure (STRUCT) Character chain (STRING) Data type UDT (User Defined Type)

5 Date: File:PRO1_10E.5 SIMATIC S7 Siemens AG All rights reserved. Information and Training Center Knowledge for Automation Elementary Data Types in STEP 7 BOOL11 or 0 BYTE8B#16#A9 WORD16 W#16#12AF DWORD32 DW#16#ADAC1EF5 CHAR8' w ' S5TIME16 S5T#5s_200ms INT16123 DINT REAL321.2 or 34.5E-12 TIME32 T#2D_1H_3M_45S_12MS DATE16D# TIME_OF_DAY32 TOD#12:23:45.12 KeywordLength (in bits)Example of a constant of this type

6 Date: File:PRO1_10E.6 SIMATIC S7 Siemens AG All rights reserved. Information and Training Center Knowledge for Automation Complex Data Types KeywordLength (in bits) Example DATE_AND_TIME64DT# :14:55.0 STRING8 * (number of ´This is a string´ (character string with characters +2) ´SIEMENS´ max. 254 characters) ARRAYuser-defined Measured values: ARRAY[1..20] (Group of elements INT of the same data type) STRUCT user-defined Motor: STRUCT (Group of elements Speed : INT of different data types)Current: REAL END_STRUCT UDTUDT as block UDT as array element (User Defined Data Type =user-defined Template" consisting of STRUCT Drive: ARRAY[1..4] elementary or complexSpeed : INT UDT1 data types Current: REAL END_STRUCT

7 Date: File:PRO1_10E.7 SIMATIC S7 Siemens AG All rights reserved. Information and Training Center Knowledge for Automation Example of a Structure Display in the Program Editor (Data block DB 1): Operating Speed, data type Integer Rated Current, data type Real Startup Current, data type Real Turning Direction, data type Bool Structure with the name "Motor_data" (several elements with different data types) Motor_data

8 Date: File:PRO1_10E.8 SIMATIC S7 Siemens AG All rights reserved. Information and Training Center Knowledge for Automation Example of an Array 1. Measuring_point, data type Real 2. Measuring_point, data type Real 3. Measuring_point, data type Real 10. Measuring_point, data type Real Array with the name "Measuring_point" (several elements of the same data type) Display in the Program Editor (Data block DB 2): Measuring_point

9 Date: File:PRO1_10E.9 SIMATIC S7 Siemens AG All rights reserved. Information and Training Center Knowledge for Automation Creating a New Data Block

10 Date: File:PRO1_10E.10 SIMATIC S7 Siemens AG All rights reserved. Information and Training Center Knowledge for Automation Entering, Saving, Downloading and Monitoring a Data Block

11 Date: File:PRO1_10E.11 SIMATIC S7 Siemens AG All rights reserved. Information and Training Center Knowledge for Automation Addressing Data Elements 07 8 Bits Data Byte 0 DBB 0 Data Byte 1 DBW 0 Data Byte 8191 DBD 8188 DBW 8190 DBB 8191 Data Byte 2 DBD 0 Data Byte 3 DBX 4.1

12 Date: File:PRO1_10E.12 SIMATIC S7 Siemens AG All rights reserved. Information and Training Center Knowledge for Automation Accessing Data Elements DB 19 (Symbol name: Values) Data bit 0.0 with the element name "Start" or A DB19.DBX0.0 or A Values".Start or L DB19.DBW2 or L Values".Number or L DB19.DBB5 or L Values".Loop Traditional Access symbolic Fully-qualified Access 1) OPN DB19 L DBW2 Number OPN DB19 A DBX 0.0 1) OPN DB19 L DBB5 Loop absolute

13 Date: File:PRO1_10E.13 SIMATIC S7 Siemens AG All rights reserved. Information and Training Center Knowledge for Automation Validity of an Open DB OB 1 OPNDB 4 LDBW2 DB 4 TDBW 2 DB 4 FC 1 DB 4 CALLFC 1 TDBW 4 DB 5 OPNDB 5 LDBB6 DB 5 LDBW 0 TDBW 8 CALL FC 2 FC 2 DB 5DB 6 OPNDB 6 LDBB6 DB 2 T DB2.DBB 0 DB 2 LDBW 4 LDBW 10 DB ?? FB 1 CALLFB1, DB1 ??? !

14 Date: File:PRO1_10E.14 SIMATIC S7 Siemens AG All rights reserved. Information and Training Center Knowledge for Automation Global DB (Example)UDT block as Template User-Defined Data Type (UDT) Flour Milk Eggs Yeast Sugar Recipe 2 Flour Milk Eggs Yeast Sugar Recipe 3 Flour Milk Eggs Yeast Sugar Flour Milk Eggs Yeast Sugar DB created according to UDT Recipe 1 Flour Milk Eggs Yeast Sugar Array with 3 elements of type UDT

15 Date: File:PRO1_10E.15 SIMATIC S7 Siemens AG All rights reserved. Information and Training Center Knowledge for Automation Entering a UDT Block

16 Date: File:PRO1_10E.16 SIMATIC S7 Siemens AG All rights reserved. Information and Training Center Knowledge for Automation Creating a Data Block Referencing a Data Type

17 Date: File:PRO1_10E.17 SIMATIC S7 Siemens AG All rights reserved. Information and Training Center Knowledge for Automation Example: Array of UDTs Declaration ViewData View

18 Date: File:PRO1_10E.18 SIMATIC S7 Siemens AG All rights reserved. Information and Training Center Knowledge for Automation Exercise: Program for a Bottling Plant - Data Storage Full bottles (MW102) Empty bottles (MW 100) "Broken" bottles (MW 104) Data block DB5 Variable: full Variable: empty Variable: broken


Download ppt "Date:16.01.2014 File:PRO1_10E.1 SIMATIC S7 Siemens AG 1999. All rights reserved. Information and Training Center Knowledge for Automation Data Storage."

Similar presentations


Ads by Google