Transcription

Automation and Drives - SCETraining Document for Comprehensive AutomationSolutionsTotally Integrated Automation (T I A)MODULE D17PROFIBUS DPwithMaster CP 342-5DP/Slave ET 200ST I A Training DocumentD17Issued: 02/2008Page 1 of 28ModulePROFIBUS DP with Master CP 342-5DP/Slave ET 200S

Automation and Drives - SCEThis document has been written by Siemens AG for training purposes for the project entitled "SiemensAutomation Cooperates with Education (SCE)".Siemens AG accepts no responsibility for the correctness of the contents.Transmission, use or reproduction of this document is only permitted within public training and educationalfacilities. Exceptions require the prior written approval by Siemens AG (Michael [email protected]).Offenders will be liable for damages. All rights, including the right to translate the document, are reserved,particularly if a patent is granted or utility model is registered.We would like to thank the following: Michael Dziallas Engineering, the teachers at vocational schools, and allothers who helped to prepare this document.T I A Training DocumentD17Issued: 02/2008Page 2 of 28ModulePROFIBUS DP with Master CP 342-5DP/Slave ET 200S

Automation and Drives - SCEPAGE1.Preface .42.Notes on Using the CP 342-5DP.63.Notes on Using the ET 200S with IM 151-1 HF .74.Starting Up the Profibus (Master CP 342-5DP/Slave ET200S) .8The symbols below are provided as a guide through Module D17:InformationProgrammingSample ExerciseNotesT I A Training DocumentD17Issued: 02/2008Page 3 of 28ModulePROFIBUS DP with Master CP 342-5DP/Slave ET 200S

Automation and Drives - SCE1.PREFACEIn terms of its contents, Module D17 is part of the teaching unit entitled 'Industrial FieldbusSystems’.Fundamentals of STEP7Programming2 to 3 daysModules AAdditional Functions ofSTEP7 ProgrammingPlant Simulation withSIMIT SCE2 to 3 days Modules BProgrammingProgramminganguagesLLanguages3 daysModules2 to2 3todaysModuleC CIndustrial FieldbusSystems2 to 3 days Modules DFrequency Converterat SIMATIC S71 to 2 days Module GProcessVisualization2 to 3 days Modules FIT Communicationwith SIMATIC S72 to 3 days Module H2 to 3 days Modules ELearning Objective:In Module D17, the reader learns how the PROFIBUS DP with a SIMATIC S7-300 -with thecommunication processor CP 342-5DP as master and the ET 200S as slave- is started up. ModuleD17 illustrates the method in principle, using a short example.Prerequisites:To successfully work through Module D17, the following knowledge is assumed: Knowledge in handling WindowsFundamentals of PLC programming with STEP 7 (for example, Module A3 - 'Startup’PLC Programming with STEP 7) Fundamentals of PROFIBUS DP (for example, Appendix IV - Basics of Fieldbus Systems withSIMATIC S7-300)PrefaceT I A Training DocumentD17Issued: 02/2008NotesPage 4 of 28StartUpModulePROFIBUS DP with Master CP 342-5DP/Slave ET 200S

Automation and Drives - SCEHardware and software required123456PC, operating system Windows 2000 Professional starting with SP4/XP Professional startingwith SP1/Server 2003 with 600MHz and 512RAM, free hard disk storage 650 to 900 MB, MSInternet Explorer 6.0Software STEP7 V 5.4MPI interface for the PC (for example, adapter USB)PLC SIMATIC S7-300 with the CP 342-5DPSample configuration:- Power supply: PS 307 2A- CPU: CPU 314- Digital inputs: DI 16xDC 24V- Digital outputs: DO 16xDC 24V/0.5A- PROFIBUS communication processor CP 342-5DPDistributed periphery ET 200S for PROFIBUS with 2 digital inputs and 4 digital outputsSample Configuration:- Interface Module IM151-1HF- Power module PM-E DC 24V 48V/AC 24V 230V- Electronic module: 2DI Standard DC 24V- Electronic module: 4DO Standard DC 24V/0.5APROFIBUS cable with 2 PROFIBUS connectors2 STEP 71 PC3 PC Adapter USB4 SIMATIC S7-300 withCP 342-5DPPrefaceT I A Training DocumentD17Issued: 02/20086 PROFIBUS CableNotesPage 5 of 285 ET200S withIM 151-1 HFStartUpModulePROFIBUS DP with Master CP 342-5DP/Slave ET 200S

