Application for Human Machine Interface - Siemens · PDF fileApplication for Human Machine...

43
Application for Human Machine Interface PC-based Automation with SIMATIC WinAC Plant Visualization with Visual Basic .NET via the OPC XML-DA Interface

Transcript of Application for Human Machine Interface - Siemens · PDF fileApplication for Human Machine...

Application for Human Machine Interface

PC-based Automation with SIMATIC WinAC

Plant Visualization with Visual Basic .NET via the OPC XML-DA Interface

Preamble

Visualizing with Visual Basic .NET and OPC XML-DA

V 1.0 28.07.2004 2/43

Cop

yrig

ht

Sie

men

s A

G 2

004

All

right

s re

serv

ed

2100

4994

_Win

AC

_VO

_DO

KU

_v10

_e.d

oc

2100

4994

Preamble

Foreword The SIMATIC Windows Automation Center (WinAC) offers you an open, versatile and robust basis to realize your automation solution on a PC-based basis.

Its full compatibility with SIMATIC S7 combined with interfaces to the (open) PC world enables you to combine your classic automation tasks with the options of the PC world. The use of SIMATIC industrial PCs provides a powerful and robust platform for your automation solution with WinAC.

Eight examples were developed to provide a quick lead-in to PC-based automation with SIMATIC WinAC. They consist of sample code and an extensive documentation. Using these examples the user can familiarize with the individual topics on a task-specific basis.

Classification of the examples The automation tasks described in the examples are related to typical tasks occurring in automation technology:

• Controlling

• Communication

• Visualization

• Technology

Preamble

Visualizing with Visual Basic .NET and OPC XML-DA

V 1.0 28.07.2004 3/43

Cop

yrig

ht

Sie

men

s A

G 2

004

All

right

s re

serv

ed

2100

4994

_Win

AC

_VO

_DO

KU

_v10

_e.d

oc

2100

4994

The individual examples To enable optimum use of PC-based automation we have developed one example from the “classic” PLC world and one from the “open” PC world for each of the four typical automation tasks (controlling, communication, visualization, technology).

All eight examples with their allocation to the respective automation tasks are shown in the figure below. This example which deals with “Visualizing with Visual Basic .NET and OPC XML“ is displayed with a red margin. Fig. 1-1

Preamble

Visualizing with Visual Basic .NET and OPC XML-DA

V 1.0 28.07.2004 4/43

Cop

yrig

ht

Sie

men

s A

G 2

004

All

right

s re

serv

ed

2100

4994

_Win

AC

_VO

_DO

KU

_v10

_e.d

oc

2100

4994

Basis of the examples All examples are based on a virtual “mixing process”. Using this “mixing process” the different tasks and automation components of the PC-based automation product range are applied.

System overview The following figure shows the system overview of the “mixing process”. The red margin indicates the components described in this example. Fig. 1-2

Warranty, Liability and Support

Visualizing with Visual Basic .NET and OPC XML-DA

V 1.0 28.07.2004 5/43

Cop

yrig

ht

Sie

men

s A

G 2

004

All

right

s re

serv

ed

2100

4994

_Win

AC

_VO

_DO

KU

_v10

_e.d

oc

2100

4994

Warranty, Liability and Support

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 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 in ensuring that the described products are correctly used.

These Application Examples do not relieve you of the responsibility in safely and professionally using, installing, operating and servicing equipment. When using these Application Examples, you recognize that Siemens cannot be made liable for any damage/claims beyond the liability clause described above. 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.

Copyright© 2004 Siemens A&D. It is not permissible to transfer or copy these Application Examples 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:

[email protected]

Table of Contents

Visualizing with Visual Basic .NET and OPC XML-DA

V 1.0 28.07.2004 6/43

Cop

yrig

ht

Sie

men

s A

G 2

004

All

right

s re

serv

ed

2100

4994

_Win

AC

_VO

_DO

KU

_v10

_e.d

oc

2100

4994

Table of Contents 1 Task.................................................................................................................. 7

2 Configuration of the Automation Solution ................................................... 8 2.1 Display of the components involved ................................................................. 8 2.2 Required components....................................................................................... 9 2.3 Performance data ........................................................................................... 10

3 Function Mechanisms and Program Structures........................................ 11 3.1 WinAC RTX basics ......................................................................................... 11 3.2 Web services .................................................................................................. 14 3.3 Internet Information Services (IIS) .................................................................. 16 3.4 The OPC XML-DA interface of SIMATIC NET................................................ 17 3.5 Program structure of the example .................................................................. 21 3.6 Program description........................................................................................ 23

4 Installation of Hardware and Software ....................................................... 27 4.1 Preliminary installation.................................................................................... 28 4.2 Hardware configuration................................................................................... 29 4.3 Installation of the WinAC RTX software.......................................................... 31 4.4 Installation and setup of the Internet Information Services............................. 31 4.5 Installation of the visualization program.......................................................... 34 4.6 Using WinAC RTX .......................................................................................... 35 4.7 Configuration of the automation stations ........................................................ 36

5 Operator Control and Monitoring................................................................ 40

6 Bibliography.................................................................................................. 43

Task

Visualizing with Visual Basic .NET and OPC XML

V 1.0 28.07.2004 7/43

Cop

yrig

ht

Sie

men

s A

G 2

004

All

right

s re

serv

ed

2100

4994

_Win

AC

_VO

_DO

KU

_v10

_e.d

oc

2100

4994

1 Task

Technological task / overview The following example shows the realization of a visualization with Visual Basic .NET in a simple way. In this process the data are exchanged via the XML interface of OPC (OPC XML-DA).

The task is to visualize and control a mixing process in WinAC RTX in a way that is as simple as possible. The visualization can be used either locally on the WinAC station or remotely on a PC.

Basic figure of the automation solution The following figure shows the basic interaction of the automation components described in this document. Fig. 1-1

Solution requirements The solution (visualization application) has to meet the following requirements:

• Reading and visualizing process values from WinAC RTX

• Writing setpoints into the WinAC controller

• Same visualization program can be used locally and remotely

• Functionality can be extended to large quantity frameworks.

Quantity framework of the example A relatively small quantity framework was selected for the visualization application. However, the functions used for the data exchange can easily be transferred to a large quantity framework. Table 1-1

Function Data amount Cyclic, asynchronous reading • 2 data words (DBW)

• 6 data bits (DBX) User-controlled , synchronous writing • 4 data words (DBW)

• 1 data bit (DBX)

Configuration of the Automation Solution

Visualizing with Visual Basic .NET and OPC XML

V 1.0 28.07.2004 8/43

Cop

yrig

ht

Sie

men

s A

G 2

004

All

right

s re

serv

ed

2100

4994

_Win

AC

_VO

_DO

KU

_v10

_e.d

oc

2100

4994

Customer benefit • Creation of interfaces and functions of any complexity which can be

adapted to a special case. • Transferability of the shown functionality to a customer-specific solution. • Usage of the open, platform-independent OPC XML-DA standard. • Easy and cost-effective distributability of the visualization application.

2 Configuration of the Automation Solution

