Вы находитесь на странице: 1из 46

Cover

OPC Client Excel Applications for Data Access to PCS 7 OS Process Data via OpenPCS 7
SIMATIC PCS 7 Application Description August 2010

Applications & Tools


Answers for industry.

Industry Automation and Drives Technologies Service & Support Portal This article is taken from the Service Portal of Siemens AG, Industry Automation and Drives Technologies. The following link takes you directly to the download page of this document. http://support.automation.siemens.com/WW/view/en/44444703

For questions about this document please use the following e-mail address: online-support.automation@siemens.com

Copyright Siemens AG 2010 All rights reserved

OpenPCS 7 Station / OPC Clients Version 1.0, Entry ID: 44444703

Automation Task Automation Solution Basics Functional Mechanisms of this Application Installation Configuration Operating the Application

1 2 3 4 5 6 7 8 9

SIMATIC PCS 7 OpenPCS 7 Station / OPC Clients

Copyright Siemens AG 2010 All rights reserved

Reference History

OpenPCS 7 Station / OPC Clients Version 1.0, Entry ID: 44444703

Warranty and Liability

Warranty and Liability


Note The application examples are not binding and do not claim to be complete regarding configuration, equipment and any contingencies. The application examples do not represent customer-specific solutions. They are only intended to provide support for typical applications. You are responsible for ensuring that the described products are used correctly. These application examples do not relieve you of the responsibility to use sound practices in application, installation, operation and maintenance. When using these application examples, you recognize that we cannot be made liable for any damage/claims beyond the liability clause described. We reserve the right to make changes to these application examples at any time without prior notice. If there are any deviations between the recommendations provided in this application example and other Siemens publications e.g. catalogs the contents of the other documents have priority. We do not accept any liability for the information contained in this document. Any claims against us based on whatever legal reason resulting from the use of the examples, information, programs, engineering and performance data etc., described in this Application Example shall be excluded. Such an exclusion shall not apply in the case of mandatory liability, e.g. under the German Product Liability Act (Produkthaftungsgesetz), in case of intent, gross negligence, or injury of life, body or health, guarantee for the quality of a product, fraudulent concealment of a deficiency or breach of a condition which goes to the root of the contract (wesentliche Vertragspflichten). The damages for a breach of a substantial contractual obligation are, however, limited to the foreseeable damage, typical for the type of contract, except in the event of intent or gross negligence or injury to life, body or health. The above provisions do not imply a change of the burden of proof to your detriment. It is not permissible to transfer or copy these application examples or excerpts of them without having prior authorization from Siemens Industry Sector in writing.

Copyright Siemens AG 2010 All rights reserved

OpenPCS 7 Station / OPC Clients Version 1.0, Entry ID: 44444703

Preface

Preface
Purpose of this document Part of this document is a PCS 7 sample configuration and the OPC client Excel applications which you can also access via the download site of this entry. This document describes all steps from commissioning; configuration and operation of the sample project and of the OPC client Excel applications. This document is supplement to the SIMATIC PCS 7 OpenPCS 7 Process Control System manual. Main contents The following points are emphasized:
Copyright Siemens AG 2010 All rights reserved

Adjusting and using the PCS 7 sample configuration Installation and configuration of the OpenPCS 7 station Operation of the OPC client Excel applications

OpenPCS 7 Station / OPC Clients Version 1.0, Entry ID: 44444703

Table of Contents

Table of Contents
Warranty and Liability ................................................................................................. 4 Preface .......................................................................................................................... 5 1 2 Automation Task................................................................................................ 7 Automation Solution ......................................................................................... 8 2.1 2.2 2.3 3 3.1 3.2 3.3 4 4.1 4.2 4.3 4.3.1 4.3.2 5 5.1 5.2 5.2.1 5.2.2 5.2.3 6 6.1 6.2 6.3 7 7.1 7.1.1 7.1.2 7.1.3 7.1.4 8 8.1 8.2 9 Overview of the overall solution.................................................................. 8 Core functionality .......................................................................................... 9 Hardware and software components used ............................................... 9 Checking the network connection ............................................................ 11 OpenPCS 7.................................................................................................. 12 VBA............................................................................................................... 13 OpenPCS 7 / OPC client ........................................................................... 16 PCS 7 OS .................................................................................................... 17 Structure of the sample project................................................................. 18 AS Engineering ........................................................................................... 18 OS Engineering........................................................................................... 20 Hardware...................................................................................................... 22 Software ....................................................................................................... 23 OpenPCS 7.................................................................................................. 23 OPC clients.................................................................................................. 25 SIMATIC PCS 7 .......................................................................................... 25 OpenPCS 7 / OPC client ........................................................................... 26 SIMATIC PCS 7 (with sample project) .................................................... 27 SIMATIC PCS 7 (without sample project)............................................... 32 OPC clients.................................................................................................. 33 OPC DA client ............................................................................................. 33 OPC HDA client .......................................................................................... 38 OPC A&E client Alarms........................................................................... 40 OPC A&E client Events........................................................................... 43 Bibliography................................................................................................. 45 Internet Link Specifications ....................................................................... 45

