21402169 opc xml-da demonstration doku v10 e

34
Application for Communication Visual Basic .NET OPC Client for the XML-DA Interface of the SIMATIC NET OPC Server Demonstration

Upload: sergiogranjeiro

Post on 26-Mar-2015

107 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: 21402169 OPC XML-DA Demonstration DOKU v10 e

Application for Communication

Visual Basic .NET OPC Client for the XML-DA Interface of the SIMATIC NET OPC Server

Demonstration

Page 2: 21402169 OPC XML-DA Demonstration DOKU v10 e

Warranty, Liability and Support

Data Exchange via XML-DA Entry-ID: 21402169

V1.0 26.04.05 2/34

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2140

2169

_OP

C_X

ML-

DA

_Dem

onst

ratio

n_D

OK

U_V

10_e

.doc

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 examples, information, programs, engineering and performance data etc., described in this document 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 does not imply a change in the burden of proof to your detriment.

The Application Examples are not binding and do not claim to be complete regarding the circuits shown, equipping and any eventuality. They 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 in safely and professionally using, installing, operating and servicing equipment. By using this application example you accept that Siemens is not liable for any damages except for those specified in the above liability clause. 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 this application example and other Siemens publications – e.g. Catalogs – the contents of the other documents have priority.

Copyright© 2004 Siemens A&D. Any form of duplication or distribution of these application examples or excerpts hereof is prohibited without the expressed consent of Siemens Energy & Automation, Inc.

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

mailto:[email protected]

Page 3: 21402169 OPC XML-DA Demonstration DOKU v10 e

Foreword

Data Exchange via XML-DA Entry-ID: 21402169

V1.0 26.04.05 3/34

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2140

2169

_OP

C_X

ML-

DA

_Dem

onst

ratio

n_D

OK

U_V

10_e

.doc

Foreword

Objectives of the application Exchanging process data between logic controllers and computers via OPC is a core element of automation technology.

The application on hand shows a possible procedure for independently generating individual OPC clients using the programming language Visual Basic .NET by Microsoft.

A visualization of a mixed process is hereby realized in Visual Basic .NET. The programming paradigm ".NET“ by Microsoft is used here.

Main contents of this application The following teaching materials are provided with this application:

• Installation and configuration of a web server (in this example the web-server of the internet information services of Windows). This web server is used for accessing the OPC server.

• Highlighting safety aspects (authentication and authorization of clients) for accessing the web-server and the OPC XML-DA web service.

• Demonstration in dealing with web services in .NET, especially the OPC XML-DA web service.

• Demonstration of the most important OPC XML-DA methods for accessing the process variables

• Demonstration of error handling with .NET

• Generating an OPC client as Windows application as well as ASP.NET web application (for calling a web browser) with similar function range.

Delimitation This application does not contain a complete description

• of network safety aspects (encoded communication via SSL, application of firewalls, using VPNs)

• of the .NET framework,

• of the OPC specification as well as

• deeper level ASP.NET mechanisms

Therefore, basic knowledge in the area of object oriented programming is required. Further knowledge in UML (Unified Modelling Language) is an advantage.

Page 4: 21402169 OPC XML-DA Demonstration DOKU v10 e

Foreword

Data Exchange via XML-DA Entry-ID: 21402169

V1.0 26.04.05 4/34

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2140

2169

_OP

C_X

ML-

DA

_Dem

onst

ratio

n_D

OK

U_V

10_e

.doc

Structure of the document The documentation of this application is divided into the following main parts:

• Introduction

• Extension

• Demonstration In addition, two setup programs (for application in Windows and ASP.NET respectively), which also contain the source code of the application, as well as the STEP 7 code, are available.

This third document, the Demonstration part, is aimed at persons who want to gain a quick overview.

Part Description Introduction Application Description and Function Principles

Provides a general overview of the contents. You will learn about the components used (standard hardware and software components and the specially created software).

Extension Function Principles in detail and Program Structure Discusses the detailed function processes of the involved hardware and software components, the solution structures, and where sensible the concrete implementation of this application. This part is necessary if you want to learn about the interaction of the solution components, for example in order to use them as the basis for own development.

Demonstration Structure, Configuration and Operation of the Application

This part leads you step by step through the structure, important configuration steps, commissioning and operation of the application.

An additional component available is the S7 program code.

Part Description

Setup Program of the Windows Application

Installs the Windows application on your PC. The source code of the application is available in the program directory.

Setup Program of the ASP.NET Application

Installs the ASP.NET application on your PC. The source code of the application is available in the program directory.

S7 program code The S7 program code contains the code and a user interface.

Page 5: 21402169 OPC XML-DA Demonstration DOKU v10 e

Foreword

Data Exchange via XML-DA Entry-ID: 21402169

V1.0 26.04.05 5/34

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2140

2169

_OP

C_X

ML-

DA

_Dem

onst

ratio

n_D

OK

U_V

10_e

.doc

Reference for Automation and Drives Service & Support This entry originates from the internet application portal of the A&D Service and Support. The following link takes you directly to the download page of this document.

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

Page 6: 21402169 OPC XML-DA Demonstration DOKU v10 e

Foreword

Data Exchange via XML-DA Entry-ID: 21402169

V1.0 26.04.05 6/34

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2140

2169

_OP

C_X

ML-

DA

_Dem

onst

ratio

n_D

OK

U_V

10_e

.doc

Table of Contents

Table of Contents ......................................................................................................... 6

Introduction................................................................................................................... 7

1 Document on Hand .................................................................................... 7

Setup and Operation of the Application ..................................................................... 8