Automation and Drives - SCE2.NOTES ON THE USE OF CP 342-5DPThe PROFIBUS communication processor CP 342-5DP allows for connecting the SIMATIC S7-300to the PROFIBUS with the protocol profile Decentral Periphery (DP).The PROFIBUS parameters for the PLC are assigned and the PROFIBUS network is configuredusing the STEP7 software. However, for the CP342-5DP, the software "NCM S7 PROFIBUS“(already included in STEP7 V5.x!) is required. This provides the user with a uniform configuring toolfor central as well as distributed configurations.For the SIMATIC S7-300 with the CP342-5 as combi-master, the following protocol profiles areavailable: The DP interface as master or slave according to EN 50170. PROFIBUS-DP (distributedperiphery) is the protocol profile for connecting distributed periphery/field devices with veryfast response timing. SEND/RECEIVE interface (PLC/PLC) according to the SDA service (Layer 2 ofPROFIBUS). SEND/RECEIVE (FDL interface) provides functions with which communicationbetween SIMATIC S5 and S7 (with each other) and with the PC can be implemented simplyand quickly. S7 functions. These provide optimized communication in the SIMATIC S7/M7/PC network.With programmed FC block calls, the user program activates the transfer of the data areas for DPand FDL communication, and monitors its successful execution.The FC blocks needed for communication are stored in the “SIMATIC NET CP“ library. To use thisfunctions, the FC blocks have to be incorporated in (copied to) your "own“ project.Note:Here, the CP 342-5DP is used on the PROFIBUS as master.PrefaceT I A Training DocumentD17Issued: 02/2008NotesPage 6 of 28StartUpModulePROFIBUS DP with Master CP 342-5DP/Slave ET 200S

Automation and Drives - SCE3.NOTES ON USING THE ET 200S WITH IM 151-1 HFThe SIMATIC ET 200S is a decentral IO device configured in a highly modular mode. It can beoperated with different interface modules:IM 151-1 BASIC, IM 151-1 STANDARD and IM 151-1 FO STANDARD for connecting a maximumof 63 IO modules (all types except PROFIsafe) to the PROFIBUS DP; alternatively, bus connectionwith RS 485 Sub-D connector or by means of integrated fiber-optic connectionIM 151-1 HIGH FEATURE for connecting a maximum of 63 IO modules (all types, includingclocked mode for PROFIsafe) to PROFIBUS-DP; bus connection with RS485 Sub-D connectorIM 151-3 PN for connecting a maximum of 63 IO modules (all types, including the clocked mode forPROFIsafe) to PROFINET IO controllers; bus connection by means of RJ45 connectorIM 151-7/F-CPU, IM 151-7/CPU or IM 151-7/CPU FO for connecting a maximum of 63 IO modules(all types; PROFIsafe only with IM151-7/F CPU) to PROFIBUS DP; alternatively bus connection withRS 485 Sub-D connector or by means of an integrated fiber-optic connection; with integrated CPU314 of the SIMATIC S7-300, for preprocessing process data.The following IO modules can be used:Power modules for individual grouping of load and encoder supply voltages and their monitoringDigital electronic modules for connecting digital sensors and actuatorsAnalog electronic modules for connecting analog sensors and actuatorsSensor module for connecting IQ sense sensorsTechnology modules Electronic modules with integrated technological functions, such as counting,positioning, data exchange, etc.Frequency converters and motor starter modulesFor training purposes, an integrated system is available, suitable for teaching many technologies.Notes:In Module D16, the interface module IM151-1 HF (HIGH FEATURE) is used asPROFIBUS DP slave.The PROFIBUS address is set, binary-coded, on 8 switches at interface module IM151-HF. Thelowest switch has to be on OFF. A number is assigned to each of the other switches. Thesenumbers add up to the PROFIBUS station address. If the PROFIBUS address ischanged, the new setting will be accepted only after voltage returns. Therefore, theinterface module IM151-1 HF has to be switched off, and then switched on again.PrefaceT I A Training DocumentD17Issued: 02/2008NotesPage 7 of 28StartUpModulePROFIBUS DP with Master CP 342-5DP/Slave ET 200S

