Truyen thong

  • View
    176

  • Download
    1

Embed Size (px)

Transcript

  • Applications & Tools Answers for industry.

    Cover

    Communication between SIMATIC S7-300 and Modicon M340 PLC Modbus TCP Connection

    Application Description January 2010

  • 2 Modbus TCP Connection V 1.0, Entry ID: 38586568

    Cop

    yrig

    ht

    Sie

    men

    s A

    G 2

    009

    All

    right

    s re

    serv

    ed

    Industry Automation and Drives Technologies Service & Support Portal This article is taken from the Service Portal of Siemens AG, Industry Automation and Drives Technologies. The following link takes you directly to the download page of this document. http://support.automation.siemens.com/WW/view/en/38586568 If you have any questions concerning this document please e-mail us to the following address: online-support.automation@siemens.com

    http://support.automation.siemens.com/WW/view/en/38586568mailto:online-support.automation@siemens.com

  • Modbus TCP Connection V 1.0, Entry ID: 38586568 3

    Cop

    yrig

    ht

    Sie

    men

    s A

    G 2

    009

    All

    right

    s re

    serv

    ed

    SIMATIC Modbus TCP Connection

    Automation Task 1

    Automation Solution 2

    Basics 3

    Function Mechanisms of this Application

    4

    Installation 5

    Startup of the Application 6

    Operation of the Application

    7

    Related Literature 8

    History 9

  • Warranty and Liability

    4 Modbus TCP Connection V 1.0, Entry ID: 38586568

    Cop

    yrig

    ht

    Sie

    men

    s A

    G 2

    009

    All

    right

    s re

    serv

    ed

    Warranty and Liability 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 used correctly. These application examples do not relieve you of the responsibility to use safe practices in application, installation, operation and maintenance. 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 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). The damages for a breach of a substantial contractual obligation are, however, limited to the foreseeable damage, typical for the type of contract, except in the event of intent or gross negligence or injury to life, body or health. The above provisions do not imply a change of the burden of proof to your detriment. Any form of duplication or distribution of these Application Examples or excerpts hereof is prohibited without the expressed consent of Siemens Industry Sector.

  • Table of Contents

    Modbus TCP Connection V 1.0, Entry ID: 38586568 5

    Cop

    yrig

    ht

    Sie

    men

    s A

    G 2

    009

    All

    right

    s re

    serv

    ed

    Table of Contents Warranty and Liability ................................................................................................. 4

    1 Automation Task .................................................................................. 7 2 Automation Solution ............................................................................. 8 2.1 Overview of overall solution ................................................................. 8 2.2 Description of the core functionality ................................................... 10 2.3 Hardware and software components used......................................... 14 3 Basics................................................................................................. 16 3.1 Basics on Modbus TCP...................................................................... 16 3.2 S7 function blocks for Modbus TCP................................................... 20 4 Function Mechanisms of this Application........................................... 23 4.1 Program structure of S7 CPU and ET200S CPU with integrated

    PN interface........................................................................................ 24 4.1.1 Program details on Modbus PN blocks .............................................. 24 4.1.2 Configuration explanations................................................................. 31 4.2 Program structure of S7 CPU with CP............................................... 32 4.2.1 Program details on MODBUS CP blocks ........................................... 32 4.2.2 Configuration explanations................................................................. 40 4.3 Program structure of Modicon M340.................................................. 40 4.3.1 Program details on Modicon M340 blocks ......................................... 41 4.3.2 Configuration explanations................................................................. 41 5 Installation .......................................................................................... 42 5.1 Installation of the hardware ................................................................ 42 6 Startup of the Application ................................................................... 45 6.1 Configuration of CPU319-3 PN/DP.................................................... 45 6.1.1 Hardware configuration ...................................................................... 45 6.1.2 Insert Modbus TCP blocks into project .............................................. 47 6.1.3 Configuring Modbus TCP connections............................................... 47 6.1.4 Project download................................................................................ 50 6.2 Configuration of IM151-8 PN/DP CPU............................................... 51 6.2.1 Hardware configuration ...................................................................... 51 6.3 Configuring the CPU315-2 PN/DP with CP343-1 Lean ..................... 53 6.3.1 Hardware configuration ...................................................................... 53 6.3.2 Creating a project for Modbus TCP.................................................... 56 6.3.3 Configuring Modbus TCP connections............................................... 57 6.3.4 Downloading project........................................................................... 59 6.4 Configuration of Modicon M340 ......................................................... 60 6.4.1 Using application example ................................................................. 60 6.4.2 Hardware configuration ...................................................................... 62 6.4.3 Configuring an Ethernet interface for Modbus TCP........................... 64 6.4.4 Creating a project for Modbus TCP.................................................... 66 7 Operation of the Application............................................................... 68 7.1 Operation of CPU319-3 PN/DP and IM151-8 PN/DP CPU................ 68 7.1.1 S7 station is client .............................................................................. 68 7.1.2 S7 station is server............................................................................. 71 7.2 71 7.3 Operation of CPU315-2 PN/DP + CP343-1 Lean .............................. 72 7.3.1 S7 station is client .............................................................................. 72 7.3.2 S7 station is server............................................................................. 74 7.4 Operation of Modicon M340............................................................... 76 7.4.1 Modicon M340 as client...................................................................... 76 7.4.2 Modicon M340 as server .................................................................... 77 8 Related Literature............................................................................... 79

  • Table of Contents

    6 Modbus TCP Connection V 1.0, Entry ID: 38586568

    Cop

    yrig

    ht

    Sie

    men

    s A

    G 2

    009

    All

    right

    s re

    serv

    ed

    8.1 Bibliography........................................................................................ 79 8.2 Internet Links...................................................................................... 79 9 History ................................................................................................ 79

  • Automation Task Overview of overall solution

    Modbus TCP Connection V 1.0, Entry ID: 38586568 7

    Cop

    yrig

    ht

    Sie

    men

    s AG

    200

    9 A

    ll rig

    hts r

    eser

    ved

    1 Automation Task Introduction

    Pr