2 Installation and Commissioning............................................................... 8 2.1 Setup of the hardware.................................................................................. 8 2.2 Installation of the standard software .......................................................... 11 2.3 Installation of the application software ....................................................... 13 2.4 Configuration of the Internet Information Services..................................... 15 2.5 Configuring the access protection.............................................................. 17 2.6 SIMATIC side configuration of the stations ................................................ 22

3 Operating the Application ....................................................................... 26 3.1 Windows application .................................................................................. 26 3.2 The ASP.NET application .......................................................................... 30

Appendix and List of Further Literature ................................................................... 34

4 Literature................................................................................................... 34 4.1 Bibliographic References ........................................................................... 34 4.2 Internet links............................................................................................... 34

Page 7: 21402169 OPC XML-DA Demonstration DOKU v10 e

Introduction

Document on Hand

Data Exchange via XML-DA Entry-ID: 21402169

V1.0 26.04.05 7/34

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2140

2169

_OP

C_X

ML-

DA

_Dem

onst

ratio

n_D

OK

U_V

10_e

.doc

Introduction

1 Document on Hand

This document is the setup and operating instruction for the application "OPC Client for XML-DA interface of the SIMATIC NET OPC Server".

The documents Introduction and Extension describe the basic setup of the application and the employed function components, as well as their interaction within this application.

The document on hand only discusses setup and operation of the example application.

Page 8: 21402169 OPC XML-DA Demonstration DOKU v10 e

Setup and Operation of the Application

Installation and Commissioning

Data Exchange via XML-DA Entry-ID: 21402169

V1.0 26.04.05 8/34

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2140

2169

_OP

C_X

ML-

DA

_Dem

onst

ratio

n_D

OK

U_V

10_e

.doc

Setup and Operation of the Application

Content This part leads you step by step through setup, commissioning and operation of the Windows application and the ASP.NET application of this application example.

2 Installation and Commissioning

Here you will find information on … the hardware and software to be installed, and the steps necessary for commissioning the example. Installing and configuring the software on the head-end requires administrator rights.

2.1 Setup of the hardware

Setting up the controller (S7 station) The description and manuals as well as delivery information contained in the delivery scope of the respective products, should be followed in any case.

For commissioning the S7 hardware for this application please proceed as follows: Table 2-1

No. Instructions 1 Mount the

• PS 307 5A power supply • central controller module CPU 315-2DP • communications processor CP 343-1 on a mounting rail (connect CPU 315-2DP and CP 343-1 via bus connector)

2 Connect CPU 315-2DP to the power supply. 3 Connect the power supply to the corresponding supply voltage.

Note The setup guidelines for SIMATIC S7 must generally be followed. Please see /4/.

Page 9: 21402169 OPC XML-DA Demonstration DOKU v10 e

Setup and Operation of the Application

Installation and Commissioning

Data Exchange via XML-DA Entry-ID: 21402169

V1.0 26.04.05 9/34

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2140

2169

_OP

C_X

ML-

DA

_Dem

onst

ratio

n_D

OK

U_V

10_e

.doc

Bus cabling For the demonstration of this application, the controller (S7 station), the head-end station (Rack-PC) and the visualization station (PG/PC) must be connected to a joint Ethernet network.

Proceed by connecting the Ethernet connections of the individual stations to a hub via the standard Ethernet line (device for inter-connecting several Ethernet stations).

Note It is not advised to connect the individual stations to an existing network (e.g. office network) for demonstration purposes, as the operation of an internet server (on the head-end) should never be performed without permission of the respective network administrator.

Adjusting the IP addresses for visualization station and head-end As soon as the three stations of this application are interconnected with a hub, the IP addresses must be adjusted so they can communicate with each other. Proceed by performing the following steps (first for the visualization station, then the same steps for the head-end).

Note When using the IP addresses, used in this example, for individual stations, no adjustment needs to be made at the STEP 7 example project later on.

Table 2-2

No. Instructions 1. Open the properties dialog of the LAN connection used by you via:

Start Settings Network right mouse-click on LAN Connection Local Area Connection Properties

Page 10: 21402169 OPC XML-DA Demonstration DOKU v10 e

Setup and Operation of the Application

Installation and Commissioning

Data Exchange via XML-DA Entry-ID: 21402169

No.

V1.0 26.04.05 10/34

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2140

2169

_OP

C_X

ML-

DA

_Dem

onst

ratio

n_D

OK

U_V

10_e

.doc

Instructions 2. In the list you select the entry

Internet Protocol(TCP/IP) and press the Properties button Note If the Internet Protocol(TCP/IP) entry is not contained in the list, it must be added with Install...

3. On both stations you select the

option Use the following IP address

4. For visualization station and head-end you enter two different IP addresses,

which only differ in the far right digit, e.g. “10.0.0.1“ for the visualization station and “10.0.0.2“ for the head-end. Please ensure, that the IP addresses selected by you are unique in the connected network, and that the addresses are located in the same subnet.

5. Please enter the same sub-net mask for both stations, e.g. “255.255.255.0“ 6. Confirm the opened dialogs with OK.

Page 11: 21402169 OPC XML-DA Demonstration DOKU v10 e

Setup and Operation of the Application

Installation and Commissioning

Data Exchange via XML-DA Entry-ID: 21402169

V1.0 26.04.05 11/34

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2140

2169

_OP

C_X

ML-

DA

_Dem

onst

ratio

n_D

OK

U_V

10_e

.doc

2.2 Installation of the standard software

Installation of the Internet Information Services For installing the IIS on the head-end, please follow the following steps. Please have your Windows installation CD ready for the installation. The IIS must be installed before installing Microsoft .NET Frameworks 1.1. If .NET Framework has already been installed beforehand, please observe the note at the end of the following table. Table 2-3

