P03-02 - Vertical Integration With OPC - V8.1 - S0915 - EN
P03-02 - Vertical Integration With OPC - V8.1 - S0915 - EN
P03-02 - Vertical Integration With OPC - V8.1 - S0915 - EN
PA Module P03-02
SIMATIC PCS 7 –
Vertical Integration with OPC
Unrestricted for Educational and R&D Facilities. © Siemens AG 2015. All Rights Reserved.
SCE Training Curriculum | PA Modul P03-02, Edition 09/2015 | Digital Factory, DF FA
Please note that these trainer packages may be replaced with subsequent packages.
An overview of the available SCE packages is provided at: siemens.com/sce/tp
Continuing education
For regional Siemens SCE continuing education, contact your regional SCE contact partner.
siemens.com/sce/contact
Note on Usage
The training curriculum for the integrated automation solution Totally Integrated Automation (TIA) was
prepared for the program "Siemens Automation Cooperates with Education (SCE)“ specifically for training
purposes at public educational and R&D facilities. Siemens AG is not liable for the contents.
This document may only be used for initial training on Siemens products/systems. This means it may be
copied entirely or partially and handed to trainees for use within the scope of their training. Passing on or
copying this document and communicating its contents is permitted within public training and continuing
education facilities for training purposes.
Exceptions require written permission by Siemens AG. Contact person: Roland Scheuerer
[email protected].
Violators are subject to damages. All rights including translation rights are reserved, particularly in the
event a patent is granted or a utility model or design is registered.
Usage for industrial customer courses is explicitly not permitted. We do not agree to the commercial
utilization of these documents.
We would like to thank the Technical University Dresden, particularly Prof. Dr. Leon Urbas and Annett
Krause, MS, as well as the Michael Dziallas Engineering Corporation and those who provided support in
preparing this SCE training document.
Unrestricted for Educational and R&D Facilities. © Siemens AG 2015. All Rights Reserved. 2
P03-02_Vertical Integration with OPC_V8.1_S0915_EN.docx
SCE Training Curriculum | PA Modul P03-02, Edition 09/2015 | Digital Factory, DF FA
THEORY IN BRIEF
OLE for Process Control (OPC) provides a standard mechanism for communication with a
variety of data sources. It makes no difference in this case whether these sources are
machines in your factory, or a database in your control center. OPC is based on the
OLE/COM technology by Microsoft.
By means of an OPC server, data can be exchanged with external systems without
knowledge of the topology and a PCS 7 OS installation being required.
From the view of the user programs generated in higher level programming languages
such as C++ and Visual Basic, OPC is a bridge to the process data and the device data of
the automation systems. For the device manufacturers, the development of an OPC server
is necessary instead of special drivers. For software developers it is of advantage:
applications can be written independent of the device. Users in turn have more freedom
regarding the selection of devices and software products [1].
Unrestricted for Educational and R&D Facilities. © Siemens AG 2015. All Rights Reserved. 3
P03-02_Vertical Integration with OPC_V8.1_S0915_EN.docx
SCE Training Curriculum | PA Modul P03-02, Edition 09/2015 | Digital Factory, DF FA
THEORY
INTRODUCTION
OPC provides a standardized, open and manufacturer-independent software interface for
integrated data communication between automation systems and MS Windows
applications with OPC capability. OPC has developed into a de-facto standard for
interfacing automation systems by different manufacturers with higher level programs of
the plant control level for
– Process visualization (monitoring of individual product lines with cross data traffic)
– Integrated management (ordering, quality control, maintenance, material management,
production planning)
The software interface OPC is based on the Windows technologies COM (Component
Object Model) and DCOM (Distributed Component Object Model). OPC XML on the other
hand is based on the internet standards XML, SOAP and http. COM is the Microsoft
protocol standard for communication between objects that are located on one computer but
in different programs. With DCOM, COM was expanded with the capability to access
objects beyond computer boundaries. This basis makes possible standardized data
exchange between applications from industry, office and manufacturing. Communication
via DCOM is limited to local networks. Data exchange by means of XML uses the protocol
SOAP (Simple Object Access Protocol). SOAP is an XML based protocol that is
independent of the platform. With SOAP, applications on the Internet or in heterogeneous
computer networks can communicate with each other by means of HTTP (HyperText
Transfer Protocol).
The OPC Foundation defined the standard for the OPC interface. Leading corporations in
industry automation comprise the OPC Foundation. The OPC servers of the OS system
support the following specifications:
– OPC Data Access 1.0, 2.05a and 3.0
– OPC XML Data Access 1.01
– OPC Historical Data Access 1.20
– OPC Alarm & Events 1.10
CLIENT-SERVER PRINCIPLE
OPC communication is based on the client server principle (refer to
Figure 2). The client takes the initiative and makes a request to the server (service
provider). The server replies, executes or supplies. The connection structure needed for
this always emanates from the OPC client. The advantage of such a communication
scheme is that only the clients have to "know" the server.
The OPC server can access the process data of the automation system.
OPC Server
The OPC software component that provides data when an OPC client requests it is called
OPC server. The server has to be installed on the PC since OPC specific entries are
required in the Windows registry. “Upwards“, the OPC server supports the interface
specification Data Access; “downwards” it is connected through a lower level
communication network with the connected automation system as the actual data source.
Unrestricted for Educational and R&D Facilities. © Siemens AG 2015. All Rights Reserved. 4
P03-02_Vertical Integration with OPC_V8.1_S0915_EN.docx
SCE Training Curriculum | PA Modul P03-02, Edition 09/2015 | Digital Factory, DF FA
OPC-Client
OPC-Server
• Executes client requests
• Reads the process variables
• Monitored process variables
OPC-Server
Automation equipment
• PLC (process values)
OPC Client
OPC components that use an OPC server as data source are called OPC clients. An
OPC client is, as a rule, part of the user program that has to be configured. To this end, two
OPC interfaces are available:
– The custom interface (customer specific interface) for programming languages that
address interfaces with the function pointer principle, such as C/C++
– The automation interface for programming languages that address interfaces with
object names, such as Visual Basic
OPC SPECIFICATION
OPC Data Access (OPC DA)
Data Access is an OPC specification used to access process data by means of variables.
OPC servers for Data Access manage the process variables and the different access
capabilities to these variables. This allows the OPC server:
– To read the value of one or several process variables
– To change the value of one or several process variables by writing a new value
– To monitor the value of one or several process variables
– To signal value changes
Unrestricted for Educational and R&D Facilities. © Siemens AG 2015. All Rights Reserved. 5
P03-02_Vertical Integration with OPC_V8.1_S0915_EN.docx
SCE Training Curriculum | PA Modul P03-02, Edition 09/2015 | Digital Factory, DF FA
Process variables are place holders for values that currently have to be determined. The
OPC specification defines the interface between client and server programs for managing
the process data. Data Access servers make the transparent access to the most varied
data sources (for example, temperature sensor) and data sinks (for example, control
systems) possible for one or several Data Access clients. These data sources and data
sinks can be located on IO cards inserted directly into the PC, but they can also be on any
device such as controllers, input/output modules, etc., that are connected by means of
serial connections or field busses. A Data Access client can also access several Data
Access servers at the same time.
Data Access clients can be very simple Excel sheets or extensive programs (for example,
Visual Basic). Data Access clients in turn can be part of larger programs.
OPC Data Access Class Model
When the client accesses data, the hierarchical class model of Data Access assists in
adapting the time effort and the result of the content to the current requirements of the
application. Data Access differentiates three classes:
– OPC server
– OPC group
– OPC item
OPC-Server
The client application uses COM calls of the operating system only to generate an object of
the class OPC server. The other objects are generated by means of corresponding OPC
methods of the class OPC server or lower level classes.
The highest class is the OPC server. Every OPC server belongs to this class. This class
represents the access for all other services of the Data Access server. With the aid of class
specific attributes, information about the status, the version and (optional) the name space
of the available process variables can be obtained. Objects of the class OPC server
manage the instances of the lower level class OPC Group.
The class OPC group is directly subordinated to the class OPC server and structures the
process variables utilized by the OPC server. The OPC client is able to use several objects
of this class simultaneously. With the aid of the objects of OPC group, the client can
generate useful units of process variables and perform operations with them. For example,
all process variables of a screen page of the operator interface can be combined into one
group. The class OPC group defines methods that can be used to read and write the
values of the process variables.
Unrestricted for Educational and R&D Facilities. © Siemens AG 2015. All Rights Reserved. 6
P03-02_Vertical Integration with OPC_V8.1_S0915_EN.docx
SCE Training Curriculum | PA Modul P03-02, Edition 09/2015 | Digital Factory, DF FA
The class OPC item represents the actual process variable and allows for polling
individual data. Each variable is an element (item) in the OPC server’s name space and is
identified with an item ID. The item ID is specified by the manufacturer of the server and
has to be unique within the server’s name space. Each value has the following properties:
– Value
The last recorded value of the variable
– Quality
How meaningful is the value. If the quality is good, it was possible to determine the
value with surety
– Timestamp
Point in time when the current value of the variable was determined. With each value
change indicated to the client, the time stamp is updated. If the value of the variable
does not change, the timestamp remains the same also.
Variables have to be specified when the OPC interface is called to obtain process values.
By indicating variables, the client is able to request the needed values from the server. The
client has to sign up every requested variable at the server to specify the variables that are
to be read. Variables can be read and written synchronously as well as asynchronously.
The client can transfer the monitoring of variables to the server. If the value of a variable
changes, the server sends a corresponding message to the client. The variables provided
by the OPC server can be subdivided into:
– Process variables
represent measured and control variables of input/output devices
– Control variables
Using these variables triggers certain supplementary services, such as the
transmission of pass words
– Information variables
These variables are made available by the communication system and by the OPC
server and provide information about the state of connections, devices, etc..
Below a few examples of the variables of an OPC Data Access server:
– Control variables of a PLC
– Data of a measurement data acquisition system
– Status variables of the communication system
Unrestricted for Educational and R&D Facilities. © Siemens AG 2015. All Rights Reserved. 7
P03-02_Vertical Integration with OPC_V8.1_S0915_EN.docx
SCE Training Curriculum | PA Modul P03-02, Edition 09/2015 | Digital Factory, DF FA
Unrestricted for Educational and R&D Facilities. © Siemens AG 2015. All Rights Reserved. 8
P03-02_Vertical Integration with OPC_V8.1_S0915_EN.docx
SCE Training Curriculum | PA Modul P03-02, Edition 09/2015 | Digital Factory, DF FA
OPC client
(for example, operator control and monitoring system)
Vendor-neutral
OPC interface
OPC server for SIMATIC NET
Data access Alarms & Events
Communication network
from SIMATIC NET
Figure 5: OPC Server for SIMATIC NET with OPC Client [2]
Unrestricted for Educational and R&D Facilities. © Siemens AG 2015. All Rights Reserved. 9
P03-02_Vertical Integration with OPC_V8.1_S0915_EN.docx
SCE Training Curriculum | PA Modul P03-02, Edition 09/2015 | Digital Factory, DF FA
OPEN PCS 7
OpenPCS 7 was developed for use on multi-user systems. By means of a separate PC
station with OpenPCS 7 (OpenPCS 7 station), data can be exchanged with external
systems without knowledge of the topology and without a PCS 7 OS installation being
necessary. This server collects from existing OS server systems the data via OPC and
makes it available in a concentrated form. For that reason, OpenPCS 7 can be used
exclusively on multi-user systems.
OpenPCS 7 can be used for data exchange with the following levels:
– Automation level
– Plant control and production level
– MES level (Manufacturing Execution Systems)
– ERP level (Enterprise Resource Planning)
LITERATURE
[1] Wellenreuther, G.: Zastrow, D. (2009) Automatisieren mit SPS (4. Auflage). Vieweg +
Teubner. (Automating with PLC)
[2] SIEMENS (2010): SIMATIC NET: Industrial Communication with PG/PC Volume 1 -
Basics System Manual. C79000-G8976-C172-09.
(http://support.automation.siemens.com/WW/view/en/42783968)
[3] SIEMENS (2015): Process Control System PCS7: Engineering System (V8.1).
A5E32712311-AC. (http://support.automation.siemens.com/WW/view/en/90663380)
Unrestricted for Educational and R&D Facilities. © Siemens AG 2015. All Rights Reserved. 10
P03-02_Vertical Integration with OPC_V8.1_S0915_EN.docx
SCE Training Curriculum | PA Modul P03-02, Edition 09/2015 | Digital Factory, DF FA
TRAINING OBJECTIVE
In this chapter, the student learns:
– Diagnosis of the local OPC servers with the OPC Scout V10
– Display of variables available via OPC in OPC Scout V10
– Settings in Excel for OPC access to the variables provided in WinCC
– Test of a Microsoft Excel application with access to variables of WinCC via OPC
These instructions are based on the project ‘PCS7_SCE_0301_Ueb_R1504_en.zip’ and
the Microsoft Excel file ‘PCS7_SCE_0302_OPC_Template_R1305_en.xls‘.
PROGRAMMING
1. After opening the exercise project from chapter “Advanced Layouts for UIs P03-01“,
start PLCSIM and in the ‘Plant View’ Compile and Download Objects of the project is
opened. ( SCE_PCS7_Prj PLC Compile and Download Objects)
Unrestricted for Educational and R&D Facilities. © Siemens AG 2015. All Rights Reserved. 11
P03-02_Vertical Integration with OPC_V8.1_S0915_EN.docx
SCE Training Curriculum | PA Modul P03-02, Edition 09/2015 | Digital Factory, DF FA
2. Before you 'Start’ the compilation, make sure the S7-PLCSIM is in STOP mode.
Everything is compiled and downloaded regarding the charts. Regarding the OS,
compile without ‘Memory reset’. ( Start)
( Activate)
Unrestricted for Educational and R&D Facilities. © Siemens AG 2015. All Rights Reserved. 12
P03-02_Vertical Integration with OPC_V8.1_S0915_EN.docx
SCE Training Curriculum | PA Modul P03-02, Edition 09/2015 | Digital Factory, DF FA
6. In the OPC Scout V10, diagnostic data for the different OPC servers of the local PC is
displayed. If it is not possible to set up the connection to a certain server, this is
indicated as an error.
Unrestricted for Educational and R&D Facilities. © Siemens AG 2015. All Rights Reserved. 13
P03-02_Vertical Integration with OPC_V8.1_S0915_EN.docx
SCE Training Curriculum | PA Modul P03-02, Edition 09/2015 | Digital Factory, DF FA
7. The WinCC server is called ‘OPCServer.WinCC’. Below this server, a file structure can
be opened down to the CFC blocks that allow monitoring. In this example, we selected
the block ‘Monitor_A1T2L001’ to display the level of Reactor R001.
( OPCServer.WinCC @LOCALMACHINE SIMATIC S7 Protocol Suite TCP/IP
S7 Program A1_multipurpose_plant/T2_reaction/reactor$R001/A1T2L001/
Monitor_A1T2L001)
8. From the data of this monitoring block, we want to monitor the input ‘PV#Value’. For
this reason, drag it to the lower area of ‘DA view 1’.
(A1_multipurpose_plant/T2_reaction/reactor$R001/A1T2L001/Monitor_A1T2L001
PV#Value)
Unrestricted for Educational and R&D Facilities. © Siemens AG 2015. All Rights Reserved. 14
P03-02_Vertical Integration with OPC_V8.1_S0915_EN.docx
SCE Training Curriculum | PA Modul P03-02, Edition 09/2015 | Digital Factory, DF FA
9. Next, click on ‘Monitoring ON’. Now, in addition to other information, we can monitor
the value, time stamp and quality. This shows you whether the ‘OPCServer.WinCC’
works faultlessly. ( Monitoring ON)
10. If this is the case, open the Microsoft Excel file included in the module with a double
click. ( PCS7_SCE_0302_OPC_Template_R1305_en.xls)
Unrestricted for Educational and R&D Facilities. © Siemens AG 2015. All Rights Reserved. 15
P03-02_Vertical Integration with OPC_V8.1_S0915_EN.docx
SCE Training Curriculum | PA Modul P03-02, Edition 09/2015 | Digital Factory, DF FA
12. In Microsoft Excel, we now have to set the security settings correctly for the macros to
be started.
Unrestricted for Educational and R&D Facilities. © Siemens AG 2015. All Rights Reserved. 16
P03-02_Vertical Integration with OPC_V8.1_S0915_EN.docx
SCE Training Curriculum | PA Modul P03-02, Edition 09/2015 | Digital Factory, DF FA
14. . For the additional settings, open ‘Visual Basic’ in Microsoft Excel.
15. There, under ‘Tools’ open the option ‘References’. ( Tools References)
16. For the variables to be accessed in OPCServer 'WinCC’, the reference to the dll
‘Siemens OPC DA Automation 2.0’ has to be activated; if this reference is not
available, it has to be entered here with ‘Browse’. The path is then ‘C:\Program
Files\Common Files\Siemens\opc\sopcdaauto.dll’.
( Siemens OPC DA Automation 2.0 Browse C:\Program Files\Common Files\
Siemens\ opc\sopcdaauto.dll OK)
Unrestricted for Educational and R&D Facilities. © Siemens AG 2015. All Rights Reserved. 17
P03-02_Vertical Integration with OPC_V8.1_S0915_EN.docx
SCE Training Curriculum | PA Modul P03-02, Edition 09/2015 | Digital Factory, DF FA
17. Now, the computer name has to be entered in field A1. We can copy it in WinCC under
Computer properties. In field A2, the complete variable name has to be entered; it can
be copied from the OPC Scout V10. ( A1 PCS7OSLIENT3 A2
A1_multipurpose_plant/T2_reaction/reactor$R001/A1T2L001/Monitor_A1T2L001.PV#
Value)
Unrestricted for Educational and R&D Facilities. © Siemens AG 2015. All Rights Reserved. 18
P03-02_Vertical Integration with OPC_V8.1_S0915_EN.docx
SCE Training Curriculum | PA Modul P03-02, Edition 09/2015 | Digital Factory, DF FA
18. Next, save and close the Microsoft Excel file prior to reopening it with a double click.
( Save PCS7_SCE_0302_OPC.xls)
Unrestricted for Educational and R&D Facilities. © Siemens AG 2015. All Rights Reserved. 19
P03-02_Vertical Integration with OPC_V8.1_S0915_EN.docx
SCE Training Curriculum | PA Modul P03-02, Edition 09/2015 | Digital Factory, DF FA
19. During opening, we take note of the security warning and here also, we enable the
macros for the following session. ( Options Enable macros)
Unrestricted for Educational and R&D Facilities. © Siemens AG 2015. All Rights Reserved. 20
P03-02_Vertical Integration with OPC_V8.1_S0915_EN.docx
SCE Training Curriculum | PA Modul P03-02, Edition 09/2015 | Digital Factory, DF FA
21. In field B3, a new value can be written for the variable. We cannot use the process
value as above because it would overwrite itself immediately. It is best to use a fixed
parameter, for example, A1_multipurpose_plant/T2_reaction/reactor$R001/
A1T2L001/Monitor_A1T2L001.PV_AH_Lim to test this functionality. With the OPC
Scout, change the value to 1005, and then with the Excel file back to 1000.
Unrestricted for Educational and R&D Facilities. © Siemens AG 2015. All Rights Reserved. 21
P03-02_Vertical Integration with OPC_V8.1_S0915_EN.docx
SCE Training Curriculum | PA Modul P03-02, Edition 09/2015 | Digital Factory, DF FA
EXERCISES
In the exercises, we apply what we learned in the Theory section and in the Step by Step
Instructions.
The existing multi-project PCS7_SCE_0301_Ueb_R1504_en.zip and the table
PCS7_SCE_0302_OPC_Template_R1305_en.xls will be used for this.
The objective of this exercise is: identifying and reading a measured value by means of an
OPC item.
TASKS
1. Using PCS 7 and the OPC Scout, identify the corresponding variable name of
temperature measurement in Reactor R001.
2. Modify the variable name in the table from the step by step instructions with the new
name and read out the value.
Unrestricted for Educational and R&D Facilities. © Siemens AG 2015. All Rights Reserved. 22
P03-02_Vertical Integration with OPC_V8.1_S0915_EN.docx