Basics ............................................................................................................... 11

Functional Mechanisms of this Application ................................................. 15

Copyright Siemens AG 2010 All rights reserved

Installation........................................................................................................ 22

Configuration ................................................................................................... 26

Operating the Application............................................................................... 33

Reference ......................................................................................................... 45

History............................................................................................................... 46

OpenPCS 7 Station / OPC Clients Version 1.0, Entry ID: 44444703

1 Automation Task

Automation Task
SIMATIC PCS 7 is an open system with standardized interfaces. These interfaces make it possible to access SIMATIC PCS 7 process data from applications. Such customer-specific applications can be created and expanded in the VB programming languages (Visual Basic), VBA (Visual Basic for Applications) or Visual C++. There is often the need to call and evaluate additional process data on the business management level. It is to be added to the existing architecture and installed software basis, such as e.g. MS Office.

Introduction

Description The figure below provides an overview of the automation task.


Figure 1-1

Copyright Siemens AG 2010 All rights reserved

The automation task comprises access from a MS Office application to PCS 7 OS data. PCS 7 OS data is either archived data or data at run time.

OpenPCS 7 Station / OPC Clients Version 1.0, Entry ID: 44444703

2 Automation Solution

Automation Solution
If the task is to record the PCS 7 OS data outside of PCS 7 and if necessary to evaluate it, then PCS 7 offers a manufacturer-independent interface by supporting the OPC specifications.

2.1

Overview of the overall solution


The following figure gives a schematic overview of the most important components of the solution:
Figure 2-1
OPC DA (Data Access) OPC HDA (Historical Data Access) OPC A&E (Alarms & Events)

Schematic layout

OPC-Client

Client System

OpenPCS 7 Station

Copyright Siemens AG 2010 All rights reserved

SIMATIC PCS 7 OS
Server System

S7-400

The server system contains a simulation of process values and messages. Note The figure corresponds to the configuration in the sample project. Further configurations can be found in the SIMATIC process control system PCS 7 OpenPCS 7 function manual in Service&Support.

Topics not covered by this application This application does not contain a description regarding: basic programming with PCS 7 implementation in an existing PCS 7 environment (described in the SIMATIC process control system PCS 7 OpenPCS 7 function manual) changing and expanding the OPC client Excel applications

OpenPCS 7 Station / OPC Clients Version 1.0, Entry ID: 44444703

2 Automation Solution

Required knowledge Basic knowledge and experience when dealing with PCS 7 is assumed. You should furthermore have basic knowledge of network technology and knowledge in the VBA (Visual Basic for Applications) script language.

2.2

Core functionality
The core functionality of this application example is the provision of PCS 7 OS process data (server system) for data access to an OPC client.

Advantages of this solution The solution introduced here offers you the following advantages: use of standardized OPC interfaces for data access simple integration in PCS 7 projects (not part of this description) free arrangement of OPC client Excel applications in the office network the infrastructure, from the terminal bus to the plant bus remains

Copyright Siemens AG 2010 All rights reserved

2.3

Hardware and software components used


The application was generated and tested with the following components:

Hardware components
Table 2-1 System OpenPCS 7 / OPC client OS server Component SIMATIC PCS 7 ES/OS 547B SIMATIC PCS 7 ES/OS 547B Communication Via terminal bus Via terminal bus

Note

If the hardware (Table 2-1) differs, please observe the minimum installation requirements of the software components listed in Table 2-2.

Software components
Table 2-2 System OpenPCS 7 / OPC client OS server Component PCS 7 V7.1 incl. OpenPCS 7 Microsoft Office Excel 2003 PCS 7 V7.1 incl. CFC S7-PLCSIM Part of SIMATIC PCS 7 ES/OS 547B. License is not part of the SIMATIC PCS 7 ES/OS 547B. Note OpenPCS 7 is part of the SIMATIC PCS 7 V7.1 DVD.

OpenPCS 7 Station / OPC Clients Version 1.0, Entry ID: 44444703

2 Automation Solution

Sample files and projects The following list contains all relevant files that are used in this application example.
Table 2-3 System OpenPCS 7 / OPC client OS server Component OPC-DA-HB.xls OPC-HDA-HB.xls OPC-A&E-HB.xls Opce_mp.zip Note OPC client Excel example applications for OPC DA, OPC HDA and OPC A&E data access. PCS 7 sample project

Copyright Siemens AG 2010 All rights reserved

10

OpenPCS 7 Station / OPC Clients Version 1.0, Entry ID: 44444703

3 Basics

3
3.1
Legend

Basics
Checking the network connection
The description and screen shots below contain the system names used in the test set up. OpenPCS 7 / OPC client = ES21 OS server = ES25

To check the network share execute the following steps. Please note that the Automation Projects release file is only available after the completed installation of the OpenPCS 7 station.
Table 3-1 No. 1.
Copyright Siemens AG 2010 All rights reserved