This chapter shows the hardware configuration of the automation solution. The required hardware and software components are listed in tabular form in chapter 2.2 Required components.

2.1 Display of the components involved

The following overview shows the hardware configuration of the example application and the respective standard and user software components. Fig. 2-1

Configuration of the Automation Solution

Visualizing with Visual Basic .NET and OPC XML

V 1.0 28.07.2004 9/43

Cop

yrig

ht

Sie

men

s A

G 2

004

All

right

s re

serv

ed

2100

4994

_Win

AC

_VO

_DO

KU

_v10

_e.d

oc

2100

4994

2.2 Required components

The hardware and software components for the respective stations are listed in the tables below.

Hardware components of the SIMATIC PC station (WinAC station) The listed PROFIBUS-CP CP 5613 A2 is only required for the configuration of the PC station from the PG. It is possible not to use this CP if the WinAC station is configured via a locally installed STEP 7.

Instead of the rack PC listed below it is also possible to use a different industrial PC (e.g. panel PC). It is required that this PC features an Ethernet and an MPI or PROFIBUS interface.

You can order the components listed in the tables directly in the Siemens A&D Mall at https://mall.automation.siemens.com.

The FAQs are available on the A&D Support home page at http://support.automation.siemens.com (enter the FAQ ID in the search field). Table 2-1

Component No. MLFB/Order number Note Industrial PC SIMATIC Rack PC IL 40 S

1 6AG4011-0CA21-0JX0 Configurator: See FAQ ID 17128155

Communications processor CP 5613 A2 for PROFIBUS, PCI card

1 6GK1 561-3AA01

Hardware components for the PG/PC Table 2-2

Component No. MLFB/Order number Note Programming device Power PG

1 6ES7751-0BA21-0LB2 Configurator: See FAQ ID 17128155; CP 5611 integrated

Software components of the SIMATIC PC station (WinAC station) Table 2-3

Component No. MLFB/Order number Note SIMATIC WinAC RTX V4.1 1 6ES7671-0RC04-0YA0 SIMATIC NET CD is

included in the WinAC package.

Internet Information Services (IIS)

1 Part of the Windows operating system

.NET Framework V1.1 1 Download at www.microsoft.com

Configuration of the Automation Solution

Visualizing with Visual Basic .NET and OPC XML

V 1.0 28.07.2004 10/43

Cop

yrig

ht

Sie

men

s A

G 2

004

All

right

s re

serv

ed

2100

4994

_Win

AC

_VO

_DO

KU

_v10

_e.d

oc

2100

4994

Software components of the PG/PC Table 2-4

Component No. MLFB/Order number Note STEP 7 V5.3 1 6ES7 810-4CC07-0YA5 .NET Framework V1.1 1 Optional, download

at www.microsoft.com

Microsoft Visual Studio .NET 2003 Professional

1 Optional, can be ordered via your administrator or at www.microsoft.com

Example project This application consists of the following components.

For further information on the installation of hardware and software please refer to chapter 4 Installation of Hardware and Software. Table 2-5

Component Note 21004994_WinAC_VO_CODE_v10.zip This zip file contains the STEP 7

project (incl hardware configuration for both stations, connection configuration, user programs in STL source code) and the executable files for the visualization as well as the Visual Basic .NET project.

21004994_WinAC_VO_DOKU_v10_e.pdf This document

2.3 Performance data

Due to the use of most different components in this example it is not possible to list specific performance data. For specifications on WinAC RTX please refer to Example 1/8 “Automating with WinAC RTX”.

The following information can be provided for the SIMATIC NET OPC server:

• The “classic” data access interface (based on COM) is 10%-25% quicker than the XML interface due to its technology. However, the total speed also depends on the S7 communication between OPC server und S7 station.

• Via XML interface up to 10.000 OPC items can be read or written (see FAQ ID 15227599).

Function Mechanisms and Program Structures

Visualizing with Visual Basic .NET and OPC XML

V 1.0 28.07.2004 11/43

Cop

yrig

ht

Sie

men

s A

G 2

004

All

right

s re

serv

ed

2100

4994

_Win

AC

_VO

_DO

KU

_v10

_e.d

oc

2100

4994

3 Function Mechanisms and Program Structures

This chapter briefly explains the basics of WinAC RTX. Furthermore, the terms web service, Internet information service and OPC XML-DA interface are explained.

In addition the structure of the Visual Basic .NET example program is shown and important code sections are described.

Topics

Chapter Title Page 3.1 WinAC RTX basics 10 3.2 Web services 13 3.3 Internet Information Services (IIS) 15 3.4 The OPC XML-DA interface of SIMATIC NET 16 3.5 Program structure of the example 20 3.6 Program description 22

3.1 WinAC RTX basics

What is WinAC RTX? The Windows Automation Center with real-time extension (WinAC RTX) offers the functionality of a programmable logic controller (PLC) in a PC-based environment, e.g. Windows XP. The controller performing the control tasks in WinAC RTX is the Windows Logic Controller (WinLC).

With regard to its functions WinAC RTX can be compared to an S7-400.

Windows Logic Controller RTX (WinLC RTX) The Windows Logic Controller with real-time extension (WinLC RTX) is the key element of WinAC RTX. It executes the S7 program on the PC and controls the connected distributed I/O. WinLC RTX is fully code compatible with other SIMATIC S7 controllers. This ensures that existing S7 programs of an S7-300 or S7-400 controller are also executable on WinLC.

Function Mechanisms and Program Structures

Visualizing with Visual Basic .NET and OPC XML

V 1.0 28.07.2004 12/43

Cop

yrig

ht

Sie

men

s A

G 2

004

All

right

s re

serv

ed

2100

4994

_Win

AC

_VO

_DO

KU

_v10

_e.d

oc

2100

4994

RTX real-time extension WinLC RTX uses the real-time extensions (RTX) for Windows by VenturCom. These extensions enable the following functions:

• Deterministic operation with predictable response times.

• Isochronous mode (equidistance, constant bus cycle time)

• In case of a Windows system failure (“blue screen”) the process control of WinLC keeps running independent of the operating system and can thus be properly shut down (via interrupt OBs).

Software architecture The figure below shows the configuration of a WinAC RTX system. It illustrates the separation between the Windows operating system and the RTX real-time system by VenturCom on which WinAC RTX runs.

Process interface for WinAC RTX PROFIBUS DP forms the process interface of WinAC RTX. PROFIBUS communications processors (e.g. PCI card CP 5613 A2, in the future also CP 5611) are plugged into the PC and configured as interface modules (IF modules) in HW Config (same as for S7-400).

The CPs configured as IF modules are addressed via real-time hardware drivers. This enables the isochronous mode (equidistance of the bus cycles) for the connected PROFIBUS-DP master systems.

Up to four CPs can be configured as IF modules for WinAC RTX.

Function Mechanisms and Program Structures

Visualizing with Visual Basic .NET and OPC XML

V 1.0 28.07.2004 13/43

Cop

yrig

ht

Sie

men

s A

G 2

004

All

right

s re

serv

ed

2100

4994

_Win

AC

_VO

_DO

KU

_v10

_e.d

oc

2100

4994