No. Instructions 1. Open the "Software" window by selecting:

Start Settings Control Panel Software

2. Select Add/Remove Windows Components. 3. Select the components list Internet Information Services(IIS). 4. Click the Details... button to open the Internet Information

Services (IIS) dialog. 5. Select the following options from the list of subcomponents:

• Common Files • Internet Information Services Snap-In • WWW service (leave the default setting here) Confirm your selection with "OK".

6. Click Next > to start installation and follow the instructions of the installation program.

7. When using the head-end in live production, you must ensure, that the current version of the Internet Information Services has been installed. Using the link http://windowsupdate.microsoft.com/ you can check from the head-end whether important updates for the IIS exist. You can also download and install existing updates manually at www.microsoft.com/technet/security/current.aspx or www.microsoft.com/downloads.

Note If "Microsoft .NET Framework 1.1" was already installed before the installation of IIS (Framework is listed in the "Software" dialog box of the system controller, e.g. due to an installation of the SIMATIC NET software V6.2), please proceed as follows: 1. Open the DOS prompt by selecting: Start Run enter „cmd“ OK 2. Enter

"%systemroot%\Microsoft.NET\Framework\v1.1.4322\aspnet_regiis –i" and press the Return key.

3. Reboot the PC.

Page 12: 21402169 OPC XML-DA Demonstration DOKU v10 e

Setup and Operation of the Application

Installation and Commissioning

Data Exchange via XML-DA Entry-ID: 21402169

V1.0 26.04.05 12/34

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2140

2169

_OP

C_X

ML-

DA

_Dem

onst

ratio

n_D

OK

U_V

10_e

.doc

SIMATIC NET PC Software The SIMATIC NET PC software (incl. SIMATIC NCM) as well as the license for the IE SOFTNET-S7 will be installed on the head-end. The software package includes all tools required to install and operate a PC station.

A description of the installation of the SIMATIC NET PC software is not given here. The installation takes place in the familiar Windows environment and is self-explanatory. Please follow the installation instruction on the SIMATIC NET CD.

From SIMATIC NET V6.1 upward, the process “Advanced PC Configuration” is used for the commissioning of PC stations. It enables the configuration of PC stations directly in STEP 7. Prior to the use of “Advanced PC Configuration” we strongly recommend to read manual /3/ “SIMATIC NET Commissioning PC Stations – Quick Start”.

Note The required Microsoft .NET Framework is automatically installed by the installation program of the SIMATIC NET PC software (from V6.2 SP1).

Page 13: 21402169 OPC XML-DA Demonstration DOKU v10 e

Setup and Operation of the Application

Installation and Commissioning

Data Exchange via XML-DA Entry-ID: 21402169

V1.0 26.04.05 13/34

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2140

2169

_OP

C_X

ML-

DA

_Dem

onst

ratio

n_D

OK

U_V

10_e

.doc

2.3 Installation of the application software

Installation of the STEP 7 example project To open the STEP 7 project and to adjust it to your specific system configuration please follow the instructions given below: These steps are performed on the PG/PC (of the visualization station).

Table 2-4

No. Instructions Note 1. Copy the archived STEP 7 project

“21402169_OPC_XML-DA_STEP7_v10.zip“ into a temporary directory.

2. Open the SIMATIC Manager. 3. Extract the archive “21402169_OPC_XML-

DA_STEP7_v10.zip“ via the menu File > Retrieve...

The STEP 7-Projekt "315_OPC" is extracted.

4. Close the SIMATIC Manager

Installation of the Windows application The installation of the Windows application occurs two times. For the local visualization, the program is installed on the head-end as well as on the visualization station for remote visualization.

If you wish to use the ASP.NET application only, you need not install the Windows application and can continue with the next section. However, you can also operate the Windows and the ASP.NET application parallel.

Table 2-5

No. Instructions Note 5. Copy the .zip-file contained in the delivery scope

"21402169_OPC_XML-DA_WIN_CODE_v10.zip " into a directory on the respective PC.

6. Extract the contained files into a temporary directory. 7. Execute the "Setup.exe" file and follow the installation

instructions of the installation program. Note If .NET-Framework has not been installed yet, the setup program will notify you of this and offer a link where you can download .NET-Framework from the internet.

Page 14: 21402169 OPC XML-DA Demonstration DOKU v10 e

Setup and Operation of the Application

Installation and Commissioning

Data Exchange via XML-DA Entry-ID: 21402169

V1.0 26.04.05 14/34

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2140

2169

_OP

C_X

ML-

DA

_Dem

onst

ratio

n_D

OK

U_V

10_e

.doc

Installation of the ASP.NET application The ASP.NET application is only installed on the head-end. An installation on the visualization station is not necessary.

Table 2-6

No. Instructions Note 1. Copy the .zip-file contained in the delivery scope

"21402169_OPC_XML-DA_ASP_CODE_v10.zip" into a directory on the respective head-end.

2. Extract the contained files into a temporary directory. 3. Execute the "Setup.exe" file and follow the installation

instructions of the installation program. Note If .NET-Framework has not been installed yet, the setup program will notify you of this and offer a link where you can download .NET-Framework from the internet.

After the ASP.NET application has been installed, it is not yet runnable. This requires configuring the web server accordingly first (see following chapter).

Page 15: 21402169 OPC XML-DA Demonstration DOKU v10 e

Setup and Operation of the Application

Installation and Commissioning

Data Exchange via XML-DA Entry-ID: 21402169

2.4 Configuration of the Internet Information Services

The Internet Information Services (IIS) offer some specific functions for access to web services. IIS is thus installed on the PC, on which the OPC server is running – also i.e. the head-end.