Instruction Open the Windows explorer on the OS server. In the explorer, enter the target directory, e.g. \\Computer Name\Automation Projects\ or \\IP Address\Automation Projects\.

Comment

2.

3.

In the Automation Projects file you will find the SPOSA.dcf file generated during the installation on ES21and another DCF file which will be created during the configuration of the ES25.

In case of access problems you will find solutions in Figure 3-1. Please note that the names of the stations are for the sample project and may differ from your project names.

OpenPCS 7 Station / OPC Clients Version 1.0, Entry ID: 44444703

11

3 Basics

Figure 3-1
Access to \\ES21\Automation Projects\ share file

Was the share file created on ES 21?

Net access successful

No

Check the computer name and if necessary replace the computer name by the IP address of the ES 21. Check the general network setup, e.g. workgroup, subnet, general access to computer, etc.

Yes
Copy and open \\ES21\Automation Projects\ test file in the share file

Write access successful


Copyright Siemens AG 2010 All rights reserved

No

Adjust the write and read rights on the ES21 for the share file

Yes
The share path is working and can be entered for the OpenPCS 7 station in the SPOSA application.

3.2

OpenPCS 7
In-depth information for the realization of access to PCS 7 OS process values and process value archives can be found in chapter 7 of the SIMATIC process control system PCS 7 OpenPCS 7 function manual.

12

OpenPCS 7 Station / OPC Clients Version 1.0, Entry ID: 44444703

3 Basics

3.3

VBA
Visual Basic for Application, in short VBA, is a script language used in Microsoft Office programs. With this script language, users can write their own macros (scripts) to automate processes. Data can, for example, be copied from Excel into Word via the push of a button. In addition, other applications can be accessed via a COM interface. Apart from access within the Office package, e.g. from Excel to Word, external applications such as the OpenPCS 7 station can also be accessed. Access to the OpenPCS 7 station is realized in the OPC client Excel applications. Proceed as described in the instruction to look at the sample code (macro).

Table 3-2 No. 1. 2. Instruction Open an OPC client Excel application, e.g. "OPC-DA-HB.xls". In the menu, select Tools > Macro > Visual Basic Editor. Comment

Copyright Siemens AG 2010 All rights reserved

3.

To display the source text click the ThisWorkbook(OPC_DA) Microsoft Excel object in the Visual Basic editor. The source text is displayed in the right window.

Prerequisite To use the OPC clients, the type libraries of the OpenPCS 7 station have to be selected. The type libraries needed are generated during the installation of the OpenPCS 7 station.

OpenPCS 7 Station / OPC Clients Version 1.0, Entry ID: 44444703

13

3 Basics

To select the Type Library for each OPC client Excel application, proceed as described in the instruction.
Table 3-3 No. 1. 2. Instruction Open the Visual Basic Editor as described in Table 3-2. Select Tools > References in the menu. Comment

3.

Copyright Siemens AG 2010 All rights reserved

In the References dialog you will see the available type libraries. The Siemens OPC DAAutomation 2.0 library is selected for the OPC DA client.

The following type libraries are needed or selected for the operation of the OPC client Excel applications: Siemens OPC DAAutomation 2.0 for the OPC-DA client Siemens OPC HDAutomation 1.0 for the OPC-HDA client Siemens OPC AlarmEvent Automation 1.0 for the OPC-A&E client

14

OpenPCS 7 Station / OPC Clients Version 1.0, Entry ID: 44444703

4 Functional Mechanisms of this Application

Functional Mechanisms of this Application


Figure 4-1

General overview

OPC-Client

OPC DA (Data Access) OPC HDA (Historical Data Access) OPC A&E (Alarms & Events)

IP-Adress: 172.20.1.21

OpenPCS 7 Station

ES21

IP-Adress: 172.20.1.25

SIMATIC PCS 7 ES/OS


ES25

Copyright Siemens AG 2010 All rights reserved

Interface overview The communication path is displayed in Figure 4-2. OPC client and OPC server are running on one system. The OPC client applications access the OPC server of the OpenPCS 7 station. In turn, the OPC servers access the runtime data of the PCS 7 OS via the PCS 7 internal communication interfaces. The communication between the OPC server of the OpenPCS 7 station and the OPC client is realized via the COM interface (COM = Component Object Model) implemented via MS Windows.
Figure 4-2

OpenPCS 7 Station / OPC Clients Version 1.0, Entry ID: 44444703

15

4 Functional Mechanisms of this Application

4.1

OpenPCS 7 / OPC client


Figure 4-3

The OpenPCS 7 station accesses PCS 7 OS data (WinCC) and provides the received data to OPC clients as OPC server. OPC client Excel application examples were generated according to the following OPC specifications:
Copyright Siemens AG 2010 All rights reserved

OPC DA (Data Access), read and write access to the process values at runtime OPC HDA (Historical Data Access), read access to archived process values of a period defined by the user OPC A&E (Alarms & Events), read access to alarms and events at runtime Further information on OPC DA, OPC HDA and OPC A&E can be found on the manufacturers site http://www.opcfoundation.org.

