13
Tool for Communication Generating the Connection Data for the open TCP/IP Communication using the Open Communication Wizard Tool

Simatic S-7 Open Communication

Embed Size (px)

DESCRIPTION

Wizard for setting open communication communication.Operation principle of the WizardOperation principle of the example programInstallation of hardware and softwareOperating the WizardOperating the example

Citation preview

Page 1: Simatic S-7 Open Communication

Tool for Communication

Generating the Connection Data for the open TCP/IP Communication using the Open Communication Wizard

Tool

Page 2: Simatic S-7 Open Communication

Warranty, Liability and Support

Open Communication Wizard Entry-ID: 25209116

V1.0 03.04.2007 2/13

Cop

yrig

ht ©

Sie

men

s A

G 2

007

All

right

s re

serv

ed

2520

9116

_Ope

n_C

omm

unic

atio

n_W

izar

d_D

OK

U_V

10_e

.doc

Note The function blocks and tools are not binding and do not claim to be complete regarding the circuits shown, equipping and any eventuality. The function blocks and tools 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. The introduced examples do not relieve you of the responsibility of safely and professionally using, installing, operating and servicing equipment. Using these function examples and tools within the examples, you accept that Siemens cannot be made liable for any damage/claims beyond the liability clause described. We reserve the right to make changes to these function examples and tools at any time without prior notice. If there are any deviations between the recommendations provided in these examples and other Siemens publications – e.g. Catalogs – the contents of the other documents have priority.

Warranty, Liability and Support

We accept no liability for information contained in this document.

Any claims against us – based on whatever legal reason – resulting from the use of the function blocks and tools, information, programs, engineering and performance data etc., described in this 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.

Copyright© 2007 Siemens A&D. It is not permitted to transfer or copy these function examples and tools or excerpts of them without first having prior authorization from Siemens A&D in writing.

For questions about this document please use the following e-mail-address:

mailto:[email protected]

Page 3: Simatic S-7 Open Communication

Foreword

Open Communication Wizard Entry-ID: 25209116

V1.0 03.04.2007 3/13

Cop

yrig

ht ©

Sie

men

s A

G 2

007

All

right

s re

serv

ed

2520

9116

_Ope

n_C

omm

unic

atio

n_W

izar

d_D

OK

U_V

10_e

.doc

Foreword In this example we introduce fully functional and tested automation configurations based on A&D standard products and individual function blocks or tools. They enable a simple, fast and cost-efficient realization of automation tasks.

Apart from a list of all required hardware and software components and a description of the way they are connected to each other, the examples include the tested tools or function blocks. This ensures that the functionalities described here can be reset in a short period of time and thus also be used as a basis for individual expansions.

Table of Contents

Table of Contents ......................................................................................................... 3

1 Automation Description ................................................................................. 4

2 Setup................................................................................................................ 5

3 Required Hardware and Software Components .......................................... 6

4 Principle of Operation .................................................................................... 7 4.1 Operation principle of the Wizard ..................................................................... 7 4.2 Operation principle of the example program..................................................... 8

5 Installation and Operation of the Sample/Tool ............................................ 9 5.1 Installation of hardware and software ............................................................... 9 5.2 Operating the Wizard...................................................................................... 10 5.3 Operating the example ................................................................................... 12

6 Internet Links ................................................................................................ 13

7 History ........................................................................................................... 13

Page 4: Simatic S-7 Open Communication

Automation Description

Open Communication Wizard Entry-ID: 25209116

V1.0 03.04.2007 4/13

Cop

yrig

ht ©

Sie

men

s A

G 2

007

All

right

s re

serv

ed

2520

9116

_Ope

n_C

omm

unic

atio

n_W

izar

d_D

OK

U_V

10_e

.doc

1 Automation Description

Automation Task All new SIMATIC S7-CPUs contain an integrated PROFINET interface which enables the TCP/IP communication.

However, the configuration of the TCP/IP communication via this integrated interface is only possible using the open communication and its function blocks.

This example shows the configuration and programming of a communication relationship between a CPU319 and a CPU414 via the integrated Ethernet interface and the ISO-on-TCP protocol.

The communication blocks FB65 "TCON", FB66 "TDISCON", FB63 "TSEND" and FB64 "TRCV" are used. The connection description does not occur via a configuration (in NetPro), therefore the parameters for each connection must be specified in a data block.

Automation solution Using the “Open Communication Wizard“ tool enables simple and clear specification of the connection parameters. The tool then exports a UDT with all parameters into your STEP 7 project. Using this UDT then enables generating the data block with the connection description.

Using the finished data block we then give a simple example of how the communication is realized in the S7-300 and S7-400 CPU from a program technology point of view using the above blocks.

Application areas / Customer benefits The Open Communication Wizard provides the following advantages:

• simplified generation of connection descriptions

• reduced susceptibility to errors

• only offers the required parameters

Page 5: Simatic S-7 Open Communication

Setup

Open Communication Wizard Entry-ID: 25209116

V1.0 03.04.2007 5/13

Cop

yrig

ht ©

Sie

men

s A

G 2

007

All

right