Automation and Drives - SCE4.STARTING UP PROFIBUS (MASTER CP 342-5DP/SLAVE ET200S)Below, the startup of a single master system with the SIMATIC S7-300 - with the CP342-5DP asmaster and the ET200S as slave- is described.To test the configuration, a program is written. In this program, an indicator lamp P1 is activatedwhen two buttons, S0 and S1, are operated simultaneously.Assignment List:I0.0S0I0.1S1O0.0P11.Button Selection 1Button Selection 2Indicator lampThe central tool in STEP 7 is the ’SIMATIC Manager’. Here, it is called with a double click. ( SIMATIC Manager)2.STEP7 programs are managed in projects. We are now setting up such a project. ( File New)PrefaceT I A Training DocumentD17Issued: 02/2008NotesPage 8 of 28StartUpModulePROFIBUS DP with Master CP 342-5DP/Slave ET 200S

Automation and Drives - SCE3.The project is now assigned the ’Name’ ’ET200S CP’. ( ET200S CP OK)4. Highlight your project and insert a ’PROFIBUS Subnet’. ( ET200S CP Insert Subnet PROFIBUS).PrefaceT I A Training DocumentD17Issued: 02/2008NotesPage 9 of 28StartUpModulePROFIBUS DP with Master CP 342-5DP/Slave ET 200S

Automation and Drives - SCE5.Then, a ’SIMATIC 300 Station’ is inserted. ( Insert Station SIMATIC 300 Station)6.With a double click, open the configuration tool for ’Hardware’. ( Hardware)PrefaceT I A Training DocumentD17Issued: 02/2008NotesPage 10 of 28StartUpModulePROFIBUS DP with Master CP 342-5DP/Slave ET 200S

Automation and Drives - SCE7. Open the hardware catalog by clicking on the symbol '’. ( )There, arranged in the following directories:PROFIBUS DP, PROFIBUS PA, PROFINET IO, SIMATIC 300, SIMATIC 400,SIMATIC HMI Station, SIMATIC PC Based Control 300/400, and SIMATIC PC Station,all racks, modules and interface modules are provided for configuring your hardware.Insert ’Rail’ with a double click. ( SIMATIC 300 RACK-300 Rail)After that, a configuration table for configuring Rack 0 is displayed automatically.PrefaceT I A Training DocumentD17Issued: 02/2008NotesPage 11 of 28StartUpModulePROFIBUS DP with Master CP 342-5DP/Slave ET 200S

Automation and Drives - SCE8.From the hardware catalog, you can now select all modules that are also in your real rack, andinsert them in the configuration table.To this end, click on the name of the respective module, hold the mouse key and drag themodule to a line in the configuration table.We are starting with the power unit ’PS 307 2A’. ( SIMATIC 300 PS-300 PS 307 2A)Note: If your hardware differs from the one displayed here, simply select the corresponding modulesfrom the catalog and insert them in your rack. The order numbers of the individual modules -that arealso indicated on the components- are displayed in the footer of the catalog.PrefaceT I A Training DocumentD17Issued: 02/2008NotesPage 12 of 28StartUpModulePROFIBUS DP with Master CP 342-5DP/Slave ET 200S

Automation and Drives - SCE9.Next, we drag the CPU 314 to the second slot. The order number and the version of the CPUcan be read off the front of the CPU. ( SIMATIC 300 CPU-300 CPU 314 6ES7 3141AE04-0AB0 V1.2)PrefaceT I A Training DocumentD17Issued: 02/2008NotesPage 13 of 28StartUpModulePROFIBUS DP with Master CP 342-5DP/Slave ET 200S

Automation and Drives - SCE10. Now, we drag the input submodule for 16 inputs to the 4th slot. The order number of thesubmodule can be read off the front. ( SIMATIC 300 SM300 DI-300 SM 321DI16xDC24V).Note: Slot No. 3 is reserved for interface modules and remains empty for that reason. The module’sorder number is displayed in the footer of the catalog.PrefaceT I A Training DocumentD17Issued: 02/2008NotesPage 14 of 28StartUpModulePROFIBUS DP with Master CP 342-5DP/Slave ET 200S

