Applications & Tools
Answers for industry.
Cover
OPC Client Excel Applications for Data Access to PCS 7 OS Process Data via OpenPCS 7
SIMATIC PCS 7
Application Description August 2010
2 OpenPCS 7 Station / OPC Clients
Version 1.0, Entry ID: 44444703
Cop
yrig
ht ©
Sie
men
s AG
201
0 A
ll rig
hts r
eser
ved
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: [email protected]
OpenPCS 7 Station / OPC Clients Version 1.0, Entry ID: 44444703 3
Cop
yrig
ht ©
Sie
men
s AG
201
0 A
ll rig
hts r
eser
ved
s
SIMATIC PCS 7 OpenPCS 7 Station / OPC Clients
Automation Task 1
Automation Solution 2
Basics 3
Functional Mechanisms of this Application
4
Installation 5
Configuration 6
Operating the Application 7
Reference 8
History 9
Warranty and Liability
4 OpenPCS 7 Station / OPC Clients
Version 1.0, Entry ID: 44444703
Cop
yrig
ht ©
Sie
men
s A
G 2
010
All
right
s re
serv
ed
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.
Preface
OpenPCS 7 Station / OPC Clients Version 1.0, Entry ID: 44444703 5
Cop
yrig
ht ©
Sie
men
s A
G 2
010
All
right
s re
serv
ed
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: • Adjusting and using the PCS 7 sample configuration • Installation and configuration of the OpenPCS 7 station • Operation of the OPC client Excel applications
Table of Contents
6 OpenPCS 7 Station / OPC Clients
Version 1.0, Entry ID: 44444703
Cop
yrig
ht ©
Sie
men
s A
G 2
010
All
right
s re
serv
ed
Table of Contents
Warranty and Liability ................................................................................................. 4 Preface .......................................................................................................................... 5 1 Automation Task................................................................................................ 7 2 Automation Solution ......................................................................................... 8
2.1 Overview of the overall solution.................................................................. 8 2.2 Core functionality .......................................................................................... 9 2.3 Hardware and software components used ............................................... 9
3 Basics ............................................................................................................... 11 3.1 Checking the network connection ............................................................ 11 3.2 OpenPCS 7.................................................................................................. 12 3.3 VBA............................................................................................................... 13
4 Functional Mechanisms of this Application ................................................. 15 4.1 OpenPCS 7 / OPC client ........................................................................... 16 4.2 PCS 7 OS .................................................................................................... 17 4.3 Structure of the sample project................................................................. 18 4.3.1 AS Engineering ........................................................................................... 18 4.3.2 OS Engineering........................................................................................... 20
5 Installation........................................................................................................ 22 5.1 Hardware...................................................................................................... 22 5.2 Software ....................................................................................................... 23 5.2.1 OpenPCS 7.................................................................................................. 23 5.2.2 OPC clients.................................................................................................. 25 5.2.3 SIMATIC PCS 7 .......................................................................................... 25
6 Configuration ................................................................................................... 26 6.1 OpenPCS 7 / OPC client ........................................................................... 26 6.2 SIMATIC PCS 7 (with sample project) .................................................... 27 6.3 SIMATIC PCS 7 (without sample project) ............................................... 32
7 Operating the Application............................................................................... 33 7.1 OPC clients.................................................................................................. 33 7.1.1 OPC DA client ............................................................................................. 33 7.1.2 OPC HDA client .......................................................................................... 38 7.1.3 OPC A&E client “Alarms”........................................................................... 40 7.1.4 OPC A&E client “Events” ........................................................................... 43
8 Reference ......................................................................................................... 45 8.1 Bibliography ................................................................................................. 45 8.2 Internet Link Specifications ....................................................................... 45
9 History............................................................................................................... 46
1 Automation Task
OpenPCS 7 Station / OPC Clients Version 1.0, Entry ID: 44444703 7
Cop
yrig
ht ©
Sie
men
s A
G 2
010
All
right
s re
serv
ed
1 Automation Task Introduction
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.
Description The figure below provides an overview of the automation task.
Figure 1-1
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.
2 Automation Solution
8 OpenPCS 7 Station / OPC Clients
Version 1.0, Entry ID: 44444703
Cop
yrig
ht ©
Sie
men
s A
G 2
010
All
right
s re
serv
ed
2 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
Schematic layout The following figure gives a schematic overview of the most important components of the solution: Figure 2-1
Server System
Client System
OPC-Client
SIMATIC PCS 7 OS
OpenPCS 7 Station
S7-400
OPC DA (Data Access)OPC HDA (Historical Data Access)OPC A&E (Alarms & Events)
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
2 Automation Solution
OpenPCS 7 Station / OPC Clients Version 1.0, Entry ID: 44444703 9
Cop
yrig
ht ©
Sie
men
s A
G 2
010
All
right
s re
serv
ed
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
2.3 Hardware and software components used
The application was generated and tested with the following components:
Hardware components
Table 2-1
System Component Communication
OpenPCS 7 / OPC client SIMATIC PCS 7 ES/OS 547B Via terminal bus OS server SIMATIC PCS 7 ES/OS 547B 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 Component Note
PCS 7 V7.1 incl. OpenPCS 7 OpenPCS 7 is part of the SIMATIC PCS 7 V7.1 DVD. OpenPCS 7 / OPC client Microsoft Office Excel 2003
PCS 7 V7.1 incl. CFC Part of SIMATIC PCS 7 ES/OS 547B. OS server S7-PLCSIM License is not part of the SIMATIC PCS 7 ES/OS 547B.
2 Automation Solution
10 OpenPCS 7 Station / OPC Clients
Version 1.0, Entry ID: 44444703
Cop
yrig
ht ©
Sie
men
s A
G 2
010
All
right
s re
serv
ed
Sample files and projects The following list contains all relevant files that are used in this application example.
Table 2-3
System Component Note
OpenPCS 7 / OPC client
OPC-DA-HB.xls OPC-HDA-HB.xls OPC-A&E-HB.xls
OPC client Excel example applications for OPC DA, OPC HDA and OPC A&E data access.
OS server Opce_mp.zip PCS 7 sample project
3 Basics
OpenPCS 7 Station / OPC Clients Version 1.0, Entry ID: 44444703 11
Cop
yrig
ht ©
Sie
men
s A
G 2
010
All
right
s re
serv
ed
3 Basics
3.1 Checking the network connection
Legend 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. Instruction Comment
1. Open the Windows explorer on the OS server.
2. In the explorer, enter the target directory, e.g. “\\Computer Name\Automation Projects\” or “\\IP Address\Automation Projects\”.
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.
3 Basics
12 OpenPCS 7 Station / OPC Clients
Version 1.0, Entry ID: 44444703
Cop
yrig
ht ©
Sie
men
s A
G 2
010
All
right
s re
serv
ed
Figure 3-1
Access to\\ES21\Automation Projects\ share file
Yes
Net accesssuccessful
No
Write accesssuccessful
Yes
No
Copy and open\\ES21\Automation Projects\
test file in the share file
The share path is working and can be entered for the OpenPCS 7 station
in the SPOSA application.
Adjust the write and read rights on the ES21 for the share file
Check the computer name and if necessary replace the computer name by the IP address of
the ES 21.
Was the share file created on ES 21?
Check the generalnetwork setup, e.g. workgroup, subnet,
general access to computer, etc.
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.
3 Basics
OpenPCS 7 Station / OPC Clients Version 1.0, Entry ID: 44444703 13
Cop
yrig
ht ©
Sie
men
s A
G 2
010
All
right
s re
serv
ed
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. Instruction Comment
1. Open an OPC client Excel application, e.g. "OPC-DA-HB.xls".
2. In the menu, select “Tools > Macro > Visual Basic Editor”.
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.
3 Basics
14 OpenPCS 7 Station / OPC Clients
Version 1.0, Entry ID: 44444703
Cop
yrig
ht ©
Sie
men
s A
G 2
010
All
right
s re
serv
ed
To select the Type Library for each OPC client Excel application, proceed as described in the instruction.
Table 3-3
No. Instruction Comment
1. Open the Visual Basic Editor as described in Table 3-2.
2. Select “Tools > References…” in the menu.
3. 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
4 Functional Mechanisms of this Application
OpenPCS 7 Station / OPC Clients Version 1.0, Entry ID: 44444703 15
Cop
yrig
ht ©
Sie
men
s A
G 2
010
All
right
s re
serv
ed
4 Functional Mechanisms of this Application General overview
Figure 4-1
ES25
ES21
OPC-Client
SIMATIC PCS 7 ES/OS
OpenPCS 7 Station
OPC DA (Data Access)OPC HDA (Historical Data Access)OPC A&E (Alarms & Events)
IP-Adress:172.20.1.25
IP-Adress:172.20.1.21
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
4 Functional Mechanisms of this Application
16 OpenPCS 7 Station / OPC Clients
Version 1.0, Entry ID: 44444703
Cop
yrig
ht ©
Sie
men
s A
G 2
010
All
right
s re
serv
ed
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: • 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
Note Further information on OPC DA, OPC HDA and OPC A&E can be found on the manufacturer’s site http://www.opcfoundation.org.
4 Functional Mechanisms of this Application
OpenPCS 7 Station / OPC Clients Version 1.0, Entry ID: 44444703 17
Cop
yrig
ht ©
Sie
men
s A
G 2
010
All
right
s re
serv
ed
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 • 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.
4 Functional Mechanisms of this Application
18 OpenPCS 7 Station / OPC Clients
Version 1.0, Entry ID: 44444703
Cop
yrig
ht ©
Sie
men
s A
G 2
010
All
right
s re
serv
ed
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
As AS hardware, the CPU 417-4 is configured with the corresponding CP 443-1 Ethernet.
4 Functional Mechanisms of this Application
OpenPCS 7 Station / OPC Clients Version 1.0, Entry ID: 44444703 19
Cop
yrig
ht ©
Sie
men
s A
G 2
010
All
right
s re
serv
ed
NetPro In Figure 4-6 you can see the connection configuration in NetPro. Figure 4-6
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
4 Functional Mechanisms of this Application
20 OpenPCS 7 Station / OPC Clients
Version 1.0, Entry ID: 44444703
Cop
yrig
ht ©
Sie
men
s A
G 2
010
All
right
s re
serv
ed
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
4 Functional Mechanisms of this Application
OpenPCS 7 Station / OPC Clients Version 1.0, Entry ID: 44444703 21
Cop
yrig
ht ©
Sie
men
s A
G 2
010
All
right
s re
serv
ed
WinCC Runtime In Figure 4-9 you can see the visualization of the sample project in process operation (WinCC Runtime). Figure 4-9
5 Installation
22 OpenPCS 7 Station / OPC Clients
Version 1.0, Entry ID: 44444703
Cop
yrig
ht ©
Sie
men
s A
G 2
010
All
right
s re
serv
ed
5 Installation
5.1 Hardware
The figure below shows the hardware setup of the application. Figure 5-1
ES25
ES21
OPC-Client
SIMATIC PCS 7 ES/OS
OpenPCS 7 Station
OPC DA (Data Access)OPC HDA (Historical Data Access)OPC A&E (Alarms & Events)
IP-Adresse:172.20.1.25
IP-Adresse:172.20.1.21
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 Login name Password IP Address Subnet
21 Administrator 12345 172.20.1.21 255.255.0.0 25 Administrator 12345 172.20.1.25 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
5 Installation
OpenPCS 7 Station / OPC Clients Version 1.0, Entry ID: 44444703 23
Cop
yrig
ht ©
Sie
men
s A
G 2
010
All
right
s re
serv
ed
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. Instruction Comment
1 Start the “Setup.exe” installation program from the “PCS 7 V7.1 Toolset” DVD.
2 Select a setup language. All installation steps are displayed in the selected setup language.
3 Close all opened programs and proceed with the
installation.
4 Read the product notice and click the "Next" button.
5 Installation
24 OpenPCS 7 Station / OPC Clients
Version 1.0, Entry ID: 44444703
Cop
yrig
ht ©
Sie
men
s A
G 2
010
All
right
s re
serv
ed
No. Instruction Comment
5 Read the license agreement. By clicking the "Next" button you accept the license agreements.
6 Select the "Install" setup type and click the "Next"
button. The “Update” option is available if you have a STEP 7 or PCS 7 installation.
7 Enter the user information and click the "Next" button.
8 Select the package installation and click the "Next" button.
9 Select the "OpenPCS 7" program package and click the "Next" button.
10. Check the selected components to be installed and
then click the "Next" button.
11 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“.
5 Installation
OpenPCS 7 Station / OPC Clients Version 1.0, Entry ID: 44444703 25
Cop
yrig
ht ©
Sie
men
s A
G 2
010
All
right
s re
serv
ed
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.
Note Information regarding the installation prerequisites and installation of Microsoft Office Excel 2003 can be found on the manufacturer’s site and on the installation CD.
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.
ATTENTION The S7-PLCSIM license is not part of the PCS7 ES/OS 547B and has to be purchased separately.
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
6 Configuration
26 OpenPCS 7 Station / OPC Clients
Version 1.0, Entry ID: 44444703
Cop
yrig
ht ©
Sie
men
s A
G 2
010
All
right
s re
serv
ed
6 Configuration
6.1 OpenPCS 7 / OPC client
Security settings in Microsoft Office Excel 2003 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.
Table 6-1
No. Instruction Comment
1. Open an OPC client Excel application.
2. Open “Tools > Macro > Security” in the menu.
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.
6 Configuration
OpenPCS 7 Station / OPC Clients Version 1.0, Entry ID: 44444703 27
Cop
yrig
ht ©
Sie
men
s A
G 2
010
All
right
s re
serv
ed
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. Instruction Comment
1. Retrieve the Opce_mp.zip sample project in the SIMATIC manager.
2. Adjust the name of the PC Station (OSServer) in the “Object Properties…”.
3. Enter the name of your computer and tick
“Computer name identical to PC station name”.
6 Configuration
28 OpenPCS 7 Station / OPC Clients
Version 1.0, Entry ID: 44444703
Cop
yrig
ht ©
Sie
men
s A
G 2
010
All
right
s re
serv
ed
No. Instruction Comment
4. 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.
5. Continuation of the instruction for adjusting the
OS computer name. - Confirm the “The configured server is not available...” dialog with “Yes”.
6. 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.
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.
6 Configuration
OpenPCS 7 Station / OPC Clients Version 1.0, Entry ID: 44444703 29
Cop
yrig
ht ©
Sie
men
s A
G 2
010
All
right
s re
serv
ed
No. Instruction Comment
9. Make a right mouse click on the OS and select the “Generate server data” menu.
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.
11. Confirm the “OS server assignment for
OPCServer” dialog with “OK“.
12. Open the object properties of the OPCServer by clicking the right mouse button on the OPCServer and select the “Object Properties…” menu.
6 Configuration
30 OpenPCS 7 Station / OPC Clients
Version 1.0, Entry ID: 44444703
Cop
yrig
ht ©
Sie
men
s A
G 2
010
All
right
s re
serv
ed
No. Instruction Comment
13. 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“.
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.
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. Instruction Comment
1. Select “Options > Simulate Modules” in the menu. The dialog window of S7-PLCSIM is opened.
6 Configuration
OpenPCS 7 Station / OPC Clients Version 1.0, Entry ID: 44444703 31
Cop
yrig
ht ©
Sie
men
s A
G 2
010
All
right
s re
serv
ed
No. Instruction Comment
2. Select the “Open project from a file” option in the “Open Project” dialog.
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. Instruction Comment
1. Make a right mouse click on the OS and select the “Open Object” menu.
2. To activate the OS (WinCC Runtime), select
“File > Activate” in the WinCCExplorer menu.
6 Configuration
32 OpenPCS 7 Station / OPC Clients
Version 1.0, Entry ID: 44444703
Cop
yrig
ht ©
Sie
men
s A
G 2
010
All
right
s re
serv
ed
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
7 Operating the Application
OpenPCS 7 Station / OPC Clients Version 1.0, Entry ID: 44444703 33
Cop
yrig
ht ©
Sie
men
s A
G 2
010
All
right
s re
serv
ed
7 Operating the Application 7.1 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
OS variable
Status
Stations in subnetOPC interfacesEstablish connectionDisconnect connectionSelect variable and add to spreads heetMonitoring variables (onl ine)Simulate var iablen values (online)Remove all variables from the spreads heetServer informationUpdate rate in mill isecondsTime and date of the serverGroup name
7 Operating the Application
34 OpenPCS 7 Station / OPC Clients
Version 1.0, Entry ID: 44444703
Cop
yrig
ht ©
Sie
men
s A
G 2
010
All
right
s re
serv
ed
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. Instruction Comment
1. Open the "OPC-DA-HB.xls" file.
2. Click the “Delete Variables” button. “Delete Variables” deletes the content of the spreadsheet.
3. Select the computer name of your OpenPCS 7 station in the first drop-down list.
All computers which are in the same subnet are displayed.
4. Select "PCS7.OPCDAServer.1" in the second drop-down list.
5. 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 > S7-Programm(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“.
8. Close the OPC DA browser. Each variable added by “ADD” is in the spreadsheet.
9. 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.
10. To end the connection, click the “Disconnect DA” button.
7 Operating the Application
OpenPCS 7 Station / OPC Clients Version 1.0, Entry ID: 44444703 35
Cop
yrig
ht ©
Sie
men
s A
G 2
010
All
right
s re
serv
ed
Figure 7-2
Monitoring variables
OPC DA Excel application PCS 7 OS
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. Instruction Comment
1. Open the "OPC-DA-HB.xls" file.
2. Delete the content of the spreadsheet by clicking the “Delete Variables” button.
“Delete Variables” deletes the content of the spreadsheet.
3. Select the computer name of the OpenPCS 7 station in the first drop-down list.
All available computers which are in the same subnet are displayed.
4. Select "PCS7.OPCDAServer.1" in the second drop-down list.
5. Click the "Connect DA" button.
The active connection is displayed in the status bar by “Connected”.
7 Operating the Application
36 OpenPCS 7 Station / OPC Clients
Version 1.0, Entry ID: 44444703
Cop
yrig
ht ©
Sie
men
s A
G 2
010
All
right
s re
serv
ed
No. Instruction Comment
6. Click the "Open OPC DA Browser" button.
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“.
8. Close the OPC DA browser.
9. Enter the value “99” in the “Write Value” column and confirm this value by clicking the enter button.
10. Click the “Monitoring Variables” button and afterwards “Write Variables”. The value “99” is displayed in the PCS 7 OS process screen.
11. To end the connection, click the “Disconnect DA” button.
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.
7 Operating the Application
OpenPCS 7 Station / OPC Clients Version 1.0, Entry ID: 44444703 37
Cop
yrig
ht ©
Sie
men
s A
G 2
010
All
right
s re
serv
ed
Figure 7-3
Write variables
OPC DA Excel application PCS 7 OS
7 Operating the Application
38 OpenPCS 7 Station / OPC Clients
Version 1.0, Entry ID: 44444703
Cop
yrig
ht ©
Sie
men
s A
G 2
010
All
right
s re
serv
ed
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
Status
Server information
Stations in subnet OPC interfaces Establishing connection Reading values
Time range
Read valuesSelecting archive variable Aggregate
Day ahead Day back
Aggregate activation
Time interval
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. Instruction Comment
1. Open the "OPC-HDA-HB.xls" file. 2. Select the computer name of the OpenPCS 7
station in the first drop-down list. All computers which are in the same subnet are displayed.
3. Select "PCS7.OPCHDAServer.1" in the second drop-down list.
4. Check the entered time range (e.g. 27-01-
2010 00:00:00 to 27-01-2010 23:59:59). Time ranges over several days are also possible.
7 Operating the Application
OpenPCS 7 Station / OPC Clients Version 1.0, Entry ID: 44444703 39
Cop
yrig
ht ©
Sie
men
s A
G 2
010
All
right
s re
serv
ed
No. Instruction Comment
5. Check whether the “Read Aggregates” option field is enabled.
If the “Read Aggregates” option field is not enabled, all values valid for the time rage (max. 65535) will be displayed in the spreadsheet.
6. Enter the time range in the "Interval in Minutes" input field.
The preset time interval is 60 minutes.
7. Connect yourself with the PCS 7 OPCHDA server via "Connect". The active connection is displayed in the status bar by “Connected”.
8. In the list of aggregates select "03 OPCHDA_AVERAGE".
9. In the bottom tree click “OPCEXP:: > Archives > SystemArchive > I:OPCEXP::SystemArchive\DASimulation/R_Count.U”.
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.
7 Operating the Application
40 OpenPCS 7 Station / OPC Clients
Version 1.0, Entry ID: 44444703
Cop
yrig
ht ©
Sie
men
s A
G 2
010
All
right
s re
serv
ed
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
Status
Server informationRequest server informationOPC Alarm Server Preselecting filter
Alarms/warnings readSpreadsheet alarms
Delete preselection
Cycle
Activate filter from preselection
Active filters
Start of recordingRecording stop
Update data recordDelete alarm list
Go to first /last lineOverwrite list
Delete filter liste
Project structure
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. Instruction Comment
1. Select the “Alarms” tab.
2. Click the "GetServer" button. 3. Confirm the "Please Select an OpenPCS 7
Server" message box with "OK". After the confirmation, the available alarm servers will be displayed.
4. Click the "PCS7.OPCAEServer.1" entry in the "Available A&E Server" list.
In the “OPC A&E Server Properties” field the information to the selected server is output.
5. Select the "OPCEXP_PRJ_OS::" entry in the “Projects“ list.
7 Operating the Application
OpenPCS 7 Station / OPC Clients Version 1.0, Entry ID: 44444703 41
Cop
yrig
ht ©
Sie
men
s A
G 2
010
All
right
s re
serv
ed
No. Instruction Comment
6. To start the recording, click the “Subscribe” button.
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. Instruction Comment
1. Click the "Reaktor" entry in the "Areas" list.
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“.
5. 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”.
7 Operating the Application
42 OpenPCS 7 Station / OPC Clients
Version 1.0, Entry ID: 44444703
Cop
yrig
ht ©
Sie
men
s A
G 2
010
All
right
s re
serv
ed
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
Readalarms/warnings
OPC DA Excel application PCS 7 OS
7 Operating the Application
OpenPCS 7 Station / OPC Clients Version 1.0, Entry ID: 44444703 43
Cop
yrig
ht ©
Sie
men
s A
G 2
010
All
right
s re
serv
ed
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
Status
Display event categories
Start of recording
Recording stop
Overview of event categories
Gelesenen EventsSpreadsheet events
OPC Alarm&Event Server
Delete event list
Go to first/last line
Server information
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. Instruction Comment
1. Select the “Events” tab.
2. Click the "Subscribe" button.
3. Confirm the "Please Select an OpenPCS 7 Server" message box with "OK".
After the confirmation, the available alarm servers will be displayed.
4. Click the "PCS7.OPCAEServer.1" entry in the "Available A&E Server" list.
In the “OPC A&E Server Properties” field the information to the selected server is output.
5. 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.
6. By clicking the “QueryEventCategory” button, you will receive an overview of the event categories.
7 Operating the Application
44 OpenPCS 7 Station / OPC Clients
Version 1.0, Entry ID: 44444703
Cop
yrig
ht ©
Sie
men
s A
G 2
010
All
right
s re
serv
ed
No. Instruction Comment
7. The “EventCategory” of an upcoming event can be found in your spreadsheet by sliding the bottom scroll bar towards the right.
In Figure 7-8 you can see the events recorded by the Excel table from the PCS 7 OS process operation.
Figure 7-8
Change values
OPC DA Excel application PCS 7 OS
Read events
8 Reference
OpenPCS 7 Station / OPC Clients Version 1.0, Entry ID: 44444703 45
Cop
yrig
ht ©
Sie
men
s A
G 2
010
All
right
s re
serv
ed
8 Reference 8.1 Bibliography
This list is by no means complete and only presents a selection of suitable literature.
Table 8-1
Subject Title
/1/ PLC Automatisieren mit SPS - Theorie und Praxis Hans Günter Wellenreuther, Dieter Zastrow Vieweg+Teubner ISBN 3-83480-231-X
/2/ STEP7 Automating with STEP7 in STL and SCL Hans Berger Wiley-VCH ISBN 3895782955
/3/ Industrial communication
Datenkommunikation in der Prozessindustrie. Darstellung und anwendungsorientierte Analyse Udo Enste, Jochen Müller Oldenbourg Industrieverlag ISBN 978-3-8356-3116-8
/4/ OPC OPC: Grundlagen, Implementierung und Anwendung Frank Iwanitz / Jürgen Lange Hüthig Verlag, Heidelberg ISBN 3-7785-2903-X
8.2 Internet Link Specifications
This list is by no means complete and only presents a selection of suitable information.
Table 8-2
Subject Title
\1\ Reference to the entry http://support.automation.siemens.com/WW/view/en/44444703
\2\ Siemens I IA/DT Customer Support
http://support.automation.siemens.com
\3\ SIMATIC Process Control System PCS 7 Compendium Part A – Configuration Guidelines
http://support.automation.siemens.com/WW/view/en/35016996
\4\ SIMATIC Process Control System PCS 7 Compendium Part D – Management and Maintenance
http://support.automation.siemens.com/WW/view/en/43410843
\5\ SIMATIC Process Control System PCS 7 OpenPCS 7
http://support.automation.siemens.com/WW/view/en/36183293
\6\ SIMATIC Process Control System PCS 7 Engineering System (V7.1)
http://support.automation.siemens.com/WW/view/en/36050990
\7\ SIMATIC Process Control System PCS 7 OPC A&E for PCS 7 (V7.1)
http://support.automation.siemens.com/WW/view/en/36052234
9 History
46 OpenPCS 7 Station / OPC Clients
Version 1.0, Entry ID: 44444703
Cop
yrig
ht ©
Sie
men
s A
G 2
010
All
right
s re
serv
ed
9 History Table 9-1
Version Date Modification
V1.0 16.08.2010 First issue