Note

16

OpenPCS 7 Station / OPC Clients Version 1.0, Entry ID: 44444703

4 Functional Mechanisms of this Application

4.2

PCS 7 OS
Figure 4-4

The SPOSA application configured in the engineering station contains the path to the OpenPCS 7 station on the ES21 and provides this station all reference information so it can access PCS 7 OS data. When loading the SPOSA application this reference information is created in a DCF file on the ES21. For PCS 7 OS data we distinguish between
Copyright Siemens AG 2010 All rights reserved

Runtime data and Archived data.

When the PCS 7 OS is executed the OpenPCS 7 station can provide the current process data and archived data to an OPC client. The OPC client Excel applications can have read or write access. In addition the process values are saved in the process value archive with the help of the Tag Logging (WinCC archive system). These archived (historical) values can have read access via the OPC client Excel application.

OpenPCS 7 Station / OPC Clients Version 1.0, Entry ID: 44444703

17

4 Functional Mechanisms of this Application

4.3

Structure of the sample project


The OPCexp_mp sample project consists of: AS Engineering, consisting of hardware configuration, CFC and simulation OS Engineering, consisting of Tag Logging and WinCC Runtime.

4.3.1

AS Engineering

SIMATIC Manager In multi project you will find the hardware components, the NetPro connection configuration and CFC programming. In Figure 4-5 you can see the project structure of the sample project.
Figure 4-5

Copyright Siemens AG 2010 All rights reserved

As AS hardware, the CPU 417-4 is configured with the corresponding CP 443-1 Ethernet.

18

OpenPCS 7 Station / OPC Clients Version 1.0, Entry ID: 44444703

4 Functional Mechanisms of this Application

NetPro In Figure 4-6 you can see the connection configuration in NetPro.
Figure 4-6

Copyright Siemens AG 2010 All rights reserved

CFC chart In Figure 4-7 you can see a sheet view of the CFC chart which is used to simulate sine and cosine (Sinus and Cosinus) values. To visualize the values the MEAS_MON blocks have been configured. Additionally configured values such as, e.g. R_Count, Val1R1 etc. can be found in the overview of the same CFC chart (DASimulation).
Figure 4-7

OpenPCS 7 Station / OPC Clients Version 1.0, Entry ID: 44444703

19

4 Functional Mechanisms of this Application

4.3.2

OS Engineering

Tag logging In Figure 4-8 you can see the tag logging of the sample project which can be opened from the WinCC Explorer. All added tags are saved in the process value archive. You can access this data with the help of the OPC HAD client Excel application.
Figure 4-8

Copyright Siemens AG 2010 All rights reserved

20

OpenPCS 7 Station / OPC Clients Version 1.0, Entry ID: 44444703

4 Functional Mechanisms of this Application

WinCC Runtime In Figure 4-9 you can see the visualization of the sample project in process operation (WinCC Runtime).
Figure 4-9

Copyright Siemens AG 2010 All rights reserved

OpenPCS 7 Station / OPC Clients Version 1.0, Entry ID: 44444703

21

5 Installation

5
5.1

Installation
Hardware
The figure below shows the hardware setup of the application.
Figure 5-1

OPC-Client

OPC DA (Data Access) OPC HDA (Historical Data Access) OPC A&E (Alarms & Events)

IP-Adresse: 172.20.1.21

OpenPCS 7 Station

ES21

IP-Adresse: 172.20.1.25

Copyright Siemens AG 2010 All rights reserved

SIMATIC PCS 7 ES/OS


ES25

The hardware components of the ES21 and ES25 can be found in chapter 2.3 Hardware and software components used. We recommend to operate both stations in the same subnet and to use identical login names and passwords. The IP addresses and login data indicated in Table 5-1 were used in the sample configuration.
Table 5-1 ES 21 25 Login name Administrator Administrator Password 12345 12345 IP Address 172.20.1.21 172.20.1.25 Subnet 255.255.0.0 255.255.0.0

Note

The setup guidelines for PCS 7 must be followed. Information can be found in the SIMATIC Process Control System PCS 7 Compendium Part A Configuration Guidelines manual. The manual is available as a download via the following link: http://support.automation.siemens.com/WW/view/en/35016996

22

OpenPCS 7 Station / OPC Clients Version 1.0, Entry ID: 44444703

5 Installation

5.2

Software

5.2.1

OpenPCS 7
You can find information regarding the installation of OpenPCS 7 in different configurations in the SIMATIC process control system PCS 7 OpenPCS 7 function manual. Close all opened programs and follow the instruction below.

Table 5-2 No. 1 2 Instruction Start the Setup.exe installation program from the PCS 7 V7.1 Toolset DVD. Select a setup language. All installation steps are displayed in the selected setup language. Comment

Copyright Siemens AG 2010 All rights reserved

Close all opened programs and proceed with the installation.