System communication with WinAC RTX The system communication with WinAC RTX is performed via CPs which are plugged into the PC. These CPs are configured via HW Config of the SIMATIC PC station.

S7 communication is used for the system communication of SIMATIC S7 stations. To use S7 communication it is required to install the SIMATIC NET PC software on the WinAC PC (the delivery of WinAC includes the latest SIMATIC NET CD).

The CPs which can be used for the system communication with PROFIBUS or Industrial Ethernet are listed in the following table. Table 3-1

Network Applicable CPs

PROFIBUS CP 5611, CP 5613, CP5613 A2, CP 5613 FO, CP 5614, CP 5614 FO

Industrial Ethernet CP 1511, CP 1512, CP 1612, CP 1613, each further PC-compatible Ethernet card

PG routing with WinAC RTX WinAC RTX supports PG routing. This ensures that STEP 7 can reach S7 stations in other subnets via the CPs of a WinAC PC station.

The WinLC RTX control panel The user interface of the WinLC RTX controller resembles the appearance of a classic S7-400 controller. It features the same status LEDs as well as buttons to change the mode.

The control panel can be shut down during operating WinLC RTX, the controller keeps running. To restart the control panel double-click in the task bar.

The operation of WinLC RTX is explained in chapter 4.6 Using WinAC RTX. Fig. 3-1

Function Mechanisms and Program Structures

Visualizing with Visual Basic .NET and OPC XML

V 1.0 28.07.2004 14/43

Cop

yrig

ht

Sie

men

s A

G 2

004

All

right

s re

serv

ed

2100

4994

_Win

AC

_VO

_DO

KU

_v10

_e.d

oc

2100

4994

3.2 Web services

The following chapter briefly explains the basics of web services, WSDL and SOAP.

What are web services? Web services are based on open standards (HTTP, XML, SOAP) and enable the connection of software components. Due to the standardization this connection is independent of programming languages, platforms or operating systems (unlike COM by Microsoft).

This enables software components (clients) to call functions of other software components (servers) and thus use their functionality. The software components can be on the same PC or connected via Internet/Intranet. This makes no difference for the use of the web service by the client (apart from the different runtime of the data between client and server).

The names of web services end with .asmx (see “Example for a web service”).

Service description with WSDL For the development of a client which is to use web services the developer first has to know which functionality a web service makes available. For this purpose the WSDL (Webservices Description Language) can be queried for each web service.

The functions (methods and their parameters) of the web service are defined in WSDL which can be called by the client.

The Microsoft Visual Studio .NET development environment can access web services and automatically reads the WSDL information. The functions of the web service are thus made available to the user (see 3.4 The OPC XML-DA interface of SIMATIC NET).

SOAP The data between a client and the web service are exchanged via SOAP. The data transfer with SOAP takes place exclusively via the Internet HTTP channel (HTTP = HyperText Transfer Protocol) which can easily be administrated and protected with a firewall.

SOAP is a platform-independent protocol which is supported by all common operating systems. SOAP messages are text files in XML format which are exchanged between client and server. The communication via SOAP is always divided into two steps:

Function Mechanisms and Program Structures

Visualizing with Visual Basic .NET and OPC XML

V 1.0 28.07.2004 15/43

Cop

yrig

ht

Sie

men

s A

G 2

004

All

right

s re

serv

ed

2100

4994

_Win

AC

_VO

_DO

KU

_v10

_e.d

oc

2100

4994

Table 5-2

No. Step Description 1 SOAP request The client sends a request to execute a specific function

(e.g. reading a PowerTag) to the server. 2 SOAP response After executing the function the server sends the result

(e.g. value of the PowerTag) back to the client.

Communication via SOAP The following figure graphically shows the sequence of a SOAP communication. Figure 5-2

Example for a web service The OPC Foundation (an interest club of well-known manufacturers for the further development of the OPC standard) makes available a web service for the access to an example OPC server.

By clicking the following link you call the web service in a web browser: http://opcfoundation.org/XmlDaSampleServer/Service.asmx. The displayed web site is not the content of the ASMX file; it is automatically generated by the web service and lists the available functions of the web service.

By clicking the displayed functions the corresponding SOAP messages are displayed. From these messages it can be seen which parameters are transferred to the functions and which return values these functions provide.

The corresponding WSDL file is displayed by clicking Service Description.

Function Mechanisms and Program Structures

Visualizing with Visual Basic .NET and OPC XML

V 1.0 28.07.2004 16/43

Cop

yrig

ht

Sie

men

s A

G 2

004

All

right

s re

serv

ed

2100

4994

_Win

AC

_VO

_DO

KU

_v10

_e.d

oc

2100

4994

3.3 Internet Information Services (IIS)

Function of the Internet Information Services The Internet Information Services (IIS) are the services integrated in the operating system to publish information in the LAN, on the Intranet or Internet. With these services it is relatively easy to set up and administrate a web server.

Components of the Internet Information Services Depending on the installation the IIS make the following services available. When installing the Internet Information Services you should only install the services you actually want to use (see chapter 4.4 Installation and setup of the Internet Information Services). Table 3-2

Service Description WWW server Web server, enables access to web sites or web services via

HTTP. FTP server FTP – File Transfer Protocol, enables the creation of FTP

sites to transfer files. SMTP service Mail server service for the transfer of e-mails. FrontPage 2000 extensions

Enables the creation and the management of web sites with MS FrontPage.

Snap-in IIS IIS management interface for the Microsoft Management Console.

Access to a web server The access to the web server of a PC via the Intranet or the Internet takes place via the URL of the PC. This URL is as follows:

• http://[computer name]/

or

• http://[IP address of the PC]/

Function Mechanisms and Program Structures

Visualizing with Visual Basic .NET and OPC XML

V 1.0 28.07.2004 17/43

Cop

yrig

ht

Sie

men

s A

G 2

004

All

right

s re

serv

ed

2100

4994

_Win

AC

_VO

_DO

KU

_v10

_e.d

oc

2100

4994

Security aspects of the web server The installation of an IIS web server (with its default settings) on a PC within an Intranet or an isolated Ethernet network is relatively unproblematic. Intranets are usually protected against unauthorized access from the Internet by their administrators.

If the web server is to be configured in such a way that it can also be accessed from the Internet more extensive security settings are necessary.

This example, however, is only used to practically display the access procedure to an OPC server via the OPC XML-DA interface. Thus the security aspects of the access to a web service are not explained in detail. For detailed information please refer to the respective specialist literature.

3.4 The OPC XML-DA interface of SIMATIC NET

What is OPC XML-DA? OPC XML-DA (Data Access to an OPC server via XML) is, like the “conventional” OPC Data Access, an interface for the access to variables of an OPC server. But it is completely platform-independent (in contrast to the COM technology) and it is also supported by the Visual Studio .NET development environment.

The data access with OPC XML-DA has a functional scope which follows OPC Data Access; however, only simple write and read services are available. Change-controlled return messages on data changes as in the DCOM OPC DA interfaces are not provided for OPC XML due to the loose Internet connection.