Configuring the web service for the access to the OPC XML-DA interface To enable access from applications to the SIMATIC NET OPC server via OPC XML-DA, the Internet Information Services (IIS) must be set accordingly. The table below explains how you can configure the IIS for this access option.

For access protection the default settings initially remain unchanged. The security settings are made in the next section.

Table 2-7

V1.0 26.04.05 15/34

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2140

2169

_OP

C_X

ML-

DA

_Dem

onst

ratio

n_D

OK

U_V

10_e

.doc

No. Instructions Note 1. Open the “Internet Information Services“ with:

Start Control Panel Administrative Tools Internet Services Manager

Note If the "Administrative Tools" item is not available, select: Start Run... and enter the following string: %SystemRoot%\System32\Inetsrv\iis.msc

2. Select "Default Web Site" from the context menu of this folder (click with the right mouse button) and select New Virtual Directory

3. Click the Virtual Directory Creation Wizard and then the Next button.

4. Enter "OPC.Simatic.NET" in the Alias: field and click Next> Note Please ensure that the name does not contain any special characters or dots. The access to virtual directories with special characters in their names will be blocked later on for security reasons (using the "IISLockdown" tool).

5. Click the Browse.. button and select the subdirectory "\opc2\binXML" from your SIMATIC.NET installation directory. This directory includes the file "sopcweb.asmx". Press Next> to confirm your selection.

Page 16: 21402169 OPC XML-DA Demonstration DOKU v10 e

Setup and Operation of the Application

Installation and Commissioning

Data Exchange via XML-DA Entry-ID: 21402169

No. Instructions

V1.0 26.04.05 16/34

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2140

2169

_OP

C_X

ML-

DA

_Dem

onst

ratio

n_D

OK

U_V

10_e

.doc

Note 6. Checkmark the following items in the Access

Permissions dialog box: • Read • Run scripts (such as ASP) Press Next> to confirm your selection.

7. Click Finish to close the Virtual Directory Creation Wizard. The Default Web Site folder should now include OPC.Simatic.NET.

Note After the ASP.NET application has been installed, the virtual directory of the "OPCXMLDANetClient" application appears below the Default Web Site. This was automatically generated by the setup program.

8. Close the configuration window.

Automatic protection for the Web Server The "IISLockdown" tool is used for protecting the web server of the IIS. This tool can be obtained free of charge from www.microsoft.com, the Microsoft Homepage, where you enter "download iislockdown" into the search field).

For executing the IISLockdown tool please perform the following steps. Table 2-8

No. Instructions Note 1. Copy the "iislockd.exe" file into a temporary directory of

the head-end.

2. Start "iislockd.exe" file. 3. Click Next > on the start page 4. Select "I agree" on the second page in order to

accept the license conditions and click Next >.

5. In the Select Server Template window you select the Dynamic Web Server (ASP enabled) entry from the Server templates list. Press Next> to confirm your selection.

The checkmark for View template settings needs not be set.

6. Set the checkmark in the URLScan window at Install URLScan filter on the server. Press Next> twice to confirm your selection.

Now the security settings of the web server are adjusted.

7. Close the tool with Next > and Finish.

Page 17: 21402169 OPC XML-DA Demonstration DOKU v10 e

Setup and Operation of the Application

Installation and Commissioning

Data Exchange via XML-DA Entry-ID: 21402169

2.5 Configuring the access protection

General notes Using this application requires access to the HTTP service of the internet information services. The access is normally blocked by the integrated Windows XP Firewall (or another firewall installed on the PC). Release this service in your firewall or switch the firewall off.

Configuring the access protection to the IIS In this application, the integrated Windows authentication of the IIS is used. In order to activate it, please proceed as follows:

Table 2-9

V1.0 26.04.05 17/34

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2140

2169

_OP

C_X

ML-

DA

_Dem

onst

ratio

n_D

OK

U_V

10_e

.doc

No. Instructions Note 1. Open the “Internet Information Services“ with:

Start Control Panel Administrative Tools Internet Services Manager

Note If the "Administrative Tools" item is not available, select: Start Run... and enter the following string: %SystemRoot%\System32\Inetsrv\iis.msc

2. In the left structure tree you select the Default Web Site and open the context menu (with the right mouse button) and select Properties.

3. In the properties dialog you change to the Directory Security tab

4. In the Anonymous access and

authentication control you press the Edit...button.

Page 18: 21402169 OPC XML-DA Demonstration DOKU v10 e

Setup and Operation of the Application

Installation and Commissioning

Data Exchange via XML-DA Entry-ID: 21402169

No. Instructions

V1.0 26.04.05 18/34

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2140

2169

_OP

C_X

ML-

DA

_Dem

onst

ratio

n_D

OK

U_V

10_e

.doc

Note 5. Remove the checkmark at Anonymous

access and set the checkmark at Integrated Windows authentication.

6. Confirm all details and dialogs with OK.

Creating or configuring users for accessing the application For accessing the OPC XML-DA web service and the ASP.NET application, it is recommended to create one or several users. Other existing users can also be used of course.

The following table explains how you can create users on the head-end and assign them to the "Users" group. A prerequisite is that you have administrator permission and the IISLockdown tool has already been installed (see 2.4 Configuration of the Internet Information Services).

Table 2-10

No. Instructions Note 1. Open the Computer Management with:

Start Settings Control Panel Administrative Tools Computer Management

2. In the left structure tree you select: Computer Management (Local) System Tools Local Users and Groups Users

Page 19: 21402169 OPC XML-DA Demonstration DOKU v10 e

Setup and Operation of the Application