Read the product notice and click the "Next" button.

OpenPCS 7 Station / OPC Clients Version 1.0, Entry ID: 44444703

23

5 Installation

No. 5

Instruction Read the license agreement. By clicking the "Next" button you accept the license agreements.

Comment

6 7 8 9

Select the "Install" setup type and click the "Next" button. Enter the user information and click the "Next" button. Select the package installation and click the "Next" button. Select the "OpenPCS 7" program package and click the "Next" button.

The Update option is available if you have a STEP 7 or PCS 7 installation.

Copyright Siemens AG 2010 All rights reserved

10. 11

Check the selected components to be installed and then click the "Next" button. After clicking the Install button the following packages are installed/configured: - OPC Core Components V3.0 - OPC.NET API Redistributables - Automation License Manager V4.0 SP2 - OpenPCS 7 V7.1 - PCS 7 Tools V7.1 - Firewall Configuration

12

The recommended settings are displayed in the last installation window in SIMATIC Security Control. You will accept the settings for you system by clicking Apply.

24

OpenPCS 7 Station / OPC Clients Version 1.0, Entry ID: 44444703

5 Installation

5.2.2

OPC clients
The OPC client Excel applications are not installed but unpacked. Prerequisite for operating the OPC client Excel applications is the installation of Microsoft Office Excel 2003. Information regarding the installation prerequisites and installation of Microsoft Office Excel 2003 can be found on the manufacturers site and on the installation CD.

Note

5.2.3

SIMATIC PCS 7
The PCS 7 software is already preinstalled on a SIMATIC PCS7 ES/OS 547B. For the simulation of a controller you can reinstall the S7-PLCSIM from PCS 7 installation CD. The S7-PLCSIM license is not part of the PCS7 ES/OS 547B and has to be purchased separately.

Copyright Siemens AG 2010 All rights reserved

ATTENTION

Please observe the notes and information regarding installation and operation in the PC Configuration and Authorization (V7.1) manual. The manual is available as a download via the following link: http://support.automation.siemens.com/WW/view/en/36191684

OpenPCS 7 Station / OPC Clients Version 1.0, Entry ID: 44444703

25

6 Configuration

6
6.1

Configuration
OpenPCS 7 / OPC client
To execute the OPC client Excel applications an intermediate to low security level has to be set for the execution of macros. To adjust the security level, proceed according to the instruction.

Security settings in Microsoft Office Excel 2003

Table 6-1 No. 1. 2. Instruction Open an OPC client Excel application. Open Tools > Macro > Security in the menu. Comment

Copyright Siemens AG 2010 All rights reserved

3.

Set the security level to the option medium in the Security dialog field. The medium security level means the following for you: when opening an Excel file with macros you will always be asked whether macros may be executed.

ATTENTION

Please note that when using the Low security level, macros will be executed without asking. Excel files from untrusted sources may contain damaging codes for your PC. When opening an Excel file in the Low security level, damaging codes may be executed and your computer could be damaged.

26

OpenPCS 7 Station / OPC Clients Version 1.0, Entry ID: 44444703

6 Configuration

6.2

SIMATIC PCS 7 (with sample project)


The OPCexp_MP sample project contains a minimal configuration to simulate process values.

Project adjustment To adjust the project to your system, follow the instruction below.
Table 6-2 No. 1. 2. Instruction Retrieve the Opce_mp.zip sample project in the SIMATIC manager. Adjust the name of the PC Station (OSServer) in the Object Properties. Comment

Copyright Siemens AG 2010 All rights reserved

3.

Enter the name of your computer and tick Computer name identical to PC station name.

OpenPCS 7 Station / OPC Clients Version 1.0, Entry ID: 44444703

27

6 Configuration

No. 4.

Instruction Instructions for adjusting the OS computer name. - Make a right mouse click on the OS and select the Open Object menu. A dialog for the server configuration is opened.

Comment

5.

Continuation of the instruction for adjusting the OS computer name. - Confirm the The configured server is not available... dialog with Yes. Continuation of the instruction for adjusting the OS computer name. -By clicking the Properties menu on the computer with the right mouse button a new window for adjusting the name will open up.

Copyright Siemens AG 2010 All rights reserved

6.

7.

Continuation of the instruction for adjusting the OS computer name. - By enabling Use Local Computer Name the local computer name is read and accepted.

8.

Close the opened OS project.

28

OpenPCS 7 Station / OPC Clients Version 1.0, Entry ID: 44444703

6 Configuration

No. 9.

Instruction Make a right mouse click on the OS and select the Generate server data menu.

Comment

10.

Assign the OS server data of the OpenPCS 7 station to the OPC server and select the Assign OS server menu by clicking the right mouse button.

Copyright Siemens AG 2010 All rights reserved

11. 12.

Confirm the OS server assignment for OPCServer dialog with OK. Open the object properties of the OPCServer by clicking the right mouse button on the OPCServer and select the Object Properties menu.

OpenPCS 7 Station / OPC Clients Version 1.0, Entry ID: 44444703