OPC XML-DA web service in Visual Studio .NET If you develop applications with Microsoft Visual Studio .NET you can integrate a web service directly into the development environment. To do this a web reference is added to the project. Visual Studio .NET automatically requests WSDL , interprets it and thus makes the functions of the web service available to the developer.

Integrating the OPC XML-DA web service into Visual Studio .NET The example listed in the following table explains to you how to insert the OPC XML-DA web service into a Visual Studio .NET project . It requires the correct installation of the Internet Information Services (see 4.4 Installation and setup of the Internet Information Services). Table 3-3

No. Instruction 1 Start your Visual Studio .NET development environment. 2 Open an existing project (e.g. “OPC XML-DA WebClient.sln” which is a part

of this example). 3 In the Project Explorer select “References” below the project.

Function Mechanisms and Program Structures

Visualizing with Visual Basic .NET and OPC XML

V 1.0 28.07.2004 18/43

Cop

yrig

ht

Sie

men

s A

G 2

004

All

right

s re

serv

ed

2100

4994

_Win

AC

_VO

_DO

KU

_v10

_e.d

oc

2100

4994

No. Instruction 4 From the context menu (using the right

mouse button) select “Add web reference”.

5 In the “Add web reference” dialog box enter the address of the web service in

the “URL” box. The address is as follows: http://[computer name]/[name of the virtual directory]/sopcweb.asmx Note If the web service is installed on the same PC as the development environment the computer name “localhost” is used.

6 Click the “Goto” button. The default web site of the web service is displayed (see screenshot).

7 Below “Web reference name” enter a user-defined name for the reference

and click “add reference”.

Function Mechanisms and Program Structures

Visualizing with Visual Basic .NET and OPC XML

V 1.0 28.07.2004 19/43

Cop

yrig

ht

Sie

men

s A

G 2

004

All

right

s re

serv

ed

2100

4994

_Win

AC

_VO

_DO

KU

_v10

_e.d

oc

2100

4994

Display of the functions of the OPC XML-DA web service After inserting the reference to the web service into the project Visual Studio .NET interprets the WSDL information of the web service. The instructions listed in the table below show you how to display these definitions in the object browser. Table 3-4

No. Instruction 1 Open the object browser in Visual Studio.NET by pressing “F2”. 2 In the left tree change to:

[Project name] [Project name space].[Web reference name] “OPCXML_DataAccess”

The available functions of the web service and their parameters are displayed in the right window.

Synchronous and asynchronous methods of the OPC XML-DA web service The methods of a web service are always asynchronous. That means that the client sends a request (SOAP request) to process a method to the web service. After completing the processing the web service sends the result back to the client (SOAP response). The time when the web service sends back the result is undetermined (thus asynchronous).

Function Mechanisms and Program Structures

Visualizing with Visual Basic .NET and OPC XML

V 1.0 28.07.2004 20/43

Cop

yrig

ht

Sie

men

s A

G 2

004

All

right

s re

serv

ed

2100

4994

_Win

AC

_VO

_DO

KU

_v10

_e.d

oc

2100

4994

If the web service does not respond to a request within a defined time (timeout), an error is returned by the called function. The timeout time can be defined by the user.

The methods of the OPC XML-DA web service can be called asynchronously as well as synchronously (request and response are combined in one call).

Asynchronous methods The method names for sending a request begin with “Begin” (e.g. “BeginRead()”). The name of the function to be called is transferred to the “callback” parameter after the web service has processed the request. After sending the request the client can continue with the program execution.

If the web service has completed the processing of the request the “callback” function is called in the client. The result of the web service is polled via an end method, e.g. “EndRead()”. See also chapter 3.6 Program description. An explanation of the subscription is provided later in this chapter.

Synchronous methods These methods consist only of the method call (e.g. Read()). After the method was started the program execution remains active for the moment. It is continued when the request has been processed by the web service and when the web service has transferred the result to the client.

Methods used The methods of the OPC XML-DA web service used in this example are listed in the following table. For a detailed description of these methods please refer to manual /4/. Table 3-5

Method Description GetStatus Polling of the general status and manufacturer-specific

information (version, product name). Subscribe, SubscriptionPolledRefresh, SubscriptionCancel

Subscriptions are set up at the web service with Subscribe. The PowerTags contained in the subscription are monitored by the OPC server. When the SubscriptionPolledRefresh function is called the OPC server returns the values of the variables which have changed since the last polling. A subscription is canceled with SubscriptionCancel. The polling of subscriptions is particularly suitable for the cyclic reading of a large number of process values since the bus load is the lowest.

Read Reading the value of one or several variables. This function is suitable for the single reading of process values and not for the cyclic monitoring of values.

Write Writing the value of one or several variables.

Function Mechanisms and Program Structures

Visualizing with Visual Basic .NET and OPC XML

V 1.0 28.07.2004 21/43

Cop

yrig

ht

Sie

men

s A

G 2

004

All

right

s re

serv

ed

2100

4994

_Win

AC

_VO

_DO

KU

_v10

_e.d

oc

2100

4994

3.5 Program structure of the example This example shows in a simple way how the OPC XML-DA web service is accessed with a Visual Basic .NET program.

Structural model The following graphic illustrates the processes realized in this example. Fig. 3-2

Function Mechanisms and Program Structures

Visualizing with Visual Basic .NET and OPC XML

V 1.0 28.07.2004 22/43

Cop

yrig

ht

Sie

men

s A

G 2

004

All

right

s re

serv

ed

2100

4994

_Win

AC

_VO

_DO

KU

_v10

_e.d

oc

2100

4994

Call structure The program flow in the visualization program is described in the following table.

Table 3-6

Program flow chart Explanation

The required Visual Basic variables are initialized after starting the program. First the user sets the options of the visualization: • Address (URL) of the web service • Update cycle time • Update mode The user starts the connection buildup to the OPC server. The visualization performs the following steps: 1. Checking availability of the web service and

establishing connection. 2. Checking status of the OPC server. 3. Setting up the subscription at the OPC server. 4. Reading setpoints from the controller. 5. Starting timer for the cyclic reading.

After successful connection buildup to the OPC server the cyclic asynchronous reading of the variables starts. Depending on the selected option this is done in two ways: • Cyclic polling of the subscription. Reporting of

variables which have changed their values (also for large quantity frameworks!).

• Cyclic reading of all variables (high communication load for large quantity frameworks!).

The read values are reported by the OPC server and the visualization program calls the corresponding CallBack functions. The user has the option of writing setpoints into WinAC RTX at any time. The setpoints are synchronously written into the controller and subsequently read back.

When terminating the visualization application the following steps are performed: 6. The subscription is logged off. 7. The timer for the cyclic reading is stopped. It is not necessary to disconnect the connection to the OPC server.

Function Mechanisms and Program Structures

Visualizing with Visual Basic .NET and OPC XML

V 1.0 28.07.2004 23/43

Cop

yrig

ht

Sie

men

s A

G 2

004

All

right

s re

serv

ed

2100

4994

_Win

AC

_VO

_DO

KU

_v10

_e.d

oc

2100

4994

3.6 Program description