Automation and Drives - SCE11. Next, we drag the output submodule for 16 outputs to the 5th slot. The order number of thesubmodule can be read off the front. ( SIMATIC 300 SM300 DO-300 SM 322DO16xDC 24V/0.5A).Note: The order number of the module is displayed in the footer of the catalog.PrefaceT I A Training DocumentD17Issued: 02/2008NotesPage 15 of 28StartUpModulePROFIBUS DP with Master CP 342-5DP/Slave ET 200S

Automation and Drives - SCE12. Now, we drag the communication processor for PROFIBUS ’CP 342-5DP’ to the 6th slot . Theorder number and the version of the submodule can be read off the front. ( SIMATIC 300 CP-300 PROFIBUS CP 342-5 6GK7 342-5DA02-0XE0 V4.0).13. When entering the communication processor, the following window appears. In this window,assign a PROFIBUS address to the CP 342-5DP and select the PROFIBUS network that hasalready been created. If you want to modify the parameters of the PROFIBUS network,highlight it and then click on ’Properties’. ( Properties)PrefaceT I A Training DocumentD17Issued: 02/2008NotesPage 16 of 28StartUpModulePROFIBUS DP with Master CP 342-5DP/Slave ET 200S

Automation and Drives - SCE14. Now you can select the ’Highest PROFIBUS Address’ (here 126), the ’Transmission Rate’(here 1.5 Mbit/s) and the ’Profile’ (here DP). ( OK OK)15. Next, first the addresses of the communication processor are noted down in the peripheryaddress space of the CPU (here: PI 288.303/PO 288.303). Then, the properties of the CP areselected by double clicking on the 'CP 342-5DP’. The ’Operating Mode’ is then set to ’DPMaster’ and accepted with ’OK’.( CP 342-5 Operating Mode DP Master OK)PrefaceT I A Training DocumentD17Issued: 02/2008NotesPage 17 of 28StartUpModulePROFIBUS DP with Master CP 342-5DP/Slave ET 200S

Automation and Drives - SCE16. Then, to the right of the CP342-5DP, a bar appears -the so called ’Master system’- where youcan arrange PROFIBUS slaves. This is done by clicking on the desired module(here the ’ET 200S’ with ’IM151-1 HF’) in the hardware catalog in the path’PROFIBUS-DP’, and dragging it to the master system. ( PROFIBUS DP ET 200S IM151-1 HF 6ES7 151-1BA00-0AB0)17. When entering the slave, the following window appears. In this window, assign aPROFIBUS address to the slave. The address has to be identical with the address that you set atthe switches of the IM151-1 HF ( 3 OK)PrefaceT I A Training DocumentD17Issued: 02/2008NotesPage 18 of 28StartUpModulePROFIBUS DP with Master CP 342-5DP/Slave ET 200S

Automation and Drives - SCE18. From the hardware catalog, you can now select all additional modules that are inserted in yourreal ET200S and add them to your configuration table. To this end, click on the name of therespective module, hold the mouse key, and drag the module to a line in the configuration table.We are starting with the power module ’PM-E DC24V.48V/AC24.230V’ that is dragged to Slot1. ( PROFIBUS-DP ET 200S IM151-1 HF PM PM-E DC24V.48V/AC24.230V)19. Next, we are dragging the digital input submodule ’2DI DC24V ST’ to the 2nd slot. The ordernumber and the version can be read off the module. ( PROFIBUS-DP ET 200S IM151-1HF DI 2DI DC 24V ST)PrefaceT I A Training DocumentD17Issued: 02/2008NotesPage 19 of 28StartUpModulePROFIBUS DP with Master CP 342-5DP/Slave ET 200S

Automation and Drives - SCE20. Now we are dragging the digital output module ’4 DO DC24V/0,5A ST’ to the 3rd slot. The ordernumber and the version can be read off the module. ( PROFIBUS-DP ET 200S IM151-1HF DO 4 DO DC 24V/0.5A ST)PrefaceT I A Training DocumentD17Issued: 02/2008NotesPage 20 of 28StartUpModulePROFIBUS DP with Master CP 342-5DP/Slave ET 200S