Installation and Commissioning

Data Exchange via XML-DA Entry-ID: 21402169

No. Instructions

V1.0 26.04.05 19/34

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2140

2169

_OP

C_X

ML-

DA

_Dem

onst

ratio

n_D

OK

U_V

10_e

.doc

Note 3. In the Users context you select New User... .

4. In the New User dialog you fill in the following fields:

• User name, e.g. "OPC client" • Full name, e.g. "OPC client" • Description, e.g. "To access the OPC server" • Password and Confirm password, e.g.

"Password_25!" (The password should always include capital and lower case letters, special characters and numbers)

Remove checkmark at User must change password at next logon and set the checkmark at Password never expires.

5. Create the user by pressing the Create button and close the dialog with Close.

6. Change to the Groups folder. 7. Open the group properties by double-clicking Users. 8. Click Add... to add a new user to the group. 9. In the field "Enter the object names to select" you enter

the user name of the above created user (e.g. "OPC client")

10. Close the properties dialog of the "Users" group with

OK

Note Also add the user currently logged on at the head-end, e.g. "Administrator" to the "Users" group. For the production mode of the head-end, you should also create an additional user with restricted permissions and as a member of the "Users" group, used for local access. As described above, this user should then also be included in the list of the users authorized for accessing the OPC server.

Page 20: 21402169 OPC XML-DA Demonstration DOKU v10 e

Setup and Operation of the Application

Installation and Commissioning

Data Exchange via XML-DA Entry-ID: 21402169

V1.0 26.04.05 20/34

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2140

2169

_OP

C_X

ML-

DA

_Dem

onst

ratio

n_D

OK

U_V

10_e

.doc

Configuring the access protection for the XML-DA interface The access to the XML-DA interface of the SIMATIC NET OPC server is adjusted in the "web.config" file of the interface. In this application, only certain users (OPC client and ASPNET) are to be granted access to the interface. These users have only restricted access to data of a PC.

To do this, please follow the steps below. Table 2-11

No. Instructions Note 1. Change to the “\opc2\binXML“ directory in your

SIMATIC.NET installation directory, e.g.: "C:\Programm\Siemens\SIMATIC.NET\opc2\binXML"

2. Open the "web.config" file contained in this directory (e.g. notepad.exe).

3. In the file you search the tag <authentication mode="Windows"/>

4. Add the following lines behind it in a new line. This permits the users "OPC client" and "ASPNET" to access the XML-DA interface of the OPC server. Instead of [PC Name] you enter the computer name of the head-end (see Start Settings Control Panel System Computer name). <authorization> <allow users="[PC Name]\OPC-Client, [PC Name]\ASPNET"/> <deny users="*"/> </authorization>

Note The ASP.NET application accesses the OPC server with the name "ASPNET".

5. Save the file and close it with the Editor.

Page 21: 21402169 OPC XML-DA Demonstration DOKU v10 e

Setup and Operation of the Application

Installation and Commissioning

Data Exchange via XML-DA Entry-ID: 21402169

V1.0 26.04.05 21/34

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2140

2169

_OP

C_X

ML-

DA

_Dem

onst

ratio

n_D

OK

U_V

10_e

.doc

Configuring the access protection for the ASP.NET application If you wish to configure the ASP.NET application, you should configure the access protection for the application here.

The access to the ASP.NET application is also set via a "web.config" file. This only requires adjusting the computer name of the head-end in the "web.config" file of the ASP.NET application.

Only certain users (OPC client) should have access to this application as well. To do this, please follow the steps below.

Table 2-12

No. Instructions Note 1. On the head-end you change to the directory

”C:\Inetpub\wwwroot\OPCXMLDANetClient“

2. Open the "web.config" file contained in this directory (e.g. notepad.exe).

3. Search for the term "Head-end" in this file. 4. Replace "Head-end" with the computer name of your

head-end station. Ensure, that the user used here has actually been created.

Computer name: see Start Settings Control Panel System (Computer name).

5. Save the file and close it with the Editor.

Page 22: 21402169 OPC XML-DA Demonstration DOKU v10 e

Setup and Operation of the Application

Installation and Commissioning

Data Exchange via XML-DA Entry-ID: 21402169

2.6 SIMATIC side configuration of the stations

Configuring the head-end using the Station Configuration Editor The configuration of the head-end with the Station Configuration Editor corresponds to plugging S7-400 hardware components to a rack. Thereby components from the PC station (hardware and software components) are, in software technology terms, allocated to a virtual slot.

Table 2-13

V1.0 26.04.05 22/34

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2140

2169

_OP

C_X

ML-

DA

_Dem

onst

ratio

n_D

OK

U_V

10_e

.doc

No. Instructions Note 1. Start the Station Configuration Editor by double-clicking

the icon in the toolbar or via: Start Station Configuration Editor

2. Set the Head-end name with the Station name button.

Note This name must be identical with the name of the SIMATIC PC station in the STEP 7 project.

3. Slots 1 to 32 must be empty. Remove all existing components by selecting the component and pressing Delete... . Confirm the query with OK.

4. In the Station Configuration Editor you select the line with the index 1

5. Open the Add component dialog with the Add... button.

6. Select the OPC Server entry from the Type list. 7. Close the dialog with OK and also confirm the following

dialog with OK.

8. Select the line with the index 2. 9. Press the Add… button. This opens the Add

component dialog.

10. For Type you select the entry IE General. 11. If you have several Ethernet cards on the PC you must

select the card connected with the S7 station in Parameter assig..

12. Confirm your selection and the query with OK. The Component Properties dialog contains the current IP address and subnet mask of the Ethernet card.