The basic code sections of the visualization program are described in this chapter. You only see the essential code lines. For the complete code please refer to the corresponding Visual Basic .NET project. A detailed description of the functions and parameters is available in /4/ SIMATIC NET manual.

Connecting to OPC server Fig. 3-3

Explanations on the code Table 3-7

No. Description 1 Declaration of the object for the access to the web service of the OPC server. 2 Checking the availability of the web service. If the server is not available an exception is

thrown and the connecting process is canceled. 3 Transfer of the address of the web service of the OPC server. 4 Checking the status of the OPC server. If the server is available it can be accessed

immediately, an explicit “connect” command is not required.

Function Mechanisms and Program Structures

Visualizing with Visual Basic .NET and OPC XML

V 1.0 28.07.2004 24/43

Cop

yrig

ht

Sie

men

s A

G 2

004

All

right

s re

serv

ed

2100

4994

_Win

AC

_VO

_DO

KU

_v10

_e.d

oc

2100

4994

Creating item lists for reading and writing variables The following code section shows the declaration and the initialization of two variables of a WriteRequestItemList (list with variables which is transferred to the write function).

Fig. 3-4

Explanations on the code Table 3-8

No. Description 1 Item lists are used to read and write variables with OPC XML-DA. Depending on the

executed function different item lists are used, e.g. WriteRequestItemList, ReadRequestItemList, SubscribeRequestItemList, etc. These item lists contain items specifying the individual variables. Different properties such as variable name, value, time stamp, quality, ... are stored in the items. An item list can contain one or several items.

2 Determining the number of items in the item list (0 based, thus 2 items). 3 Assignment of symbolic variable names. This name is the name of the OPC item in the

OPC server.

Note For the Visual Basic code for reading and writing OPC variables please refer directly to the Visual Basic .NET project (in the function “ConnectOPC()” and the sub “cmdSetNiveauClick()”).

Function Mechanisms and Program Structures

Visualizing with Visual Basic .NET and OPC XML

V 1.0 28.07.2004 25/43

Cop

yrig

ht

Sie

men

s A

G 2

004

All

right

s re

serv

ed

2100

4994

_Win

AC

_VO

_DO

KU

_v10

_e.d

oc

2100

4994

Setting up a subscription In the Visual Basic code below a subscription “sub1” is set up at the OPC server. How the subscription is polled is shown on the next page.

Fig. 3-5

Explanations on the code Table 3-9

No. Description 1 Declaration of the object “optSubscription”. The options for the subscription to be set up

are determined via this object. 2 “ReturnItemName = True” determines that the OPC server returns the name of the OPC

items when the subscription is polled. The subscription is identified via the “ClientRequestHandle” property.

3 The subscription is set up at the OPC server with the “Subscribe” function. The item list “OPCSubscribeRequestList” contains the OPC items which are to be contained in the subscription. The item list “OPCSubscribeReplyList” is only used temporarily and is insignificant in this case.

Function Mechanisms and Program Structures

Visualizing with Visual Basic .NET and OPC XML

V 1.0 28.07.2004 26/43

Cop

yrig

ht

Sie

men

s A

G 2

004

All

right

s re

serv

ed

2100

4994

_Win

AC

_VO

_DO

KU

_v10

_e.d

oc

2100

4994

Cyclic, asynchronous polling of a subscription The following Visual Basic code shows how the subscription set up above is polled cyclically and asynchronously.

Fig. 3-6

Explanations on the code Table 3-10

No. Description 1 The sub “tiUpdate_Tick” is continuously called by the timer “tiUpdate”. 2 The reading of the subscription is triggered by the “BeginSubscriptionPolledRefresh”

function. The return subroutine is determined via the “callback” parameter. In the above case it is the sub “SubscriptionCallBack”.

3 The sub “SubscriptionCallBack” is called when the reading of the subscription is completed.

4 The items returned by the OPC server are read via the “EndSubscriptionPolledRefresh” function. Only the items of which the value has changed since the last call are returned.

5 The items are transferred to the item list “OPCSubscribePolledReplyList()”.

Installation of Hardware and Software

Visualizing with Visual Basic .NET and OPC XML

V 1.0 28.07.2004 27/43

Cop

yrig

ht

Sie

men

s A

G 2

004

All

right

s re

serv

ed

2100

4994

_Win

AC

_VO

_DO

KU

_v10

_e.d

oc

2100

4994

4 Installation of Hardware and Software

This chapter describes the installation of the components for the application. It is divided into the following sections:

Topics

Chapter Title Page 4.1 Preliminary installation 27 4.2 Hardware configuration 28 4.3 Installation of the WinAC RTX software 30 4.4 Installation and setup of the Internet Information Services 30 4.5 Installation of the visualization program 33 4.6 Using WinAC RTX 34 4.7 Configuration of the automation stations 35

Installation sequence It is required to follow a specific installation sequence to ensure correct installation of the SIMATIC components. The components according to their installation sequence are listed in the following table.

The installation will be described in this sequence in the following chapters. Table 4-1

No. Instruction Target 1 STEP 7 V5.3 (or higher) PG/PC 2 SIMATIC NET PC software V6.2 (or higher) WinAC station 3 Installation of the CP5613 A2 WinAC station 4 WinAC RTX V4.1 (or higher)

This installation is divided into the following steps: • Installing and checking the VenturCom RTX

extensions • Installing and authorizing the WinAC RTX software

WinAC station

5 Installation of the Internet Information Services (IIS) WinAC station 6 Installation of .NET Framework WinAC station

snd/or PG/PC 7 Installation of the example program WinAC station

and/or PG/PC

Installation of Hardware and Software

Visualizing with Visual Basic .NET and OPC XML

V 1.0 28.07.2004 28/43

Cop

yrig

ht

Sie

men

s A

G 2

004

All

right

s re

serv

ed

2100

4994

_Win

AC

_VO

_DO

KU

_v10

_e.d

oc

2100

4994

4.1 Preliminary installation

STEP 7 STEP 7 is installed on the PG/PC which is intended for the configuration and the programming of the automation stations. Alternatively STEP 7 can also be installed on the PC (WinAC station) on which WinAC is to run.

At this point the installation of STEP7 will not be described. The installation takes place in the familiar Windows environment and is self-explanatory.

SIMATIC NET PC software The SIMATIC NET PC software is installed on the same PC (WinAC station) on which WinAC is to be installed. The software package includes all the tools required to install and operate a PC station.

From STEP 7 version 5.2 on “Advanced PC Configuration” is used to put PC stations into operation. 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 /2/ “SIMATIC NET Commissioning PC Stations – Quick Start”.

Installation of Hardware and Software

Visualizing with Visual Basic .NET and OPC XML

V 1.0 28.07.2004 29/43

Cop

yrig

ht

Sie

men

s A

G 2

004

All

right

s re

serv

ed

2100

4994

_Win

AC

_VO

_DO

KU

_v10

_e.d

oc

2100

4994

4.2 Hardware configuration

This chapter explains how to install the CP 5613 A2 and how to connect the PG/PC to the WinAC station via an Ethernet network.

Installation of the CP 5613 A2 Install the CP 5613 A2 in an available PCI slot of the rack PC according to the enclosed mounting instructions /6/. The drivers for the CP have already been installed with the SIMATIC NET PC software.