Automation and Drives - SCE21. The addresses of the inputs and the outputs on the ET 200S can now be noted down(here: I 0.0.0.1/O 0.0.0.3). Addresses are assigned automatically in the sequence in whichthe slaves were entered.Note:The addresses specified here are the input and output addresses within thecommunication processor. These addresses can not be accessed directly in the program of theCPU. First, by means of FC blocks, the input/output areas have to be transferred to address areasof the CPU.By clicking on '’ and '’ respectively, the configuration table is first saved and compiled, and then loaded to the PLC. The key switch on the CPU should be in the STOP position! ( 22. The CPU 314 is then confirmed as the destination module of the load process. ( OK)PrefaceT I A Training DocumentD17Issued: 02/2008NotesPage 21 of 28StartUpModulePROFIBUS DP with Master CP 342-5DP/Slave ET 200S

Automation and Drives - SCE23. In the dialog window below, you can ’Display’ the devices that are connected in the network.The station address of the CPU in the MPI network is then selected. If you are connected toonly one CPU, accept with ’OK’. ( Display OK)24. After the hardware configuration is loaded, we can start generating the program. From the’SIMATIC Manager’, open ’OB1’ with a double click. ( OB1)PrefaceT I A Training DocumentD17Issued: 02/2008NotesPage 22 of 28StartUpModulePROFIBUS DP with Master CP 342-5DP/Slave ET 200S

Automation and Drives - SCE25. Optional: enter the OB1 properties for documentation, and accept with 'OK’.( OK)PrefaceT I A Training DocumentD17Issued: 02/2008NotesPage 23 of 28StartUpModulePROFIBUS DP with Master CP 342-5DP/Slave ET 200S

Automation and Drives - SCEWith programmed FC block calls, the user program activates the transfer of the data areas for theinputs and outputs of the PROFIBUS DP slaves. These FCs also monitor the successful execution.The FC blocks needed for communication are stored in the “SIMATIC NET CP“ library. To usethese functions, they have to be incorporated into (copied to) your “own“ project.The FC block DP-SEND transfers data from the user program in the CPU to the PROFIBUS CP.Depending on the operating mode of the PROFIBUS CP, DP-SEND has the following meaning: When used in the DP MasterThe block transfers the data of a specified DP output area to the PROFIBUS CP for output to thedistributed IO. When used in the DP slaveThe block transfers the data of a specified DP data area of the CPU to the send buffer of thePROFIBUS CP for transmission to the DP master.When calling the FC block DP SEND, the following parameters have to be entered in BOOLSTATUSWORDPrefaceT I A Training DocumentD17Issued: 02/2008Value Range0: 1: New data0: 1: ErrorCommentModule start address (in STEP7, is provided in theconfiguration table)Specifies address and length of the DP send area (theaddress can refer to IO areas, flag areas, and datablock areas)Status parameter indicates whether the request wasprocessed without fault.Error indicationStatus indicationNotesPage 24 of 28StartUpModulePROFIBUS DP with Master CP 342-5DP/Slave ET 200S

Automation and Drives - SCEThe FC block DP-RECV receives data via PROFIBUS-DP. Depending on the operating mode of thePROFIBUS-CP, the DP-RECV has the following meaning: When used in the DP MasterThe block accepts process data of the distributed IO as well as status information into a specifiedDP input area. When used in the DP SlaveThe block accepts the DP data -transmitted by the DP master- from the receive buffer of thePROFIBUS CP into a specified DP data area of the CPU.When calling the FC block DP-RECV, the following parameters have to be entered in OOLSTATUSDPSTATUSWORDBYTEPrefaceT I A Training DocumentD17Issued: 02/2008Value Range0: 1: Newaccepted0: 1: ErrorCommentModule start address (in STEP7, is provided in theconfiguration table)Specifies the address and the length of the DPreceive area (the address can refer to IO areas, flagareas, and data block areas)The status parameter indicates whether new data wasdata accepted.Error indicationStatus indicationDP status indicationNotesPage 25 o