Ethernet Communication: Data Exchange S7-1200 S7-1200 S7-1200 Configuration Example X17  pdf

37 3.1K 4
Ethernet Communication: Data Exchange S7-1200 S7-1200 S7-1200 Configuration Example X17  pdf

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Applications & Tools Answers for industry. Ethernet Communication: Data Exchange S7-1200 <-> S7-1200 S7-1200 Configuration Example X17  February 2010 Warranty, liability and support Ethernet Communication: Data Exchange S7-1200 <-> S7-1200 V1.1, ID Number: 39040038 2 Warranty, liability and support Note The application examples are not binding and do not claim to be complete regarding the circuits shown, equipping and any eventuality. The application examples do not represent customer-specific solutions. They are only intended to provide support for typical applications. You are responsible for ensuring that the described products are correctly used. These application examples do not relieve you of the responsibility of safely and professionally using, installing, operating and servicing equipment. When using these application examples, you recognize that we cannot be made liable for any damage/claims beyond the liability clause described. We reserve the right to make changes to these application examples at any time without prior notice. If there are any deviations between the recommendations provided in these application examples and other Siemens publications – e.g. Catalogs – then the contents of the other documents have priority. We do not accept any liability for the information contained in this document. Any claims against us – based on whatever legal reason – resulting from the use of the examples, information, programs, engineering and performance data etc. described in this application example shall be excluded. Such an exclusion shall not apply in the case of mandatory liability, e.g. under the German Product Liability Act (“Produkthaftungsgesetz”), in case of intent, gross negligence, or injury of life, body or health, guarantee for the quality of a product, fraudulent concealment of a deficiency or breach of a condition which goes to the root of the contract (“wesentliche Vertragspflichten”). However, claims arising from a breach of a condition which goes to the root of the contract shall be limited to the foreseeable damage which is intrinsic to the contract, unless caused by intent or gross negligence or based on mandatory liability for injury of life, body or health. The above provisions do not imply a change in the burden of proof to your detriment. It is not permissible to transfer or copy these application examples or excerpts of them without first having prior authorization from Siemens Industry Sector in writing. For questions about this document please use the following e-mail address: online-support.automation@siemens.com Table of Contents Ethernet Communication: Data Exchange S7-1200 <-> S7-1200 V1.1, ID Number: 39040038 3 Table of Contents Warranty, liability and support 2 1 Automation Problem 4 1.1 Tasks 4 Task A 4 Task B 4 1.2 Communication versions 4 Automation solution A 4 Automation solution B 5 1.3 Demo setup 5 1.4 List of components 6 2 Automation Solution 7 2.1 Connection diagram 7 2.2 S7-1200 Ethernet communication 7 Protocol versions 7 2.2.1 Integrated connection management (task A) 8 2.2.2 Manual connection management (task B) 10 2.2.3 Block parameterization 11 Saving the output parameters 13 2.3 Data transfer 15 2.3.1 Absolute addressing 15 2.3.2 Symbolic addressing 16 3 Configuration 19 3.1 Installing and wiring the hardware (automation solution A+B) 19 3.2 Hardware / network configuration (automation solution A+B) 20 3.3 Ethernet communication with integrated connection management (automation solution A) 22 3.3.1 Sender side 22 3.3.2 Receiver side 23 3.3.3 Downloading the overall project 25 3.3.4 Creating the Watch tables 26 3.3.5 Controlling communication blocks 27 3.4 Ethernet communication with manual connection management (automation solution B) 30 3.4.1 TCON 30 3.4.2 TSEND 31 3.4.3 TRCV 32 3.4.4 TDISCON 33 3.4.5 Controlling communication blocks 34 4 Code Elements 37 5 History 37 Automation Problem Tasks Ethernet Communication: Data Exchange S7-1200 <-> S7-1200 V1.1, ID Number: 39040038 4 Copyright  Siemens AG 2009 All rights reserved 39040038_CE-X17_EthernetCom_S7-1200_S7-1200_v1d1_en.doc 1 Automation Problem 1.1 Tasks Data is to be transferred between two S7-1200 CPUs via Ethernet. The task is divided into the following two cases. Task A Independently of the data type, data with a fixed data length is to be transferred from one S7-1200 CPU (PLC 1) to another (PLC 2). Task B A dynamically changeable number of data elements is to be transferred from one array of an S7-1200 CPU (PLC 1) to another (PLC 2). 1.2 Communication versions For the data exchange, the S7-1200 offers the following T communication blocks:  TSEND_C and TRCV_C (with integrated connecting and disconnecting)  TCON, TSEND, TRCV and TDISCON (with manual connecting and disconnecting) The S7-1200 supports the following Ethernet protocols:  TCP native (RFC 793)  ISO-on-TCP (RFC 1006) The data can be transferred to the communication blocks with  absolute or  symbolic addressing. Automation solution A Using  the T communication blocks with integrated connection management (TSEND_C / TRCV_C)  via TCP,  2 bytes of absolutely addressed data are sent from PLC 1 and received with PLC 2. Automation Problem Demo setup Ethernet Communication: Data Exchange S7-1200 <-> S7-1200 V1.1, ID Number: 39040038 5 Copyright  Siemens AG 2009 All rights reserved 39040038_CE-X17_EthernetCom_S7-1200_S7-1200_v1d1_en.doc Automation solution B Using  the T communication blocks with manual connection management (TCON, TSEND, TRCV, TDISCON)  via ISO-on-TCP  1 array with 3 elements of symbolically addressed data is sent from PLC 1 and received with PLC 2. The S7-1200 compact controllers CPU 1214C are configured using the STEP7 Basic V10.5 programming user interface. The configuration is explained and the function is demonstrated by the startup code for each task. 1.3 Demo setup Figure 1-1 PLC 1 PLC 2 Switch STEP7 Basic V10.5 Power supply 1 2 43 5 9Figure 1-1 shows the basic configuration. The two communicating CPUs and the programming unit with the “STEP7 Basic V10.5” software are connected to the switch using Ethernet cables. For the list of components, please refer to chapter 1.4. Automation Problem List of components Ethernet Communication: Data Exchange S7-1200 <-> S7-1200 V1.1, ID Number: 39040038 6 Copyright  Siemens AG 2009 All rights reserved 39040038_CE-X17_EthernetCom_S7-1200_S7-1200_v1d1_en.doc 1.4 List of components Siemens products Table 1-1 Components No. MLFB/order number Note 1. S7-1200 PM1207 POWER SUPPLY 1 6EP1332-1SH71 2. S7-1200 CPU1214C 1 6ES7214-1AE30-0XB0 DC/DC/DC 3. CSM 1277 COMPACT SWITCH MODULE 1 6GK7277-1AA00-0AA0 4. S7-1200 CPU1214C 1 6ES7214-1HE30-0XB0 DC/DC/Relais 5. STEP 7 BASIC V10.5 1 6ES7822-0AA00-0YA0 Accessories Table 1-2 Components No. Order number Note 1. PC/PG 1 With Ethernet interface 2. RJ45 Ethernet patch cable 2 Specialist dealers Automation Solution Connection diagram Ethernet Communication: Data Exchange S7-1200 <-> S7-1200 V1.1, ID Number: 39040038 7 Copyright  Siemens AG 2009 All rights reserved 39040038_CE-X17_EthernetCom_S7-1200_S7-1200_v1d1_en.doc 2 Automation Solution 2.1 Connection diagram For the list of components, please refer to chapter 1.4. Figure 2-1 L N PE PG/PC 2 3 1 M PEL+M PEL+M PEL+ ML+ N PEL LAN P1 LAN 4 P2 P3 2.2 S7-1200 Ethernet communication The S7-1200 T communication blocks allow simultaneous communication via Ethernet up to 8 connections. Protocol versions The T communication blocks for Ethernet communication support the following protocols:  Transport Connection Protocol (TCP): Identification of the communication partner using port addressing  ISO Transport over TCP (ISO-on-TCP): Identification of the communication partner via Transport Service Access Point (TSAP) With both protocols, up to 8,192 bytes can be transferred per job. The main difference between these protocol versions is that “ISO-on-TCP” supports the transfer of dynamic data lengths, whereas TCP allows only static data lengths. Automation Solution S7-1200 Ethernet communication Ethernet Communication: Data Exchange S7-1200 <-> S7-1200 V1.1, ID Number: 39040038 8 Copyright  Siemens AG 2009 All rights reserved 39040038_CE-X17_EthernetCom_S7-1200_S7-1200_v1d1_en.doc The following sections present the blocks with integrated and with manual connection management on the basis of the tasks. 2.2.1 Integrated connection management (task A) Ethernet communication with integrated connection management: Aside from the send and receive function, each of the TSEND_C and TRCV_C blocks additionally includes the functions for connecting and disconnecting. Figure 2-2 Connection data Partner identification TCP PLC 1 (active) Connect Connection data Partner identification TCP IE port TSEND_C SFB PLC 2 (passive) IE port Data Disconnect REQ CONT CONNECT DATA Send data Start address Data length Receive data Start address Data length Send Connect/disconnect TRCV_C SFB EN_R CONT CONNECT DATA Receive Connect/disconnect 1Figure 2-2 shows Ethernet communication with integrated connection management for task A. PLC 1 sends absolutely addressed data to PLC 2 via TCP (identification of the communication partner using port addressing). The connection is established via the CONT parameter. The connection is established according to the server-client principle. PLC 2 passively offers its service (server) and PLC 1 actively requests the connection establishment (client). After the connection has been successfully established, it is maintained. The connection information is stored in one data block for TSEND_C and in one for TRCV_C (addressed via the “CONNECT” parameter). The IP address of the communication partner and the protocol to be used are defined here. On the side of the communication partner, the connection data is stored accordingly. Automation Solution S7-1200 Ethernet communication Ethernet Communication: Data Exchange S7-1200 <-> S7-1200 V1.1, ID Number: 39040038 9 Copyright  Siemens AG 2009 All rights reserved 39040038_CE-X17_EthernetCom_S7-1200_S7-1200_v1d1_en.doc When selecting a different protocol, this setting changes also in the connection block of the communication partner, which requires a corresponding update of the control program. “TSEND_C” and “TRCV_C” are executed asynchronously via REQ or EN_R. When executing a send job via a positive edge on REQ, it is not required that “TRCV_C” be ready to receive (EN_R = 1) since the data is buffered. The data can thus still be received by a later receive enable (set “EN_R = 1”) (but only the last sent data). The DATA parameter determines the data to be sent or the receive mailbox with absolute start address and length. By resetting the CONT parameter, the communication connection is terminated. Automation Solution S7-1200 Ethernet communication Ethernet Communication: Data Exchange S7-1200 <-> S7-1200 V1.1, ID Number: 39040038 10 Copyright  Siemens AG 2009 All rights reserved 39040038_CE-X17_EthernetCom_S7-1200_S7-1200_v1d1_en.doc 2.2.2 Manual connection management (task B) Ethernet communication with manual connection management: Data exchange via the send block (“TSEND”) and the receive block (“TRCV”) requires connection establishment with “TCON” and to terminate the connection, the “TDISCON” block has to be executed on each communication side. Figure 2-3 PLC 1 (active) Connect Connection data Partner identification ISO-on-TCP Connection ID TSAP TSEND SFB TCON SFB TDISCON SFB PLC 2 (passive) Connection data Partner identification ISO-on-TCP Connection ID TSAP TRCV SFB TCON SFB TDISCON SFB Disconnect Data REQ ID LEN DATA ID REQ REQ CONNECT ID REQ CONNECT ID EN_R ID LEN DATA ID REQ Send data Array Receive data Array Connect Send Length Disconnect Connect Disconnect Receive Length 1Figure 2-3 shows Ethernet communication with manual connection management for task B. PLC 1 sends symbolically addressed data to PLC 2 via ISO-on-TCP (identification of the communication partner via TSAP). At a positive edge on REQ, TCON attempts to establish a connection to the communication partner (defined in the data block in “CONNECT”, identified by “ID”). After both communication partners have executed REQ, the connection is established and maintained. The connection information (communication partner, protocol selection and connection ID) is stored in the connection data block (addressed via the “CONNECT” parameter in the TCON connection block). The send block (TSEND), the receive block (TRCV) and the TDISCON disconnection block get the connection information only via the connection ID assignment on the respective “ID” parameter for the connection data block. Via a positive edge on “REQ”, TSEND sends the symbolically addressed “DATA” data with the length “LEN” to the communication partner with the connection “ID” (defined in the TCON connection block, “CONNECT” parameter). The data is buffered. [...]... 39040038_CE -X17_ EthernetCom _S7-1200_ S7-1200_v1d1_en.doc Figure 2-8 Ethernet Communication: Data Exchange S7-1200 S7-1200 V1.1, ID Number: 39040038 15 Automation Solution Data transfer Copyright  Siemens AG 2009 All rights reserved 39040038_CE -X17_ EthernetCom _S7-1200_ S7-1200_v1d1_en.doc Figure 2-9 When addressing absolute, the pointer is transferred to the start address together with the data length... the S7-1200 1 Copyright  Siemens AG 2009 All rights reserved 39040038_CE -X17_ EthernetCom _S7-1200_ S7-1200_v1d1_en.doc For more information, please refer to the S7-1200 system manual, ID number 36932465, or to the STEP 7 Basic V10.5 help Ethernet Communication: Data Exchange S7-1200 S7-1200 V1.1, ID Number: 39040038 11 Copyright  Siemens AG 2009 All rights reserved 39040038_CE -X17_ EthernetCom _S7-1200_ S7-1200_v1d1_en.doc... the dynamic data length transmission of structures (STRUCT data type) via ISO-on-TCP protocol the receive area (DATA parameter of the receiving block TRCV or TRCV_C) has to be a data block without the property “symbolic access only” Copyright  Siemens AG 2009 All rights reserved 39040038_CE -X17_ EthernetCom _S7-1200_ S7-1200_v1d1_en.doc NOTE Ethernet Communication: Data Exchange S7-1200 S7-1200 V1.1,... the Device view Ethernet Communication: Data Exchange S7-1200 S7-1200 V1.1, ID Number: 39040038 20 Configuration Hardware / network configuration (automation solution A+B) No 5 Instruction   6    Copyright  Siemens AG 2009 All rights reserved 39040038_CE -X17_ EthernetCom _S7-1200_ S7-1200_v1d1_en.doc  Note/picture Select “PLC_1” to detect the hardware configuration Detect the configuration of... “LEN” data length parameter must be “0”  Initialize the pointer of the DATA data reception with the start address of the “Dest” receive block and the length of one word (“P#DB3.DBX0.0 WORD 1”) Copyright  Siemens AG 2009 All rights reserved 39040038_CE -X17_ EthernetCom _S7-1200_ S7-1200_v1d1_en.doc 4 Note/picture Ethernet Communication: Data Exchange S7-1200 S7-1200 V1.1, ID Number: 39040038 24 Configuration. .. reserved 39040038_CE -X17_ EthernetCom _S7-1200_ S7-1200_v1d1_en.doc 6 Instruction Ethernet Communication: Data Exchange S7-1200 S7-1200 V1.1, ID Number: 39040038 29 Configuration Ethernet communication with manual connection management (automation solution B) 3.4 Ethernet communication with manual connection management (automation solution B) 3.4.1 TCON The “TCON” connection block for Ethernet communication... the overall project to the controllers Ethernet Communication: Data Exchange S7-1200 S7-1200 V1.1, ID Number: 39040038 25 Configuration Ethernet communication with integrated connection management (automation solution A) 3.3.4 Creating the Watch tables Table 3-6 No Instruction Copyright  Siemens AG 2009 All rights reserved 39040038_CE -X17_ EthernetCom _S7-1200_ S7-1200_v1d1_en.doc 1 In the project... -> “Modify to 1” to set the “TSEND_C_CONT” control parameter Copyright  Siemens AG 2009 All rights reserved 39040038_CE -X17_ EthernetCom _S7-1200_ S7-1200_v1d1_en.doc 1 Note/picture Ethernet Communication: Data Exchange S7-1200 S7-1200 V1.1, ID Number: 39040038 27 Configuration Ethernet communication with integrated connection management (automation solution A) No Instruction The “TSEND_C_BUSY” Busy... only” also here and confirm with “OK” Ethernet Communication: Data Exchange S7-1200 S7-1200 V1.1, ID Number: 39040038 23 Configuration Ethernet communication with integrated connection management (automation solution A) No Instruction In the “Dest” data block, create the data to be received with name, data type (here “Word”) (we transfer the “Byte” and “Char” send data to a word) 5 Parameterize the... job by a positive edge at “TSEND_REQ” (reset and set again) Ethernet Communication: Data Exchange S7-1200 S7-1200 V1.1, ID Number: 39040038 35 Configuration Ethernet communication with manual connection management (automation solution B) No Instruction Copyright  Siemens AG 2009 All rights reserved 39040038_CE -X17_ EthernetCom _S7-1200_ S7-1200_v1d1_en.doc 9 In addition, the third “Dest”.Array[3] . Ethernet Communication: Data Exchange S7-1200 <-> S7-1200 S7-1200 Configuration Example X17  February 2010 Warranty, liability and support Ethernet Communication: Data Exchange S7-1200. Problem Tasks Ethernet Communication: Data Exchange S7-1200 <-> S7-1200 V1.1, ID Number: 39040038 4 Copyright  Siemens AG 2009 All rights reserved 39040038_CE -X17_ EthernetCom _S7-1200_ S7-1200_v1d1_en.doc. components Ethernet Communication: Data Exchange S7-1200 <-> S7-1200 V1.1, ID Number: 39040038 6 Copyright  Siemens AG 2009 All rights reserved 39040038_CE -X17_ EthernetCom _S7-1200_ S7-1200_v1d1_en.doc

Ngày đăng: 02/07/2014, 20:20

Từ khóa liên quan

Mục lục

  • Cover sheet

  • Warranty, liability and support

  • Table of Contents

  • 1 Automation Problem

    • 1.1 Tasks

    • 1.2 Communication versions

    • 1.3 Demo setup

    • 1.4 List of components

    • 2 Automation Solution

      • 2.1 Connection diagram

      • 2.2 S7-1200 Ethernet communication

        • 2.2.1 Integrated connection management (task A)

        • 2.2.2 Manual connection management (task B)

        • 2.2.3 Block parameterization

        • 2.3 Data transfer

          • 2.3.1 Absolute addressing

          • 2.3.2 Symbolic addressing

          • 3 Configuration

            • 3.1 Installing and wiring the hardware (automation solution A+B)

            • 3.2 Hardware / network configuration (automation solution A+B)

            • 3.3 Ethernet communication with integrated connection management (automation solution A)

              • 3.3.1 Sender side

              • 3.3.2 Receiver side

              • 3.3.3 Downloading the overall project

              • 3.3.4 Creating the Watch tables

              • 3.3.5 Controlling communication blocks

Tài liệu cùng người dùng

Tài liệu liên quan