For further hints on the installation of PCI cards in the rack PC please consult PC manual /5/.

Bus cabling The WinAC station and the PG/PC have to be connected to a common Ethernet network to demonstrate the remote visualization. There are three options:

• Connect the Ethernet ports of the two stations to an existing network (e.g. office or system network). It is absolutely necessary to consult the network administrator beforehand.

• Connect both Ethernet ports via a cross cable.

• Connect the two Ethernet ports via standard Ethernet cables via a travel (device to connect several Ethernet stations).

Setting the IP addresses After connecting the WinAC station and the PG/PC with a travel or a cross cable you have to set the IP addresses of the two PCs in such a way that they can communicate with each other. Perform the steps listed in the following table (first for the WinAC station and subsequently perform the same steps for the PG/PC): Table 4-2

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

Start Settings Network and Dial-Up connections (in Windows XP: Network Connections) right mouse click on the LAN connection Properties

Installation of Hardware and Software

Visualizing with Visual Basic .NET and OPC XML

V 1.0 28.07.2004 30/43

Cop

yrig

ht

Sie

men

s A

G 2

004

All

right

s re

serv

ed

2100

4994

_Win

AC

_VO

_DO

KU

_v10

_e.d

oc

2100

4994

No. Instruction 2 In the list select “Internet

protocol (TCP/IP)” and click the “Properties” button.

3 Select the “Use the following

IP address” option on both stations.

4 Enter the same subnet mask for both stations, e.g. “255.255.255.0” 5 Enter two different IP addresses for both stations in which only the digit on

the right is different, e.g. “157.163.22.12” and “157.163.22.13”. Make sure that the selected IP addresses are unique in the connected network.

6 Confirm the opened dialog boxes by clicking “OK”.

Installation of Hardware and Software

Visualizing with Visual Basic .NET and OPC XML

V 1.0 28.07.2004 31/43

Cop

yrig

ht

Sie

men

s A

G 2

004

All

right

s re

serv

ed

2100

4994

_Win

AC

_VO

_DO

KU

_v10

_e.d

oc

2100

4994

4.3 Installation of the WinAC RTX software

The installation of WinAC RTX is described in the following table.

Note The PROFIBUS CP (e.g. CP 5613 A2) should be mounted and installed before installing WinAC RTX.

Table 4-3

No. Instruction 1 The setup program starts automatically after inserting the WinAC RTX CD. If

the program does not start automatically execute the “Setup.exe” program on the CD.

2 After selecting the language a dialog box is displayed which guides you through the installation tasks.

