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

Introduction

OPC (OLE for Process Control) is an original standardized and manufacturer-independent software interface.
Because of the further development of the OPC standard, the designation OPC is now used for an interface family.
OPC Data Access (OPC DA) is based on the Windows technology COM (Component Object Model) and DCOM
(Distributed Component Object Model).
DCOM is COM with the additional capability of accessing objects across computer boundaries. This technology
makes it possible to connect various components of different manufactures with each other via a standardized
interface.
An OPC configuration consists of at least one OPC server and one OPC client. The OPC server can forward data at
an OPC client and vice versa. Although OPC is not tied to a standard protocol, the TCP/IC protocol is preferred.

Fig. 01
Fig. 01 shows the basic configuration of an OPC client and an OPC server.
Note
In WinCC flexible, only PCs and Panel PCs can exchange data via DCOM. Communication between a Multi Panel
and one or several PCs is possible with OPC XML DA.
Link
Configuring an OPC XML DA connection
Entry ID: 25677751
Remark
The following example uses a WinCC flexible OPC server and a WinCC flexible OPC client. Since OPC via DCOM is
an open interface, both the WinCC flexible OPC server and the WinCC flexible OPC client can communicate with
other OPC components.
Contents
1.
Configuring the DCOM interface in Windows XP, settings of the OPC server in DCOM and
firewall settings
2.
Configuring the WinCC flexible OPC server
3.
Configuring the WinCC flexible OPC client
4.
Downloading the WinCC flexible sample projects
1. Configuring the DCOM interface in Windows XP, settings of the OPC server in DCOM and
firewall settings

Take the settings required from the PDF document below. This document is also available as a readme on the WinCC
flexible DVD. It is located in the folder entitled "<DVD drive>:\CD3\Support\OPC\".
Attachment 1: OPC_via_DCOM_e.pdf ( 908 KB )
Note:
You can also use the DCOM interface settings in Windows Vista and Windows 7.
2. Configuring the WinCC flexible OPC server
This example explains the configuration of a WinCC flexible project as OPC server.
N Procedure
o.
1

Create a new project


Start WinCC flexible and then click on "Project > New" in the program menu.
Select "PC > WinCC flexible Runtime".

Configure a connection
Click on "Project > Device_1... > Communication > Connections".
Insert a new connection via the program menu "Insert > New object - Connections".
Note
In this example we use the communication driver "SIMATIC S7 300/400". You can configure any
other connection that is available in WinCC flexible.
Note
If WinCC flexible is working as the OPC server, this OPC connection is not configured explicitly in
the "Connections" tab. The configuration takes place in the "Device settings" - see Point 4.
If necessary, change the slot of the SIMATIC S7 controller to "2" when using the
communication driver "SIMATIC S7 300/400".

Create tags
Create three "Variable_x" tags of the "Int" type and connect them with the connection
"Connection_1".
Use the memory areas "MW 10", "MW 12" and "MW 14" for the three external tags.
Create an additional internal tag of the "Int" type called "Variable_4".

Configure WinCC flexible as the OPC server


Switch to the "Device Settings" tab.
Enable the option "Act as OPC server".
Note
If WinCC flexible acts as OPC server, all the internal and external tags that have been created in
WinCC flexible are available to the OPC server.

Creating I/O and text fields


Add six text fields with the following designations:
- OPC DA Server
- Variable_1
- Variable_2
- Variable_3
- Variable_4
- internal tag
Add another four I/O fields and arrange all the text and I/O fields as shown in the figure.

Fig. 02
6

Connect tags
Link all four tags to the I/O fields.

Start WinCC flexible RT


Transfer at least the OB1 to the controller and set the controller in the "Run" mode.
Note
You can also use PLCSIM to test it as an alternative to the S7 controller.
Make sure that the PG/PC interface is set to "MPI" if it has been configured.
Start the WinCC flexible Runtime.

3. Configuring WinCC flexible OPC clients


The Runtime of the WinCC flexible OPC server must be started in order to configure the connection of the OPC
client tags to the WinCC flexible OPC server.
N Procedure
o.
1

Create a new project


Start WinCC flexible and then click on "Project > New" in the program menu.
Select "PC > WinCC flexible Runtime".

Create a connection
Add a new connection in the same way as for the WinCC flexible OPC server project.
Choose "OPC" as communication driver.
Select the OPC server "OPC.SimaticHMI.HmiRTm" from WinCC flexible on the computer
where the OPC server is available.
Note
If no OPC server is displayed on the relevant computer, then the network communication is
disrupted and the access is denied in Windows.
Remedy
Network communication:
Verify all Ethernet components (hub, switch, router, patch cable etc.).
Check all network settings (IP addresses, subnet mask, ping etc.).
Checking access:
Open the Windows Explorer and click on "Network environment".
Then click on "Entire Network > Microsoft Windows Network".
Double-click on the computer where the OPC server or client is available.

Log on with the relevant user name and password.


Note
If no logon dialog appears, deactivate the guest account in the user Windows user
administration.
Do the same on all the relevant computers.

Fig. 03
3

Define tags
Create four tags of the "Short" type with the connection "Connection_1".
Open the OPC browser by clicking on the corresponding "Symbol" field for each tag.
Connect each tag to the relevant item.
Note
If you can access the computer where the OPC server is available via Windows Explorer, then
check the DCOM settings.

Fig. 04
4

Create I/O and text fields


Add five text fields with the following designations:
- OPC DA Client
- Variable_1
- Variable_2
- Variable_3
- Variable_4
Add another four I/O fields and arrange all the text and I/O fields as shown in Fig. 25.
Link all the relevant tags to the I/O fields.

WinCC flexible Runtime


Start the WinCC flexible Runtime.

4. Download the WinCC flexible sample projects


The download in Attachment 2 contains the project described above in which WinCC flexible acts as OPC server.
Attachment 2: WinCC_flexible_OPC_DA_Server.zip ( 1875 KB )
Attachment 3 contains the WinCC flexible project that has been configured as OPC client.
Attachment 3: WinCC_flexible_OPC_DA_Client.zip ( 1924 KB )

Вам также может понравиться