Page 23: 21402169 OPC XML-DA Demonstration DOKU v10 e

Setup and Operation of the Application

Installation and Commissioning

Data Exchange via XML-DA Entry-ID: 21402169

No. Instructions Note 13. The complete configuration in the Station

Configuration Editor now looks as follows:

Set PG/PC interface to Industrial Ethernet

V1.0 26.04.05 23/34

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2140

2169

_OP

C_X

ML-

DA

_Dem

onst

ratio

n_D

OK

U_V

10_e

.doc

The access from the PG/PC (also the visualization station) to the head-end as well as the S7-300 station occurs via Industrial Ethernet. The PG/PC interface of the PG must have been set accordingly.

Please follow the steps in the table. Table 2-14

No. Instructions Note 1. Start the SIMATIC manager. 2. Open the extracted STEP 7 project “315_OPC” in the

SIMATIC Manager.

3. Open the context menu of the PG/PC object in the STEP 7 project via the right mouse button.

4. Select: PLC Assign PG/PC. 5. If your PG/PC has several Ethernet interfaces, you

select the correct interface in the Properties-PG/PC dialog and press the Assign button and then close the dialog with OK.

Deleting the Micro Memory Card CPU 315-2DP Before loading a new configuration onto the CPU it is recommended to delete the MMC of the CPU with the PG beforehand. To do this, please follow the steps below.

Table 2-15

No. Instructions Note 1. Remove the MMC from the CPU. The power supply

must be off! Please refer to /4/.

2. Plug the MMC into the field PG See /5/3. In the SIMATIC Manager you select the menu:

File S7-Memory Card Delete...

4. Confirm the query with Yes.

Page 24: 21402169 OPC XML-DA Demonstration DOKU v10 e

Setup and Operation of the Application

Installation and Commissioning

Data Exchange via XML-DA Entry-ID: 21402169

No. Instructions Note 5. As soon as the message that deleting has been

completed appears, you can plug the MMC back into the CPU.

6. Switch on the power supply of the S7 station. A memory reset of the CPU is automatically performed.

Assigning an IP address to the CP 343-1 In order to access the S7 station via Industrial Ethernet, an IP address must first be assigned to the Ethernet-CP (CP 343-1). This is performed via the SIMATIC Manager. To do this, please follow the steps below.

Table 2-16

V1.0 26.04.05 24/34

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2140

2169

_OP

C_X

ML-

DA

_Dem

onst

ratio

n_D

OK

U_V

10_e

.doc

No. Instructions Note 1. In the SIMATIC Manager you select the menu:

PLC Assign Ethernet Address...

Note Please ensure, that the mode switch of the CP 343-1 has been set to "RUN".

2. In order to search the CP in the network, you click the

Browse... button. The search for Ethernet stations is started automatically and may take some time.

3. From the list you select the entry with the device type S7-300 CP and confirm your selection with OK.

4. In the Set IP configuration section you select

IP address and subnet mask to be assigned. In this application, the following values have been selected: • IP address: 10.0.0.3 • Sub-network mask 255.255.255.0

Note If you select different values, you must also adjust the STEP 7 project accordingly.

5. Press Assign IP Configuration in order to transfer the IP address to the CP.

This enables accessing the entire S7 station with STEP 7 via the CP.

Page 25: 21402169 OPC XML-DA Demonstration DOKU v10 e

Setup and Operation of the Application

Installation and Commissioning

Data Exchange via XML-DA Entry-ID: 21402169

No. Instructions Note 6. Close the dialog with the Close button.

Load the configuration into head-end and S7 station For loading configuration and S7 program to the head-end and the S7 station, please perform the steps of the following table.

Table 2-17

V1.0 26.04.05 25/34

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2140

2169

_OP

C_X

ML-

DA

_Dem

onst

ratio

n_D

OK

U_V

10_e

.doc

No. Instructions Note 1. Open the extracted STEP 7 project “315_OPC” in the

SIMATIC Manager.

2. Start the “NetPro” tool with the button.

3. If you do not want to take on the data of the example project (e.g. station name or subnet masks) you can now change them. However, it is recommended to keep the example configuration.

4. Compile and save the entire configuration with the button. Select the selection box Compile and check everything.

If an error should occur here, it must be removed prior to loading.

5. Select head-end and S7 station, and load the

configuration with the button. Confirm the queries with OK.

6. Close the "NetPro" tool. 7. In the SIMATIC Manager you select the block folder of

the S7-300 station and load the blocks to the controller

by pressing the button.

8. Set the CPU 315-2DP to RUN mode.

Note For testing the OPC connection to the controller, the OPC Scout can be used (included in the delivery scope of the SIMATIC NET PC software).

Page 26: 21402169 OPC XML-DA Demonstration DOKU v10 e

Setup and Operation of the Application

Operating the Application

Data Exchange via XML-DA Entry-ID: 21402169

3 Operating the Application

Here you will find information on … how to operated all function of this application.

Description of the example process The S7 control program simulates a mixing process. Liquids are hereby fed into a tank via two inlet valves. As soon as the tank has been fill up, the liquid is mixed and heated up. After the setpoint temperature has been reached, the liquid is cooled down again and then drained via an outlet valve.

The process variables for the data exchange with the OPC server are saved to three different blocks.

V1.0 26.04.05 26/34

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2140

2169

_OP

C_X

ML-

DA

_Dem

onst

ratio

n_D

OK

U_V

10_e

.doc

3.1 Windows application

User interface The following figure shows the user interface of Window application. The elements are described below. Figure 3-1

Page 27: 21402169 OPC XML-DA Demonstration DOKU v10 e

Setup and Operation of the Application

Operating the Application