29

6 Configuration

No. 13.

Instruction Enter the path to the OpenPCS 7 station (ES21) in the Target system tab. Read and write access to the target directory, e.g. \\ES21\Automation Projects\ is recommended. Proceed as described in chapter 3 Network access between ES25 and ES21.

Comment

14.

Select the OPC project in the window on the left, e.g. OPCexp_Prj and select PLC > Compile and Download Objects in the menu.

Copyright Siemens AG 2010 All rights reserved

15.

To compile all objects click the Select All button and tick Compile only.

Start simulation (S7-PLCSIM) To start the simulation, proceed according to the instruction.
Table 6-3 No. 1. Instruction Select Options > Simulate Modules in the menu. The dialog window of S7-PLCSIM is opened. Comment

30

OpenPCS 7 Station / OPC Clients Version 1.0, Entry ID: 44444703

6 Configuration

No. 2.

Instruction Select the Open project from a file option in the Open Project dialog.

Comment

3.

Select the plc1.plc file from the <Project path>\OPCe_Prj\plc1.plc path

Activating OS (WinCC Runtime) To activate the OS, proceed according to the instruction.
Table 6-4 No.
Copyright Siemens AG 2010 All rights reserved

Instruction Make a right mouse click on the OS and select the Open Object menu.

Comment

1.

2.

To activate the OS (WinCC Runtime), select File > Activate in the WinCCExplorer menu.

OpenPCS 7 Station / OPC Clients Version 1.0, Entry ID: 44444703

31

6 Configuration

6.3

SIMATIC PCS 7 (without sample project)


In the SIMATIC process control system PCS 7 OpenPCS 7 function manual further configuration examples are described, such as e.g.: installation of an OpenPCS 7 station with OS client installation of an OpenPCS 7 station on a OS single station installation of an OpenPCS 7 station on a CAS

Copyright Siemens AG 2010 All rights reserved

32

OpenPCS 7 Station / OPC Clients Version 1.0, Entry ID: 44444703

7 Operating the Application

7
7.1

Operating the Application


OPC clients
To be able to access OS process data with the OPC client Excel applications, the following prerequisites have to be fulfilled on the OS server. The OPCexp_Prj demo project has been selected PCS 7 OS is activated (Runtime) S7-PLCSIM is running or a controller (S7-400) is available.

7.1.1

OPC DA client
With the OPC DA client Excel application (Figure 7-1) OS variables can be read and written at runtime.

Figure 7-1

Copyright Siemens AG 2010 All rights reserved

Stations in sub net OS variable OPC interfaces Establish co nnecti on Discon nect conn ection Select varia ble a nd ad d to spreads heet Monitori ng vari abl es (onl ine) Simulate var iab len va lues (o nli ne) Remove a ll vari abl es from the spreads heet Server informati on Update rate i n mill iseco nds Time and date of the server Group name

Status

OpenPCS 7 Station / OPC Clients Version 1.0, Entry ID: 44444703

33

7 Operating the Application

Reading OS variables The description below describes the procedure for reading OS variables with the help of the OPC DA client.
Table 7-1 No. 1. 2. 3. 4. Instruction Open the "OPC-DA-HB.xls" file. Click the Delete Variables button. Select the computer name of your OpenPCS 7 station in the first drop-down list. Select "PCS7.OPCDAServer.1" in the second drop-down list. Delete Variables deletes the content of the spreadsheet. All computers which are in the same subnet are displayed. Comment

5.
Copyright Siemens AG 2010 All rights reserved

Click the "Connect DA" button. The active connection is displayed in the status bar by Connected.

6.

Click the "Open OPC DA Browser" button. The OPC DA browser dialog field is opened.

7.

In the tree from the left select OPCEXP:: > SIMATIC S7 Protocol Suite > Industrial Ethernet > S7Programm(1) > DASimulation/R_Count. In the list from the right select the DASimulation/R_Count.U variable and add this variable in the Excel spreadsheet by clicking on ADD. Close the OPC DA browser. Click the "Monitoring Variables" button. In the Excel table you will see the value of the "R_Count.U" process variable. This variable is polled cyclically. Each variable added by ADD is in the spreadsheet.

8. 9.

10.

To end the connection, click the Disconnect DA button.

34

OpenPCS 7 Station / OPC Clients Version 1.0, Entry ID: 44444703

7 Operating the Application

Figure 7-2

OPC DA Excel application

PCS 7 OS

Monitoring variables
Copyright Siemens AG 2010 All rights reserved

Writing OS variables The description below describes the procedure for writing OS variables with the help of the OPC DA client.
Table 7-2 No. 1. 2. 3. 4. Instruction Open the "OPC-DA-HB.xls" file. Delete the content of the spreadsheet by clicking the Delete Variables button. Select the computer name of the OpenPCS 7 station in the first drop-down list. Select "PCS7.OPCDAServer.1" in the second drop-down list. Delete Variables deletes the content of the spreadsheet. All available computers which are in the same subnet are displayed. Comment