s re

serv

ed

2520

9116

_Ope

n_C

omm

unic

atio

n_W

izar

d_D

OK

U_V

10_e

.doc

2 Setup

The figure below shows the hardware setup of the example:

Figure 2-1

Industrial Ethernet

S7-300 with CPU319

S7-400 with CPU414-3

PG/PC withSTEP 7 and

Open Communication Wizard

Communication PartnerA

Communication PartnerB

192.168.1.31192.168.1.30

S7-300, S7-400 and the PG/PC are connected via Industrial Ethernet.

Page 6: Simatic S-7 Open Communication

Required Hardware and Software Components

Open Communication Wizard Entry-ID: 25209116

V1.0 03.04.2007 6/13

Cop

yrig

ht ©

Sie

men

s A

G 2

007

All

right

s re

serv

ed

2520

9116

_Ope

n_C

omm

unic

atio

n_W

izar

d_D

OK

U_V

10_e

.doc

3 Required Hardware and Software Components

Hardware components Table 3-1

Component Qty. MLFB / Order number Note

PS307 5A 1 6ES7307-1EA00-0AA0 CPU319-3 PN/DP 1 6ES7318-3EL00-0AB0 from V2.5 PS407 10A 1 6ES7407-0KA01-0AA0 CPU414-3 PN/DP 1 6ES7414-3EM05-0AB0 from V5.0

Configuration software/tools Table 3-2

Component Qty. MLFB / Order number Note

SIMATIC STEP7 Version 5.4 + SP1

1 6ES7810-4CC08-0YA5 Or higher

Additional software components Operating the Wizard requires the installation of .NET Framework on your PG/PC. Table 3-3

Component Note

Microsoft .NET Framework 2.0 http://www.microsoft.com/downloads/

Wizard and example project The STEP 7 example project and the Wizard are available on the HTML page from which you downloaded this document. Extract the zip-file after the download using any zip-program, such as Winzip. Save the files to the hard disk and retrieve the Example_STEP7.zip file using the SIMATIC Manager (File -> Retrieve).

The following link takes you directly to the download page of this document. http://support.automation.siemens.com/WW/view/en/25209116 Table 3-4

File name Contents

25209116_OpenCommWiz_CODE_V10.zip Contains all code files of this example

OpenCommWiz.zip Tool - Open Communication WizardExample_STEP7.zip Example project generated using

the Wizard

Page 7: Simatic S-7 Open Communication

Principle of Operation

Open Communication Wizard Entry-ID: 25209116

V1.0 03.04.2007 7/13

Cop

yrig

ht ©

Sie

men

s A

G 2

007

All

right

s re

serv

ed

2520

9116

_Ope

n_C

omm

unic

atio

n_W

izar

d_D

OK

U_V

10_e

.doc

4 Principle of Operation

4.1 Operation principle of the Wizard

The following schematic overview is the procedure for using the Open Communication Wizard

Figure 4-1

Wizard

STL Source

Export of STL source into a STEP7 project as UDT block

TCON_PAR

UDT 120

Data block withconnection

information

TCON_PAR

UDT 125

Data block with connection informationFB65

„TCON“FB65

„TCON“Verbindungsaufbau

Station 1 Station 2

Generate

Communication program

Page 8: Simatic S-7 Open Communication

Principle of Operation

Open Communication Wizard Entry-ID: 25209116

V1.0 03.04.2007 8/13

Cop

yrig

ht ©

Sie

men

s A

G 2

007

All

right

s re

serv

ed

2520

9116

_Ope

n_C

omm

unic

atio

n_W

izar

d_D

OK

U_V

10_e

.doc

4.2 Operation principle of the example program

The following overview displays operation principle and sequence of the example program.

Figure 4-2

FB65_REQ = 1

FB65 „TCON“ DB10 „TCON_PAR“

UDT120

FB63 „TSEND“ FB64 „TRCV“

FB66 „TDISCON“

FB66_REQ = 1

FB63_REQ = 1

MB20

SENDDATA

MB20

RECVDATA

Table 4-1

No. Action

1. With a positive edge at FB65_REQ, the FB65 “TCON“ tries to establish a connection using the connection data from the DB10 “TCON_PAR“.

2. After the connection has been established, memory byte 20 is sent to the partner station with each positive edge at FB63_REQ.

3. The partner receives the data and saves it in memory byte 20. 4. A rising edge at FB66_REQ reactivates the connection.

Page 9: Simatic S-7 Open Communication

Installation and Operation of the Sample/Tool

Open Communication Wizard Entry-ID: 25209116

V1.0 03.04.2007 9/13

Cop

yrig

ht ©

Sie

men

s A

G 2

007

All

right

s re

serv

ed

2520

9116

_Ope

n_C

omm

unic

atio

n_W

izar

d_D

OK

U_V

10_e

.doc

5 Installation and Operation of the Sample/Tool

Preliminary remark To test the functionality of the tool / function block, we offer you a finished software example with test code and test parameters as download. These software examples supports you in the first steps and tests.

The examples are always assigned to the components used in this document and illustrate their interaction principles. However, they are not real applications in the sense of technological problem solving with definable properties.