Data Exchange via XML-DA Entry-ID: 21402169

V1.0 26.04.05 27/34

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2140

2169

_OP

C_X

ML-

DA

_Dem

onst

ratio

n_D

OK

U_V

10_e

.doc

Description of user interface The following table explains the individual elements of the user interface. Table 3-1

No. Description 1 Buttons for starting and terminating the visualization process. This

establishes the connection to and disconnects from the OPC server. 2 Area for entering and writing the setpoint values:

• T in: inlet temperature • T out: outlet temperature • T max: maximum heating temperature • Level 1: filling level for liquid 1 • Level 2: maximum filling level (liquid 1 + 2)

3 Display of process values (actual values): • Level: actual filling level • Temperature: actual temperature • System time: system time of the S7-CPU • Inlet valve 1: inlet valve for liquid 1 • Inlet valve 2: inlet valve for liquid 2 • Outlet valve: outlet valve of the tank • Heater: heating • Cooler: cooler • Mixer: mixer Button for direct reading of the process values: • Read values

4 Buttons for starting and terminating the mixing process. 5 Graphic display of the mixing process.

Note Please ensure that the user, under which you are currently logged on at the head-end or visualization station, has access to the XML-DA web service of the SIMATIC NET OPC server. See 2.5 Configuring the access protection

Page 28: 21402169 OPC XML-DA Demonstration DOKU v10 e

Setup and Operation of the Application

Operating the Application

Data Exchange via XML-DA Entry-ID: 21402169

Starting and configuring the visualization For starting the Windows application on the head-end or visualization station, please perform the steps in the table below.

Table 3-2

V1.0 26.04.05 28/34

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2140

2169

_OP

C_X

ML-

DA

_Dem

onst

ratio

n_D

OK

U_V

10_e

.doc

No. Instructions Note 1. Start the Windows application with:

Start A&D Service and Support OPC XML-DA Client OPC XML-DA Client

2. Open the Properties dialog via the menu:

Options Customize...

3. Depending on which PC you are running the

visualization application, check the field "URL of the OPC server". • Head-end:

"http://localhost/[virtual directory of the web service]/sopcweb.asmx"

• Visualization station: "http://[PC name of the head-end]/[virtual directory of the web service]/sopcweb.asmx"

4. Press Connection test button. If the message Connection successfully established appears, the connection to the web service was successfully established.

If the login box appears, you enter a user which has access to the XML-DA interface, e.g. "OPC client".

5. In the OPC items section you can adjust the OPC items to be displayed. You can search the address space of the OPC server for OPC items with the Browse... button.

For the demonstration of this example no adjustments need to be made to the OPC items.

6. Click on OK to confirm the settings. The settings are permanently saved in the "Options.xml" file.

Page 29: 21402169 OPC XML-DA Demonstration DOKU v10 e

Setup and Operation of the Application

Operating the Application

Data Exchange via XML-DA Entry-ID: 21402169

Operating the visualization The following table explains how to operate the Windows application and impact the simulated mixing process.

Table 3-3

V1.0 26.04.05 29/34

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2140

2169

_OP

C_X

ML-

DA

_Dem

onst

ratio

n_D

OK

U_V

10_e

.doc

No. Instructions Note 1. Start the Windows application with:

Start A&D Service and Support OPC XML-DA Client OPC XML-DA Client

2. For connecting with the OPC server and starting the

visualization press the button. If the login box appears, you enter a user which has access to the XML-DA interface.

3. When starting the visualization and S7 program for the first time, you must first start the simulated mixing process (the Stop process is red). Press the Start process button.

If the mixing process was started successfully, the Start process button turns green.

4. Enter any setpoint values into the input fields and press the Write setpoint values button.

5. Press the Read values button in order to read the process values directly from the controller.

The RX/TX diode of the CP indicates that the Read request goes directly to the controller.

Page 30: 21402169 OPC XML-DA Demonstration DOKU v10 e

Setup and Operation of the Application

Operating the Application

Data Exchange via XML-DA Entry-ID: 21402169

3.2 The ASP.NET application

User interface The following figure shows the user interface of ASP.NET application. The elements are described below. Figure 3-2

V1.0 26.04.05 30/34

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2140

2169

_OP

C_X

ML-

DA

_Dem

onst

ratio

n_D

OK

U_V

10_e

.doc

Description of user interface The following table explains the individual elements of the user interface. Table 3-4

No. Description

1. Buttons for starting and terminating the visualization process. This establishes the connection to or disconnects from the OPC server.

2. Area for entering and writing the setpoint values: • Tin: inlet temperature • Tout: outlet temperature • Tmax: maximum heating temperature • Level 1: filling level for liquid 1 • Level 2: maximum filling level (liquid 1 + 2)

3. Display of process values (actual values) • Level: actual filling level • Temperature: actual temperature • System time: system time of the S7-CPU • Inlet valve 1: inlet valve for liquid 1 • Inlet valve 2: inlet valve for liquid 2 • Outlet valve: outlet valve of the tank • Heater: heating • Coole: cooler • Mixer: mixer

4. Buttons for starting and terminating the mixing process.

Page 31: 21402169 OPC XML-DA Demonstration DOKU v10 e

Setup and Operation of the Application

Operating the Application

Data Exchange via XML-DA Entry-ID: 21402169

Note Please ensure, that the user under which you have just logged on at the head-end or the visualization station, is member of the "Users" group. See 2.5 Configuring the access protection

Start visualization locally (on the head-end) For starting the ASP.NET application on the head-end, please perform the steps in the table below.

Table 3-5

V1.0 26.04.05 31/34

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2140

2169

_OP

C_X

ML-

DA