3 Click the “install VenturCom RTX” button and follow the instructions in the dialog box. Note The license number (Runtime PAC Number) and the e-mail address for the licensing of VenturCom RTX are on the rear of the WinAC RTX CD cover. Note If the error message “Your System is using a HAL that is not supported by RTX 5.12” is displayed during the installation of the VenturCom RTX extensions please read the FAQ with the ID 17053416 on the A&D Support home page (http://support.automation.siemens.com).

4.4 Installation and setup of the Internet Information Services

The Internet Information Services(IIS) make available the functionality providing web services. That is why IIS is installed on the PC on which the OPC server runs – thus on the WinAC station.

Installation To install the IIS follow the steps listed below. Have your Windows installation CD ready. It is absolutely necessary that the IIS are installed before installing Microsoft .NET Framework 1.1. If you have already installed .NET Framework please observe the note at the end of the installation table. Table 4-4

No. Instruction 1 Open the “Add or Remove Programs” dialog box via:

Start Settings Control Panel Add or Remove Programs 2 Select “Add/Remove Windows Components”. 3 In the component list select “Internet Information Services (IIS)” by checking

it. 4 Change to the “Internet Information Services (IIS)” dialog box by clicking

“Details”.

Installation of Hardware and Software

Visualizing with Visual Basic .NET and OPC XML

V 1.0 28.07.2004 32/43

Cop

yrig

ht

Sie

men

s A

G 2

004

All

right

s re

serv

ed

2100

4994

_Win

AC

_VO

_DO

KU

_v10

_e.d

oc

2100

4994

No. Instruction 5 Only select the following entries in the “Subcomponents” list:

• Common Files • Internet Information Services Snap-In • Personal Web Manager (only Windows 2000) • WWW server Confirm your selection by clicking “OK”.

6 Start the installation by clicking “Next >“and follow the instructions of the installation program.

7 If the WinAC station is connected to the Internet check whether important updates for the IIS are available at http://windowsupdate.microsoft.com/. Available updates can also be downloaded and installed manually at www.microsoft.com/downloads.

Note If you have already installed “Microsoft .NET Framework 1.1” before installing IIS (Framework is listed in the “Add or Remove Programs” dialog box in the control panel) perform the following steps: 1. Open the DOS prompt via: Start Run Enter “cmd” OK 2. Enter

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

3. Restart the PC.

Setup To enable the access of applications to the SIMATIC NET OPC server via OPC XML-DA the Internet Information Service has to be configured accordingly. The following table explains how to set up the IIS for this access.

The default settings are kept for access protection. This means that each user can access the web service. That is the reason why you should operate this example only in an isolated network or Intranet.

Installation of Hardware and Software

Visualizing with Visual Basic .NET and OPC XML

V 1.0 28.07.2004 33/43

Cop

yrig

ht

Sie

men

s A

G 2

004

All

right

s re

serv

ed

2100

4994

_Win

AC

_VO

_DO

KU

_v10

_e.d

oc

2100

4994

Table 4-5

No. Instruction Comment 1 Open the “Internet Information Services” via:

Start Control Panel Administrative Tools Internet Services Manager Note If Administrative Tools is not available proceed as follows: Start Run and enter the following string: %SystemRoot%\System32\Inetsrv\iis.msc

2 In the context menu of the branch “Default web site” (right mouse click) select New Virtual folder

3 Click “Next” in the “Virtual Directory Creation Wizard”.

4 In the “Alias:” box enter “OPC.Simatic.NET” and click “Next >”.

5 By clicking “Browse” select the subdirectory

“\opc2\binXML” in your SIMATIC.NET installation directory. This directory contains the file “sopcweb.asmx”. Click “Next >”.

6 In the “Access Permissions” window only select the following points: • Read • Run scripts (such as ASP) Click “Next >”.

7 Click “Finish” to complete the wizard. “OPC.Simatic.NET” should now be displayed below “Default web site”.

8 Close the management console.

Installation of Hardware and Software

Visualizing with Visual Basic .NET and OPC XML

V 1.0 28.07.2004 34/43

Cop

yrig

ht

Sie

men

s A

G 2

004

All

right

s re

serv

ed

2100

4994

_Win

AC

_VO

_DO

KU

_v10

_e.d

oc

2100

4994

4.5 Installation of the visualization program

This chapter explains how to install the example program on which this application is based. The installation process on the WinAC station (for the local visualization) is identical to the installation process on the PG/PC (for the remote visualization).

Download and installation of Framework The example program is based on Microsoft .NET Framework 1.1 (referred to as Framework in the following). This program can thus only be executed on PCs on which Framework is installed (to be checked via: Start Settings Control Panel Add or Remove Programs).

There are two different options for downloading Framework from the Internet and installing it:

• Using the Windows update function (www.windowsupdate.com)

• Downloading at the Microsoft home page (www.microsoft.com).

If your target PC is not connected to the Internet you have to download Framework from the Microsoft home page to a different PC and transfer it to the target PC (e.g. using a USB memory stick).

Installation of the example program No setup is required for the installation of the visualization program. Follow the instructions listed in the table to copy the program files to your hard disk. Table 4-6

No. Instruction 1 Create a directory on your hard disk into which the program files are to be

copied, e.g.: “C:\Programs\Visualization\” 2 Open the ZIP file “21004994_WinAC_VO_CODE_v10_e.zip” and extract the

files • “OPC-XML WebClient.exe” • “TankControl.dll” to the directory created by you.

Installation of Hardware and Software

Visualizing with Visual Basic .NET and OPC XML

V 1.0 28.07.2004 35/43

Cop

yrig

ht

Sie

men

s A

G 2

004

All

right

s re

serv

ed

2100

4994

_Win

AC

_VO

_DO

KU

_v10

_e.d

oc

2100

4994

4.6 Using WinAC RTX

This section provides a brief overview of the usage of WinAC RTX. Only the functions which are absolutely necessary are explained in the following. It is recommended to read WinAC RTX manual /1/ for the use of WinAC RTX.

Starting WinLC RTX WinLC RTX is started via: “Start Simatic PC Based Control WinLC RTX”. The control panel of the controller is started simultaneously.

Operating WinLC RTX The symbol in the task bar indicates that WinLC RTX is running. A green margin signals “RUN” or “RUN-P” mode, a yellow margin indicates “STOP” mode.

The buttons of the WinLC RTX control panel are explained in the following table. Table 4-7

Button Function Setting the controller to RUN-P mode

Setting the controller to RUN mode

Setting the controller to STOP mode

A memory reset of the controller is performed.

Shutting down WinLC RTX The controller is not terminated by shutting down the control panel (the symbol is still in the task bar). The following operating instructions are only for information. For the use of this application it is absolutely required that WinLC RTX is started and that it is in RUN or RUN-P mode.

To terminate the controller and thus the process control proceed as follows: Table 4-8

No. Instruction 1 Open the WinLC RTX control panel by double-clicking . 2 Select “CPU Shut down Controller” in the menu. 3 Confirm the dialog box by clicking “Yes” to terminate the process control.

Installation of Hardware and Software

Visualizing with Visual Basic .NET and OPC XML

V 1.0 28.07.2004 36/43

Cop

yrig

ht

Sie

men

s A

G 2

004

All

right

s re

serv

ed

2100

4994

_Win

AC

_VO

_DO

KU

_v10

_e.d

oc

2100

4994

4.7 Configuration of the automation stations

Configuration with the Station Configuration Editor The configuration of the WinAC station with the Station Configuration Editor corresponds to the plugging of S7-400 hardware components into a rack. The components of the PC station (hardware and also software components) are assigned to a virtual slot using the software. Table 4-9

No. Instruction 1 If the WinLC controller is started ( symbol in the task bar) you have to shut

it down first. • Open the control panel of WinLC RTX by double-clicking . • Shut down the controller via the menu “CPU Shut Down Controller” in

the control panel. 2 Start the Station Configuration Editor by double-clicking the symbol in

the task bar or via: “Start Station Configuration Editor” 3 Set the name of the WinAC station to “PCWinAC” using the “Station Name”

button.

Note This name has to be identical with the name of the SIMATIC PC station in the STEP 7 project (see Installation of the STEP 7 project).

4 Slots 1 to 32 have to be empty. Remove all existing components by selecting the component and clicking “Delete”. Confirm the safety queries by clicking “OK”.

Note Importing the configuration using the “Import Station…” (XDB import) function is not possible in WinAC (Basis, RTX, Slot).

Configuring OPC server Follow the instructions listed in the following table to configure an OPC server on the WinAC station. Table 4-10

No. Instruction 1 Select the line with index 1 (this line has to be blank!) in the Station

Configuration Editor. 2 Open the “Add component” dialog box by clicking “Add…”. 3 Select the entry “OPC Server” from the “type” list. 4 Close the dialog box by clicking “OK” and confirm the following dialog box

also by clicking “OK”.

Installation of Hardware and Software

Visualizing with Visual Basic .NET and OPC XML

V 1.0 28.07.2004 37/43

Cop

yrig

ht ©

Sie

men

s A

G 2

004

All

right

s re

serv

ed

2100

4994

_Win

AC

_VO

_DO

KU

_v10

_e.d

oc

2100

4994

Configuration of the PROFIBUS interface of the WinAC station With the following steps you configure the CP 5613 A2 as interface module for WinAC RTX. This process corresponds to the plugging of IF modules into an S7-400 CPU. Table 4-11

No. Instruction 1 Select the line with index 2 (this line has to be blank!) in the Station

Configuration Editor and insert a component of the “WinLC RTX” type by clicking “Add…”.

2 Open the WinLC RTX properties dialog box via the context menu of the list entry.

3 Select “IF1” from the list. 4 Open the “Add CP Module to WinLC RTX” dialog box by clicking “Add…”. 5 Select “CP5613A2(Slot ...)” and confirm by clicking “OK”.

6 Close the properties dialog box and restart the PC.

The complete configuration After performing these steps the configuration in the Station Configuration Editor should be identical with the following figure. Fig. 4-1

Installation of Hardware and Software

Visualizing with Visual Basic .NET and OPC XML

V 1.0 28.07.2004 38/43

Cop

yrig

ht

Sie

men

s A

G 2

004

All

right

s re

serv

ed

2100

4994

_Win

AC

_VO

_DO

KU

_v10

_e.d

oc

2100

4994

Installation of the STEP 7 project Follow the instructions listed below to open the STEP 7 project and to adapt it to your configuration. The instructions refer to the use of a PG/PC for the configuration of the WinAC station via PROFIBUS. If you configure the WinAC station via a locally installed STEP 7 you have to set the PG/PC interface to “PC internal (local)”. Table 4-12

No. Instruction 1 Copy the archived STEP 7 project “Winlc_VO.zip” from the ZIP archive

“21004994_WinAC_VO_CODE_v10_e.zip” into a temporary directory. 2 Open the SIMATIC Manager. 3 Retrieve the archive “Winlc_VO.zip” via the menu ”File > Retrieve...”. 4 After retrieving open the project in the SIMATIC Manager.

Downloading the S7 program to WinAC RTX (WinAC station) Downloading to WinAC RTX on the WinAC station takes place from the PG/PC via PROFIBUS. Follow the steps listed in the table below. Table 4-13

No. Instruction 1 If not already done, turn on the PC of the WinAC station and start

WinLC RTX. Note Make sure that the Station Configuration Editor is configured correctly (see Configuration with the Station Configuration Editor).

2 Perform a memory reset in the WinLC RTX controller by clicking the button.

3 Connect your PG to the PROFIBUS-CP (CP5613 A2) of the WinAC station via an MPI or PROFIBUS cable.

Installation of Hardware and Software

Visualizing with Visual Basic .NET and OPC XML

V 1.0 28.07.2004 39/43

Cop

yrig

ht

Sie

men

s A

G 2

004

All

right

s re

serv

ed

2100

4994

_Win

AC

_VO

_DO

KU

_v10

_e.d

oc

2100

4994

No. Instruction 4 For simple switching of the PG/PC interface to PROFIBUS proceed as

follows: 1. Open the context menu of the “PG/PC(1)” object in the STEP 7 project

by clicking it with the right mouse button. 2. Select: PLC Assign PG/PC. 3. If your PG/PC features several PROFIBUS interfaces select the correct

interface in the “Properties – PG/PC” dialog box, click “Assign”, and close the dialog box by clicking “OK”.

The PG/PC interface is now set to PROFIBUS.

Note When configuring CP 5613 A2 as IF module in the WinAC station for the first time it may occur that the baud rate is set to 187.5 Kbps. For downloading the parameterization adapt the parameters of the PROFIBUS network accordingly. The current bus parameters of a CP 5613 A2 can be displayed in the “WinLC Properties” dialog box (from the Station Configuration Editor) by clicking the “Diagnostics” button (requires that the WinLC RTX controller is started).

5 Open HW Config of the “PCWinAC” station and download it to the WinAC station.

6 Download the blocks of the S7 program of the “PCWinAC” station to the PLC.

7 Set the WinLC RTX controller to “RUN-P” mode by clicking .

Operator Control and Monitoring

Visualizing with Visual Basic .NET and OPC XML

V 1.0 28.07.2004 40/43

Cop

yrig

ht

Sie

men

s A

G 2

004

All

right

s re

serv

ed

2100

4994

_Win

AC

_VO

_DO

KU

_v10

_e.d

oc

2100

4994

5 Operator Control and Monitoring

Introduction This chapter explains the application of the example program for the visualization of a mixing process.

The requirement for operator control and monitoring is the installation of hardware and software described in chapter 4.

Description of the process The S7 control program simulates a mixing process. During this process liquids are ran into a tank via two inlet valves. The liquid is then mixed and heated. When the desired temperature is reached the liquid is cooled and let out via an outlet valve.

Starting the example program To start the visualization program simply execute the file “OPC-XML WebClient.exe”.

Operator Control and Monitoring

Visualizing with Visual Basic .NET and OPC XML

V 1.0 28.07.2004 41/43

Cop

yrig

ht

Sie

men

s A

G 2

004

All

right

s re

serv

ed

2100

4994

_Win

AC

_VO

_DO

KU

_v10

_e.d

oc

2100

4994

User interface The user interface of the example program is shown below: Fig. 5-1

Description of the user interface The relevant controls of the user interface are explained in the table below: Table 5-1

No. Description 1 Connection buildup and cleardown to the SIMATIC NET OPC server. 2 Selection of the update mode of the PowerTags (via a subscription or cyclic

reading). 3 Selection of the update cycle time of the PowerTags (100-5000ms). 4 Input box: Address (URL) of the SIMATIC NET web service. 5 Display of the current level of the tank. 6 Input box: Setpoint for the filling height of the first liquid (range of values 0-90).

Input box: Setpoint for the entire filling height of the tank (range of values: 0-100). Button: Writing the setpoints for the filling heights into WinAC RTX.

7 Display of the current temperature of the liquid. 8 Input box: Setpoint for the maximum heating temperature (range of values: 0-200).

Input box: Setpoint for the outlet temperature (range of value: 0-100). Button: Writing the setpoints for the temperatures into WinAC RTX.

9 Buttons: Starting and stopping the mixing process. If the process is stopped by clicking the “Stop Process” button the current mixing process is completed and no new process is started.

Operator Control and Monitoring

Visualizing with Visual Basic .NET and OPC XML

V 1.0 28.07.2004 42/43

Cop

yrig

ht

Sie

men

s A

G 2

004

All

right

s re

serv

ed

2100

4994

_Win

AC

_VO

_DO

KU

_v10

_e.d

oc

2100

4994

Starting and operating visualization The following instructions show you how to connect the example program to the OPC server and how to operate the visualization. Table 5-2

No. Instruction 1 Start the example program (see Starting the example program). 2 If you don’t run the program on the WinAC station you have to adapt the

address (URL) of the web service: “http://[IP address of the WinAC station]/OPC.Simatic.NET/sopcweb.asmx" e.g.: “http://157.163.22.13/OPC.Simatic.NET/sopcweb.asmx” Note You can display the set IP address of the PC in the DOS prompt (Start Run Enter “cmd” OK) via the command “ipconfig”.

3 In the “Update” box select an update cycle time. 4 Select the update mode. Two modes can be selected:

• Subscription (cyclic polling of a subscription) • Cyclic reading (cyclic reading of all variables)

5 By clicking you connect the example program to the OPS server. After a certain period of time the current process values are displayed. Note If problems occur during connection buildup redownload the complete S7 project to the WinAC station.

6 Start the mixing process by clicking . 7 You can change the setpoints in your ranges of values as desired:

1. Enter a value in the input box. 2. Click the respective button to set the setpoints.

8 Disconnect the connection to the OPC server by clicking . 9 Close the example program.

Bibliography

Visualizing with Visual Basic .NET and OPC XML

V 1.0 28.07.2004 43/43

Cop

yrig

ht

Sie

men

s A

G 2

004

All

right

s re

serv

ed

2100

4994

_Win

AC

_VO

_DO

KU

_v10

_e.d

oc

2100

4994

6 Bibliography

This list is by no means exhaustive and only gives a selection of appropriate sources. After installing the respective product most manuals are available via:

Start Simatic Documentation English

The Product Support is available on the Internet at:

http://support.automation.siemens.com

(Enter the Entry ID in the search field). Table 6-1

No. Topic Title 1 Description of the functions and the operation

of WinAC RTX V4.1. Available on the WinAC RTX V4.1 CD.

SIMATIC WinAC RTX V4.1

2 Description or information on: • General information on the PC tools • Functions of NCM PC Is installed by SIMATIC NET, see: Start Simatic Documentation English Or available in the Product Support; Entry ID: 13542666

SIMATIC NET Commissioning PC Stations – Manual / Quick Start for SIMATIC NCM PC / STEP 7 version V5.2 and higher

4 Manual for industrial communication on PG/PC with SIMATIC NET. Is installed by SIMATIC NET, see: Start Simatic Documentation English Or available in the Product Support; Entry ID: 2044387

SIMATIC NET – Industrial Communication with PG/PC

5 Manual for SIMATIC Rack PC IL40S Available in the Product Support; Entry ID: 15317654

SIMATIC Rack PC IL40S manual

6 Installation instructions for CP 5613 A2 Available in the Product Support; Entry ID: 13664901

SIMATIC NET product information / installation instructions for CP5613 A2, CP5614, CP5613 FO, CP5614 FO

Note If the entries are not displayed immediately after clicking the links listed in the table above click “Update” in your browser.