Inhaltszusammenfassung zur Seite Nr. 1
Automation– and Drive Technology- SCE
Training document for the company-wide
automation solution
Totally Integrated Automation (T I A)
MODULE B4
Data blocks
T I A Training document Page 1 of 18 Module B4
Last revision: 02/2002
Inhaltszusammenfassung zur Seite Nr. 2
Automation– and Drive Technology- SCE This document was provided by Siemens A&D SCE (automation and drive technology, Siemens A&D Cooperates with Education) for training purposes. Siemens does not make any type of guarantee regarding its contents. The passing on or duplication of this document, including the use and report of its contents, is only permitted within public and training facilities
Inhaltszusammenfassung zur Seite Nr. 3
Automation– and Drive Technology- SCE PAGE: 1. Forward................................................................................................................. 4 2. Notes for Data Blocks.......................................................................................... 6 3. Generating Data Blocks...................................................................................... 7 The following symbols stand for the specified modules: I
Inhaltszusammenfassung zur Seite Nr. 4
Automation– and Drive Technology- SCE 1. FORWARD The module B4 is assigned content wise to Additional functions of STEP 7- Programming. Basics of STEP 7- Programming 2 - 3 days A modules Additional functions of STEP 7- Programming 2- 3 days B Modules Industrial field bus Sequencer Process systems programming visualization 2- 3 days D modules 2- 3 days C modules 2- 3 days F modules IT- Communication with SIMATIC S7 1- 2 d
Inhaltszusammenfassung zur Seite Nr. 5
Automation– and Drive Technology- SCE Required hardware and software 1 PC, Operating system Windows 95/98/2000/ME/NT4.0 with - Minimal: 133MHz and 64MB RAM, approx. 65 MB free hard disk space - Optimal: 500MHz and 128MB RAM, approx. 65 MB free hard disk space 2 Software STEP 7 V 5.x 3 MPI- Interface for the PC (e.g. PC- Adapter) 4 PLC SIMATIC S7-300 with at least one digital in- and output module. The inputs must be lead through a functional unit. Example configura
Inhaltszusammenfassung zur Seite Nr. 6
Automation– and Drive Technology- SCE 2. NOTES FOR DATA BLOCKS Data Blocks (DBs) can be used by your program to save data in the CPU. Your hard disk contains up to 8 KBytes ( 8192 Bytes ) space. There are two types of data blocks. Global DBs, where all OBs, FBs and FCs read all saved data or can even write in the DB and local instance DBs, which are assigned a particular FB. In the DBs, different data types (e.g. BOOL or WORD ) can be saved in arbitrary order. This stru
Inhaltszusammenfassung zur Seite Nr. 7
Automation– and Drive Technology- SCE 3. GENERATING DATA BLOCKS Data blocks are generated and opened like program blocks in the tool LAD,STL,FBD: Program blocks. They serve e.g. for the saving of data and system states. In the following text, the generation of a simple example is described by the use of a global data block: Thereby values should be chosen with the switches 'S0' to 'S7' and displayed on an output module ‘Display‘. Thereby one has more switches by ac
Inhaltszusammenfassung zur Seite Nr. 8
Automation– and Drive Technology- SCE In order to generate this program example, the following steps must be followed (Thereby the program is dispensed with the creation of the hardware configuration): 1. Call SIMATIC Manager with a double click ( SIMATIC Manager) 2. Create a new project ( File New) Forward Notes Generating data blocks T I A Training document Page
Inhaltszusammenfassung zur Seite Nr. 9
Automation– and Drive Technology- SCE 3. In the name path, create the project with the name Testproject_DB. ( ’Testproject_DB’ OK) 4. Insert a new S7-Program ( Insert Program S7-Program). Forward Notes Generating data blocks T I A Training document Page 9 of 18 Module B4 La
Inhaltszusammenfassung zur Seite Nr. 10
Automation– and Drive Technology- SCE 5. Highlight the folder Blocks. ( Blocks) 6. Insert Data Block ( Insert S7 Block Data Block). Forward Notes Generating data blocks T I A Training document Page 10 of 18 Module B4 Last revision: 02/2002
Inhaltszusammenfassung zur Seite Nr. 11
Automation– and Drive Technology- SCE 7. Enter the number DB10 for the data block and accept with OK ( DB10 OK). 8. Open the data block DB10 with a double click( DB10). Forward Notes Generating data blocks T I A Training document Page 11 of 18 Module B4 Last revision: 02/2002
Inhaltszusammenfassung zur Seite Nr. 12
Automation– and Drive Technology- SCE 9. Acknowledge the type of data block. ( Data Block OK ) Note: Data blocks with an assigned FB are automatically displayed by the call of your associated FB. It makes no sense to create this alone. Data blocks with assigned user defined data types (UDT) are data blocks, whose structure was already assigned in this UDT. Forward Notes
Inhaltszusammenfassung zur Seite Nr. 13
Automation– and Drive Technology- SCE 10. The Data Block is generated with a symbol Name. The Type, an Initial value as well as a Comment (optional) are entered. The address is automatically generated and cannot be altered. The data block can be saved and downloaded into the PLC . The mode switch on the PLC must be on STOP! ( Name Type Initial value Comment ) Symbolic name which is referenced Desired data Initial value , to which Comment fo
Inhaltszusammenfassung zur Seite Nr. 14
Automation– and Drive Technology- SCE Data in a data block must be determined through data types. The following standard- data types are defined in the S7 below : Type and Size Format-Options Range and number notation Example description in Bits (lowest to highest values) BOOL (Bit) 1 Boolean text TRUE/FALSE TRUE BYTE (Byte) 8 Hexadecimal B#16#0 to B#16#FF B#16#10 number WORD (Word) 16 Binary number 2#0 to 2#1111_1111_1111_1111 2#0001_0000_0000_0000 Hexadecimal
Inhaltszusammenfassung zur Seite Nr. 15
Automation– and Drive Technology- SCE 11. Values should be modified in a data block. It is not adequate to modify them in the field Initial value . This is only possible, when one switches to the Data View under View ( View Data View). 12. Now a new value can be entered in the field Actual value and saved onto the hard drive with as well as downloaded into the CPU with ( Actual value ). F
Inhaltszusammenfassung zur Seite Nr. 16
Automation– and Drive Technology- SCE 13. In order to generate the program with the accessible data elements, the OB1 must be opened through a double click in SIMATIC Manager ( SIMATIC Manager OB1). 14. Then accept the setting with OK ( OK ). Forward Notes Generating data blocks T I A Training document Page 16 of 18
Inhaltszusammenfassung zur Seite Nr. 17
Automation– and Drive Technology- SCE There are three possibilities to access the data: 1. Direct address access: One can access one data element in a data block with the following instructions: Example: L DB 20. DBB2 Load data byte 2 from DB20 into ACCU 1 L DB 22. DBW4 Load data word 4 from DB22 into ACCU 1 A DB 2. DBX5.6 Carry out an AND- logical operation with data bit 5.6 from DB2. 2. Access to the data elements in the already opened data blocks: In order
Inhaltszusammenfassung zur Seite Nr. 18
Automation– and Drive Technology- SCE 15. With LAD, STL, FBD: Program blocks, you now have an editor that give you the possibility to generate your STEP 7-Program. The schema for the selection of the data element through the button is shown for the first three inputs as specified below. If the organization block OB1 is not generated for all switches S0 to S7, it should be saved and downloaded into the PLC . The mode switch of the CPU must be on STOP! ( ) 16