5.

Click the "Connect DA" button. The active connection is displayed in the status bar by Connected.

OpenPCS 7 Station / OPC Clients Version 1.0, Entry ID: 44444703

35

7 Operating the Application

No. 6.

Instruction Click the "Open OPC DA Browser" button.

Comment

7.

Select OPCEXP:: > Internal tags> WriteReal in the tree on the left. In the list from the right select the WriteReal variable and add this variable in the Excel spreadsheet by clicking on ADD. Close the OPC DA browser. Enter the value 99 in the Write Value column and confirm this value by clicking the enter button. Click the Monitoring Variables button and afterwards Write Variables. The value 99 is displayed in the PCS 7 OS process screen. To end the connection, click the Disconnect DA button.

8. 9.
Copyright Siemens AG 2010 All rights reserved

10.

11.

You will see the simulated process value in the Excel table Figure 7-3. This value will be displayed in the PCS 7 OS process screen in the output field.

36

OpenPCS 7 Station / OPC Clients Version 1.0, Entry ID: 44444703

7 Operating the Application

Figure 7-3

OPC DA Excel application

PCS 7 OS

Write variables
Copyright Siemens AG 2010 All rights reserved

OpenPCS 7 Station / OPC Clients Version 1.0, Entry ID: 44444703

37

7 Operating the Application

7.1.2

OPC HDA client


With the OPC HDA client Excel application (Figure 7-4) you can read process value variables from the process value archive.

Figure 7-4

Stations in subnet

Aggregate activation Establishing connection Reading values OPC interfaces

Time range Day ahead Day back Time interval Server information

Copyright Siemens AG 2010 All rights reserved

Status

Selecting archive variable

Aggregate

Read values

The instruction below describes the procedure for reading process value variables from the process value archive with the help of the OPC HDA client.
Table 7-3 No. 1. 2. 3. Instruction Open the "OPC-HDA-HB.xls" file. Select the computer name of the OpenPCS 7 station in the first drop-down list. Select "PCS7.OPCHDAServer.1" in the second drop-down list. All computers which are in the same subnet are displayed. Comment

4.

Check the entered time range (e.g. 27-012010 00:00:00 to 27-01-2010 23:59:59).

Time ranges over several days are also possible.

38

OpenPCS 7 Station / OPC Clients Version 1.0, Entry ID: 44444703

7 Operating the Application

No. 5.

Instruction Check whether the Read Aggregates option field is enabled.

Comment If the Read Aggregates option field is not enabled, all values valid for the time rage (max. 65535) will be displayed in the spreadsheet. The preset time interval is 60 minutes.

6. 7.

Enter the time range in the "Interval in Minutes" input field. Connect yourself with the PCS 7 OPCHDA server via "Connect". The active connection is displayed in the status bar by Connected. In the list of aggregates select "03 OPCHDA_AVERAGE". In the bottom tree click OPCEXP:: > Archives > SystemArchive > I:OPCEXP::SystemArchive\DASimulati on/R_Count.U.

8.

9.

Copyright Siemens AG 2010 All rights reserved

10.

In the spreadsheet you will see the valid values of the R_Count.U process value variable for the time range at an interval of 60 minutes.

OpenPCS 7 Station / OPC Clients Version 1.0, Entry ID: 44444703

39

7 Operating the Application

7.1.3

OPC A&E client Alarms


With the OPC A&E client Excel application (Figure 7-5) OS alarms are displayed at runtime.

Figure 7-5 Alarms

Request server information OPC Alarm Server

Server information

Activate filter from preselection Preselecting filter Delete preselection

Delete filter liste Cycle Active filters Start of recording Recording stop Update data record Delete alarm list Go to first /last line Overwrite list

Copyright Siemens AG 2010 All rights reserved

Status

Spreadsheet alarms

Project structure

Alarms/warnings read

Displaying alarms Once you have opened the "OPC-A&E-HB.xls" OPC client Excel application execute the following steps to output the OS alarms.
Table 7-4 No. 1. 2. 3. 4. Instruction Select the Alarms tab. Click the "GetServer" button. Confirm the "Please Select an OpenPCS 7 Server" message box with "OK". Click the "PCS7.OPCAEServer.1" entry in the "Available A&E Server" list. Select the "OPCEXP_PRJ_OS::" entry in the Projects list. After the confirmation, the available alarm servers will be displayed. In the OPC A&E Server Properties field the information to the selected server is output. Comment

5.

40

OpenPCS 7 Station / OPC Clients Version 1.0, Entry ID: 44444703

7 Operating the Application

No. 6.

Instruction To start the recording, click the Subscribe button.

Comment

7.

You will see the alarms in the spreadsheet in chronological sequence from the beginning of the recording.

Using filters Execute the following steps to filter the alarms according to user-specific requirements.
Table 7-5 Filter settings No.
Copyright Siemens AG 2010 All rights reserved

Instruction Click the "Reaktor" entry in the "Areas" list.

Comment

1.