_Dem

onst

ratio

n_D

OK

U_V

10_e

.doc

No. Instructions Note 1. Start the internet browser of the head-end (e.g.

Microsoft Internet Explorer or Mozilla Firefox)

2. Enter the URL of the ASP.NET application into the address bar of the browser: "http://localhost/OPCXMLDANetClient/mainform.aspx"

3. If a query appears after a user name and password, enter a user of the user group "Users". (e.g. the user "OPC-client" created at 2.5 Configuring the access protection).

4. Check URL of the web service of the OPC XML-DA

interface in the field URL. Here you should ensure that the specified virtual directory (here: "OPCSimaticNET), corresponds to the name assigned in 2.4 Configuration of the Internet Information Services.

Page 32: 21402169 OPC XML-DA Demonstration DOKU v10 e

Setup and Operation of the Application

Operating the Application

Data Exchange via XML-DA Entry-ID: 21402169

Starting the visualization on the visualization station For starting the ASP.NET application on the visualization station, please perform the steps in the table below.

Table 3-6

V1.0 26.04.05 32/34

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2140

2169

_OP

C_X

ML-

DA

_Dem

onst

ratio

n_D

OK

U_V

10_e

.doc

No. Instructions Note 1. Start the internet browser of the head-end (e.g.

Microsoft Internet Explorer or Mozilla Firefox)

2. Enter the URL of the ASP.NET application into the address bar of the browser: "http://head-end/OPCXMLDANetClient/mainform.aspx"

Note Should you have selected a different PC name for your head-end, you must use it in the URL (instead of "head-end").

3. If a query appears after a user name and password, enter a user of the user group "Users" in the head-end. (e.g. the user "OPC-client" created at 2.5 Configuring the access protection).

4. Check URL of the web service of the OPC XML-DA

interface in the field URL. Here you should ensure that the specified virtual directory (here: "OPCSimaticNET), corresponds to the name assigned in 2.4 Configuration of the Internet Information Services.

Page 33: 21402169 OPC XML-DA Demonstration DOKU v10 e

Setup and Operation of the Application

Operating the Application

Data Exchange via XML-DA Entry-ID: 21402169

V1.0 26.04.05 33/34

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2140

2169

_OP

C_X

ML-

DA

_Dem

onst

ratio

n_D

OK

U_V

10_e

.doc

Operating the visualization user interface Operation of the visualization user interface is the same all over, irrespective of where it was started. The following table shows you which operating options you have with this visualization user interface.

Table 3-7

No. Instructions Note 1. As soon as the visualization user interface was started

successfully in a web browser, you click the Connect button. This establishes a connection with the OPC server of the head-end, and an automatic, cyclic refreshing of the values starts.

Individually it may happen, that the actual values are only displayed at the second refreshing of the page.

2. When starting the visualization and S7 program for the first time, you must first start the simulated mixing process (the Stop process is red). Press the Start process button.

If the mixing process was started successfully, the Start process button turns green.

3. Enter any setpoint values into the input fields and press the Write setpoints button.

During the page refresh a write job for setpoint values can be triggered.

4. Status information and errors are displayed at the bottom edge of the page (e.g. limits of setpoint values exceeded or communication problems).

Adjusting the configuration data If you wish to change the configuration data of the visualization application, (e.g. URL of the OPC XML-DA Web service or name of the OPC item), please follow the instructions of the following table.

Table 3-8

No. Instructions Note 1. Open the Windows Explorer and change to the

following directory: "C:\Inetpub\wwwroot\OPCXMLDANetClient\"

2. Open the contained "Options.xml" file in a text editor (e.g. notepad.exe).

3. Process the desired values and save the file. 4. Restart the visualization application. The changed

values are accepted.

Page 34: 21402169 OPC XML-DA Demonstration DOKU v10 e

Appendix and List of Further Literature

Literature

Data Exchange via XML-DA Entry-ID: 21402169

V1.0 26.04.05 34/34

Cop

yrig

ht ©

Sie

men

s A

G 2

005

All

right

s re

serv

ed

2140

2169

_OP

C_X

ML-

DA

_Dem

onst

ratio

n_D

OK

U_V

10_e

.doc

Appendix and List of Further Literature

4 Literature

4.1 Bibliographic References

This list is by no means exhaustive and only gives a selection of appropriate sources. You can find most manuals, when you have installed the corresponding product, under:

Start Simatic Documentation English Table 4-1

Topic Title /1/ STEP 7 Automatisieren mit STEP 7 in AWL und SCL

(Automating with STEP7 in STL and SCL) Hans Berger published by: Publicis MCD Verlag ISBN 3-89578-113-4

/2/ SIMATIC NET, Industrial communication

SIMATIC NET, Industrielle Kommunikation mit PG/PC Band 1 – Grundlagen, Systemhandbuch (on SIMATIC NET CD)

/3/ SIMATIC NET, Advanced PC Configuration

SIMATIC NET, PC-Stationen in Betrieb nehmen – Anleitung und Schnelleinstieg (available on SIMATIC NET CD or in Product Support at entry ID: 13542666.)

/4/ Setting up S7-300 S7-300, CPU 31xC und CPU 31x: Aufbauen Betriebsanleitung (available in Product Support at entry ID: 13008499.)

/5/ Field-PG manual SIMATIC Field PG P4, Handbuch (available in Product Support at entry ID: 14957220.)

4.2 Internet links

This list is by no means exhaustive and only gives a selection of appropriate sources. Table 4-2

Topic Title \1\ Reference to the

documentation http://support.automation.siemens.com/WW/view/en/21402169

\2\ Siemens A&D Customer Support

http://support.automation.siemens.com