Functionality This example shows how using the Wizard enables creating a simple open TCP communication for sending and receiving data.

5.1 Installation of hardware and software

Installing the Wizard Retrieve the zip-file (OpenCommWiz.zip) and go through the setup process. The tool is installed into the Siemens installation directory and is available after installation at ’Start->SIMATIC’.

Installing the hardware Install the hardware on the appropriate rack/ rail according to the installation guidelines. Then network all components via Industrial Ethernet.

Installing the example project Table 5-1

No. Instruction Note / Explanation

1. Start the SIMATIC manager. 2. Retrieve the zipped project

(Example_STEP7.zip) via the menu File -> Retrieve).

Use the browser to search the relevant project and click OK to confirm.

3. Assign the IP addresses via “PLC -> Edit Ethernet node“ to the individual stations.

Click Search and select the appropriate station.

4. Adjust the IP address and the subnet mask. Then assign the IP configuration.

In this example, CPU319 has the address 192.168.10.31 and CPU414 has 192.168.10.30.

Note The example is runnable immediately. Chapter 5.3 describes how to control the data transfer

Page 10: Simatic S-7 Open Communication

Installation and Operation of the Sample/Tool

Open Communication Wizard Entry-ID: 25209116

V1.0 03.04.2007 10/13

Cop

yrig

ht ©

Sie

men

s A

G 2

007

All

right

s re

serv

ed

2520

9116

_Ope

n_C

omm

unic

atio

n_W

izar

d_D

OK

U_V

10_e

.doc

5.2 Operating the Wizard

The following instruction shows you the configuration steps necessary to generate the connection data contained in the example.

Table 5-2

Description Wizard

1. The Open Communication Wizard automatically generates a UDT after the input of some parameter and adds it to a STEP7 project.

2. In the next dialog you choose the type of your connection. Please note, that communication types ISO-on-TCP and UDP for S7-300 CPUs are only supported from firmware version V2.4 on.

3. In the following dialog you specify which communication partners you wish to configure. In this example communication partner A is the CPU319 and communication partner B the CPU414.

Page 11: Simatic S-7 Open Communication

Installation and Operation of the Sample/Tool

Open Communication Wizard Entry-ID: 25209116

V1.0 03.04.2007 11/13

Cop

yrig

ht ©

Sie

men

s A

G 2

007

All

right

s re

serv

ed

2520

9116

_Ope

n_C

omm

unic

atio

n_W

izar

d_D

OK

U_V

10_e

.doc

Description Wizard

4. Then you assign the connection parameters. Please ensure, that the correct interface has been selected. Please also note, that rack and slot must be adjusted for S7-400.

5. The TSAPs refer to the connection points at the respective CPU. Each connection must have a unique TSAP pair assigned to it. The TSAP is then composed of E002 and your TSAP extension. Example: E0.02.74.73.61.70.2D.3

6. In the final dialog please specify to which project and to which block folder the generated UDTs should be imported. Assign any UDT name.

7. After the UDT was added to your STEP7 project, you generate a new data block. In the data block you generate a new variable of the UDT type (here: UDT120). The parameters are now default according to your settings and can be used by the FB65 “TCON“.

Page 12: Simatic S-7 Open Communication

Installation and Operation of the Sample/Tool

Open Communication Wizard Entry-ID: 25209116

V1.0 03.04.2007 12/13

Cop

yrig

ht ©

Sie

men

s A

G 2

007

All

right

s re

serv

ed

2520

9116

_Ope

n_C

omm

unic

atio

n_W

izar

d_D

OK

U_V

10_e

.doc

5.3 Operating the example

The example is controlled via the attached variable tables. For each communication partner a separate variable table exists (CONTROL).

Figure 5-1

Table 5-3

No. Instruction

1. Triggering the connection setup with rising edge at FB65_REQ in both communication partners.

2. As soon as the connection has been established (FB65_connected) you trigger the data transfer in the CPU319 with a rising edge at FB63_REQ.

3. Data is continuously received in the S7-400. Evaluate the rising edge of FB64_NDR to process the received data.

4. After sending was completed, the connection can be cancelled with a rising edge at FB66_REQ. This step must be performed in both communication partners.

Page 13: Simatic S-7 Open Communication

Internet Links

Open Communication Wizard Entry-ID: 25209116

V1.0 03.04.2007 13/13

Cop

yrig

ht ©

Sie

men

s A

G 2

007

All

right

s re

serv

ed

2520

9116

_Ope

n_C

omm

unic

atio

n_W

izar

d_D

OK

U_V

10_e

.doc

6 Internet Links

Further information is available in the following documents Table 6-1

Title Link

“System software for S7-300/400 system- and standard functions” manual

http://support.automation.siemens.com/WW/view/en/1214574

Examples and FAQs for open communication via Industrial Ethernet

http://support.automation.siemens.com/WW/view/en/22868211

Automation system S7-400 CPU data http://support.automation.siemens.com/WW/view/en/23904550

7 History Table 7-1

Version Date Modification

V1.0 04.05.2007 First edition