2.

Click the "DASimulation/R_Count" entry in the "Sources" list.

3.

By clicking the "SetFilterSources" button you will accept all the displayed Prepared Source Filter variables in the Active Source Filter.

4.

In the spreadsheet you will see the filtered alarms/warnings of the entered Sources in the Active Source Filter. If you would like to change the filter settings, click the NoFilter button and DeleteSourceList. Adjust the filters according to your requirements and execute the instruction steps 1 to 3 with changed Sources.

5.

OpenPCS 7 Station / OPC Clients Version 1.0, Entry ID: 44444703

41

7 Operating the Application

In Figure 7-6 you can see the same alarm in the PCS 7 OS process screen and in the OPC A&E Excel application.
Figure 7-6

OPC DA Excel application

PCS 7 OS

Copyright Siemens AG 2010 All rights reserved

Read alarms/warnings

42

OpenPCS 7 Station / OPC Clients Version 1.0, Entry ID: 44444703

7 Operating the Application

7.1.4

OPC A&E client Events


With the OPC A&E client Excel application (Figure 7-7 Events) operator messages (events) are displayed at runtime.

Figure 7-7 Events

Start of recording Recording stop

OPC Alarm&Event Server

Overview of event categories

Display event categories

Go to first/ last line Delete event list


Copyright Siemens AG 2010 All rights reserved

Status

Spreadsheet events Server information

Gelesenen Events

Displaying events Once you have opened the "OPC-A&E-HB.xls" OPC client Excel application execute the following steps to output the OS events.
Table 7-6 No. 1. 2. 3. 4. 5. Instruction Select the Events tab. Click the "Subscribe" button. Confirm the "Please Select an OpenPCS 7 Server" message box with "OK". Click the "PCS7.OPCAEServer.1" entry in the "Available A&E Server" list. In the spreadsheet you will see the events of the PCS 7 OS in process operation which have occurred since the "PCS7.OPCAEServer.1" was selected. By clicking the QueryEventCategory button, you will receive an overview of the event categories. After the confirmation, the available alarm servers will be displayed. In the OPC A&E Server Properties field the information to the selected server is output. Comment

6.

OpenPCS 7 Station / OPC Clients Version 1.0, Entry ID: 44444703

43

7 Operating the Application

No. 7.

Instruction The EventCategory of an upcoming event can be found in your spreadsheet by sliding the bottom scroll bar towards the right.

Comment

In Figure 7-8 you can see the events recorded by the Excel table from the PCS 7 OS process operation.
Figure 7-8

OPC DA Excel application

PCS 7 OS

Copyright Siemens AG 2010 All rights reserved

Read events

Change values

44

OpenPCS 7 Station / OPC Clients Version 1.0, Entry ID: 44444703

8 Reference

8
8.1

Reference
Bibliography
This list is by no means complete and only presents a selection of suitable literature.

Table 8-1 Subject /1/ PLC Title Automatisieren mit SPS - Theorie und Praxis Hans Gnter Wellenreuther, Dieter Zastrow Vieweg+Teubner ISBN 3-83480-231-X Automating with STEP7 in STL and SCL Hans Berger Wiley-VCH ISBN 3895782955 Datenkommunikation in der Prozessindustrie. Darstellung und anwendungsorientierte Analyse Udo Enste, Jochen Mller Oldenbourg Industrieverlag ISBN 978-3-8356-3116-8 OPC: Grundlagen, Implementierung und Anwendung Frank Iwanitz / Jrgen Lange Hthig Verlag, Heidelberg ISBN 3-7785-2903-X

/2/

STEP7

/3/

Industrial communication

Copyright Siemens AG 2010 All rights reserved

/4/

OPC

8.2

Internet Link Specifications


This list is by no means complete and only presents a selection of suitable information.

Table 8-2 Subject \1\ \2\ \3\ Reference to the entry Siemens I IA/DT Customer Support SIMATIC Process Control System PCS 7 Compendium Part A Configuration Guidelines SIMATIC Process Control System PCS 7 Compendium Part D Management and Maintenance SIMATIC Process Control System PCS 7 OpenPCS 7 SIMATIC Process Control System PCS 7 Engineering System (V7.1) SIMATIC Process Control System PCS 7 OPC A&E for PCS 7 (V7.1) Title
http://support.automation.siemens.com/WW/view/en/44444703 http://support.automation.siemens.com http://support.automation.siemens.com/WW/view/en/35016996

\4\

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

\5\ \6\ \7\

http://support.automation.siemens.com/WW/view/en/36183293 http://support.automation.siemens.com/WW/view/en/36050990 http://support.automation.siemens.com/WW/view/en/36052234

OpenPCS 7 Station / OPC Clients Version 1.0, Entry ID: 44444703

45

9 History

History
Table 9-1 Version V1.0 Date 16.08.2010 First issue Modification

Copyright Siemens AG 2010 All rights reserved

46

OpenPCS 7 Station / OPC Clients Version 1.0, Entry ID: 44444703