pc based automation - search read.pudn.comread.pudn.com/.../427720/pcbademoopc…  · web view ·...

25

Click here to load reader

Upload: tranliem

Post on 16-Apr-2018

222 views

Category:

Documents


5 download

TRANSCRIPT

Page 1: PC based Automation - search read.pudn.comread.pudn.com/.../427720/PCbADemoOPC…  · Web view · 2002-01-09Topic: Demo: WinCC as OPC-Client. Author: Ralf Eden. Issued: 09.01.02

Demo: WinCC as OPC-Client

Demo: WinCC asOPC-Client

Topic: Demo:Demo: WinCC as OPC-Client

Author: Ralf Eden

Issued: 09.01.02

File name: document.doc

document.doc 09.01.02 Page: 1 / 18

Copyright (C) Siemens AG 2001 All Rights Reserved.

Page 2: PC based Automation - search read.pudn.comread.pudn.com/.../427720/PCbADemoOPC…  · Web view · 2002-01-09Topic: Demo: WinCC as OPC-Client. Author: Ralf Eden. Issued: 09.01.02

Demo: WinCC as OPC-Client

PC based Automation

Contents

1 How to operate WinCC as an OPC Client.............................................................3

2 Setup, Software Requirements..............................................................................3

3 Start-up and operation...........................................................................................33.1 Starting WinCC Runtime.....................................................................................33.2 Process Operation of the WinCC User Interface................................................63.3 Exiting WinCC Runtime:.....................................................................................7

4 Settings and Configuration of the WinCC Project..................................................84.1 Settings for the WinCC Project...........................................................................84.2 Sample Configuration.......................................................................................15

4.2.1 Creating a Variable in WinCC...........................................................................164.2.2 Creating the WinCC Runtime User Interface.....................................................18

document.doc 09.01.02 Page: 2 / 18

Copyright (C) Siemens AG 2001 All Rights Reserved.

Page 3: PC based Automation - search read.pudn.comread.pudn.com/.../427720/PCbADemoOPC…  · Web view · 2002-01-09Topic: Demo: WinCC as OPC-Client. Author: Ralf Eden. Issued: 09.01.02

Demo: WinCC as OPC-Client

1 How to operate WinCC as an OPC ClientThis document describes starting, operating and configuring the WinCC OPC Client. The aim of the exercise described in this document is to create a sample project using WinCC OPC Client and operating the mixing process visualised with WinCC.

2 Setup, Software RequirementsTable 1: Components

No Component

1 PC with Pentium II or higher with 128 MB, WinNT   4.0 SP6 or Win2000

2 Step7 V5.13 WinAC Basis V3.0 SP1

4 SIMATIC Computing V3.0 SP1 (contains WinAC-OPC-Server)5 WinCC V5.0 SP2

3 Start-up and OperationThe following sections describe starting WinCC Runtime as well as operating the WinCC user interface during runtime of the example.

3.1 Starting WinCC Runtime

The WinCC OPC client is started as follows:

WinCC is initially started with Simatic > WinCC > Windows Control Center 5.0. Then open the WinCC project WinCCDemo.MCP in WinCC Explorer with Datei > Öffnen [File > Open]. (Figure 1). Directory: \PCbADemoOPC\Programme\WinCC\Source\

Figure 1: Opening a WinCC project

document.doc 09.01.02 Page: 3 / 18

Copyright (C) Siemens AG 2001 All Rights Reserved.

Page 4: PC based Automation - search read.pudn.comread.pudn.com/.../427720/PCbADemoOPC…  · Web view · 2002-01-09Topic: Demo: WinCC as OPC-Client. Author: Ralf Eden. Issued: 09.01.02

Demo: WinCC as OPC-ClientAt the initial start of the project on your PC, WinCC notices that the computer name specified in the project is not available and reports this as follows:

Figure 2: Server lokal starten [Starting server locally]

By double-clicking on the computer name (Figure 3) the properties box of the computer opens and the specified computer can be changed to the desired computer name.

Figure 3: Changing the computer name

document.doc 09.01.02 Page: 4 / 18

Copyright (C) Siemens AG 2001 All Rights Reserved.

Page 5: PC based Automation - search read.pudn.comread.pudn.com/.../427720/PCbADemoOPC…  · Web view · 2002-01-09Topic: Demo: WinCC as OPC-Client. Author: Ralf Eden. Issued: 09.01.02

Demo: WinCC as OPC-Client

Afterwards the project must be exited in order to enter the computer name into the data base and automatically use your own computer as server when restarting the computer.

The Aktivieren [Activate] button starts the WinCC OPC Client in the WinCC Explorer.

Figure 4: Starting WinCC OPC Client Runtime

Visualising the mixing process with WinCC is now active. The process can now be started with the Start Process button.

document.doc 09.01.02 Page: 5 / 18

Copyright (C) Siemens AG 2001 All Rights Reserved.

Page 6: PC based Automation - search read.pudn.comread.pudn.com/.../427720/PCbADemoOPC…  · Web view · 2002-01-09Topic: Demo: WinCC as OPC-Client. Author: Ralf Eden. Issued: 09.01.02

Demo: WinCC as OPC-Client

3.2 Process Operation of the WinCC User Interface

Figure 5 shows the user interface of the visualisation with WinCC.

Figure 5: WinCC User Interface

Description of buttons and elements of WinCC Runtime:

The Start Process button starts and stops the process

The current values for temperature and Niveau [Level] are automatically updated in the Niveau and Temperature output boxes. An input into the Temperature and Niveau output box is not possible.

The current binary states for the Mixer, Cooler, Heater, Inlet_Valve_1, Inlet_Valve_2 and Outlet_Valve are visualised by a colour change of the corresponding dynamic illustration elements.

The Deactivate button exits WinCC Runtime.

document.doc 09.01.02 Page: 6 / 18

Copyright (C) Siemens AG 2001 All Rights Reserved.

Page 7: PC based Automation - search read.pudn.comread.pudn.com/.../427720/PCbADemoOPC…  · Web view · 2002-01-09Topic: Demo: WinCC as OPC-Client. Author: Ralf Eden. Issued: 09.01.02

Demo: WinCC as OPC-Client

Table 3-1 shows the precise assignment of WinCC variables to the process variables.

Table 3-1: WinCC variables

DB in Step7 WinCC Variable Process Variable Variable Type

DB1.DBW0 Actual_Temperature Temperature 16-bit no sign

DB1.DBW2 Actual_Niveau Niveau 16-bit no sign

DB1.DBX4.0 Actual_Inlet_Valve_1 Inlet_Valve_1 binary

DB1.DBX4.1 Actual_Inlet_Valve_2 Inlet_Valve_2 binary

DB1.DBX4.2 Actual_Outlet_Valve Outlet_Valve binary

DB1.DBX4.3 Actual_Heater Heater binary

DB1.DBX4.4 Actual_Cooler Cooler binary

DB1.DBX4.5 Actual_Mixer Mixer binary

DB2.DBW2 Rated_Temperature_Max Temperature_Max 16-bit no sign

DB2.DBW4 Rated_Temperature_Out Temperature_Out 16-bit no sign

DB2.DBW6 Rated_Niveau_1 Niveau_1 16-bit no sign

DB2.DBW8 Rated_Niveau_2 Niveau_2 16-bit no sign

DB3.DBX0.0 Start_Automatic Start_Automatic binary

3.3 Exiting WinCC Runtime:

WinCC Runtime should not be exited with the Schließen [Close] button but with the Deactivate button in the illustration or in WinCC-Explorer with the

Deaktivieren [Deactivate] button.

document.doc 09.01.02 Page: 7 / 18

Copyright (C) Siemens AG 2001 All Rights Reserved.

Page 8: PC based Automation - search read.pudn.comread.pudn.com/.../427720/PCbADemoOPC…  · Web view · 2002-01-09Topic: Demo: WinCC as OPC-Client. Author: Ralf Eden. Issued: 09.01.02

Demo: WinCC as OPC-Client

4 Settings and Configuration of the WinCC Project

4.1 Settings for the WinCC Project

The following settings must be made to configure WinCC as OPC Client. Creating a new WinCC Project in WinCC Explorer. It is started with Start > Simatic > WinCC > Windows Control Center 5.0 and WinCC Explorer then appears.

With Datei > Neu [File > New] you open the dialog for defining the properties of a new WinCC project. The sample project is created as a stand-alone project. (Figure 6)

Figure 6: WinCC Explorer – Selecting Einzelplatz-Projekt [Stand-alone project]

The dialog Neues Projekt anlagen [Create new project] appears (Figure 7). A Projekt Name [Project name] (here: WinCCDemo_Test) must be assigned to the new project. The storage location of the new project must be set in the field Projektpfad [Project path]. The dialog Neues Projekt anlegen [Create new project] is acknowledged with the Anlegen [Create] button.

document.doc 09.01.02 Page: 8 / 18

Copyright (C) Siemens AG 2001 All Rights Reserved.

Page 9: PC based Automation - search read.pudn.comread.pudn.com/.../427720/PCbADemoOPC…  · Web view · 2002-01-09Topic: Demo: WinCC as OPC-Client. Author: Ralf Eden. Issued: 09.01.02

Demo: WinCC as OPC-Client

Figure 7: Create new project

The new project is displayed in the WinCC Explorer. Now the required communication driver for OPC must be installed. To do this click with the right mouse button on the menu item Variablenhaushalt [Variable manager] and Neuen Treiber hinzufügen [Add new driver] (Figure 8).

Figure 8: Variablenhaushalt [Variables] – Neuen Treiber hinzufügen [Add new driver]

The dialog Neuen Treiber hinzufügen [Add new driver] is displayed. It provides a selection of communication drivers available for installation. The example on hand requires the communication driver OPC (OPC.chn). It must be selected in the dialog (Figure 9). The dialog must be closed by pressing Open.

document.doc 09.01.02 Page: 9 / 18

Copyright (C) Siemens AG 2001 All Rights Reserved.

Page 10: PC based Automation - search read.pudn.comread.pudn.com/.../427720/PCbADemoOPC…  · Web view · 2002-01-09Topic: Demo: WinCC as OPC-Client. Author: Ralf Eden. Issued: 09.01.02

Demo: WinCC as OPC-Client

Figure 9: Neuen Treiber hinzufügen [Add new driver]

The added communication driver OPC is displayed as a sub item of Variablenhaushalt [Variable Manager].

The communication driver OPC contains a channel unit. A connection to a particular OPC server can be defined, as well as the items required by that server be selected with the OPC item manager, as long as the OPC server supports the browsing functionality. The OPC item manager is started with the right mouse button over the channel unit OPC Groups (OPCHN Unit #1) and System parameters (Figure 10, Figure 11).

Figure 10: OPC Server Verbindung [OPC server connection] – Systemparameter

[System parameters]

document.doc 09.01.02 Page: 10 / 18

Copyright (C) Siemens AG 2001 All Rights Reserved.

Page 11: PC based Automation - search read.pudn.comread.pudn.com/.../427720/PCbADemoOPC…  · Web view · 2002-01-09Topic: Demo: WinCC as OPC-Client. Author: Ralf Eden. Issued: 09.01.02

Demo: WinCC as OPC-Client

Figure 11: OPC item manager

The precondition however is, that a symbol file has previously been created with the TagFile Server (see document „WinAC OPC Configuration“)

When selecting the OPCServer.WinAC and clicking on Browse Server, the item window of the OPC item managers opens (Figure 12).

Figure 12: Item window

document.doc 09.01.02 Page: 11 / 18

Copyright (C) Siemens AG 2001 All Rights Reserved.

Page 12: PC based Automation - search read.pudn.comread.pudn.com/.../427720/PCbADemoOPC…  · Web view · 2002-01-09Topic: Demo: WinCC as OPC-Client. Author: Ralf Eden. Issued: 09.01.02

Demo: WinCC as OPC-Client

You now have the option of adding the OPC variables in the project to the selected connection by selecting one or several items by pressing the buttom Items hinzufügen [Add items]. A connection must be selected in the Variablen hinzufügen [Add variable] window (Figure 13). It is also possible to supplement the variable with a prefix and/or a suffix.

Figure 13: Variablen hinzufügen [Add Variables]

The browser functionality is only supported from WinAC V3.0 SP1 on, therefore the absolute address is selected in this sample project. A few additional things have to be taken into account. Creating an OPC server connection for this configuration is described below.

First, the dialog Eigenschaften Verbindung [Properties connection] (Figure 15) must be opened after selecting OPC Groups with the right mouse button via the menu Neue Verbindung [New connection] (Figure 14).

document.doc 09.01.02 Page: 12 / 18

Copyright (C) Siemens AG 2001 All Rights Reserved.

Page 13: PC based Automation - search read.pudn.comread.pudn.com/.../427720/PCbADemoOPC…  · Web view · 2002-01-09Topic: Demo: WinCC as OPC-Client. Author: Ralf Eden. Issued: 09.01.02

Demo: WinCC as OPC-Client

Figure 14: OPC Server Connection – Create new connection

Figure 15: Eigenschaften Verbindung [Properties connection] – Register Allgemein [General

tab]

A connection name is specified in the Allgemein [General] tab (here: OPCServer_WinAC).

In the OPC Verbindung [OPC Connection] tab OPCServer.WinAC must be entered for the WinAC OPC server in the input box OPC Server Name. The OPC connection to the server can be tested with the button Server testen [Testing Server]. When the

document.doc 09.01.02 Page: 13 / 18

Copyright (C) Siemens AG 2001 All Rights Reserved.

Page 14: PC based Automation - search read.pudn.comread.pudn.com/.../427720/PCbADemoOPC…  · Web view · 2002-01-09Topic: Demo: WinCC as OPC-Client. Author: Ralf Eden. Issued: 09.01.02

Demo: WinCC as OPC-ClientOPC server has been started locally, <LOCAL> automatically appears in the Den Server auf diesem Computer starten [Starting the server on this computer] input box.

The values shall be read from the cache memory of the OPC server. To do this select Zwischenspeicher [Cache] under Werte lesen [Read values]. This setting is recommended for remote computers yet locally insignificant for WinAC.

Figure 16: Eigenschaften Verbindung [Properties Connection] - OPC Verbindung [OPC

Connection] tab

The OPC settings for the application of WinCC as OPC Client are now completed.

4.2 Sample Configuration

The configuration procedure of an output box for displaying a process value is described below. The examples refer to creating a variable and creating a WinCC user interface.

document.doc 09.01.02 Page: 14 / 18

Copyright (C) Siemens AG 2001 All Rights Reserved.

Page 15: PC based Automation - search read.pudn.comread.pudn.com/.../427720/PCbADemoOPC…  · Web view · 2002-01-09Topic: Demo: WinCC as OPC-Client. Author: Ralf Eden. Issued: 09.01.02

Demo: WinCC as OPC-Client

4.2.1 Creating a Variable in WinCC

A WinCC variable is created as follows. Right-click on OPCServer_WinAC and select Neue Variable [New Variable] from the appearing menu (Figure 17).

Figure 17: Create new variable for OPC server

Figure 18: Eigenschaften Variable [Properties variable] – General tab

The dialog Eigenschaften Variable [Properties variable] now opens (Figure 18). In the Allgemein [General] tab a suitable variable name must be entered in the Name input box (here Actual_Temperature).

document.doc 09.01.02 Page: 15 / 18

Copyright (C) Siemens AG 2001 All Rights Reserved.

Page 16: PC based Automation - search read.pudn.comread.pudn.com/.../427720/PCbADemoOPC…  · Web view · 2002-01-09Topic: Demo: WinCC as OPC-Client. Author: Ralf Eden. Issued: 09.01.02

Demo: WinCC as OPC-Client

By operating the Select button the dialog Eigenschaften Adresse [Properties Address] opens (Figure 19). Here you enter an OPC address (here: DB1.DBW0:WORD) in the input box Item Name. The settings in the dialog Eigenschaften Adresse [Properties Address] are acknowledged with OK.

Figure 19: Eigenschaften Adresse [Properties Address]

The variable is created in WinCC Explorer by pressing OK in the dialog Eigenschaften Variable [Properties Variable] (Figure 20). This variable can now be used in a display element in a WinCC user interface.

Figure 20: WinCC Explorer – Created Variable

document.doc 09.01.02 Page: 16 / 18

Copyright (C) Siemens AG 2001 All Rights Reserved.

Page 17: PC based Automation - search read.pudn.comread.pudn.com/.../427720/PCbADemoOPC…  · Web view · 2002-01-09Topic: Demo: WinCC as OPC-Client. Author: Ralf Eden. Issued: 09.01.02

Demo: WinCC as OPC-Client

4.2.2 Creating the WinCC Runtime User Interface

Now a WinCC Bild [Image] is created for visualising the previously created variables. To do this open the editor Graphics Designer by right-clicking it and press Öffnen [Open] (Figure 21).

Figure 21: Opening Graphics Designer

document.doc 09.01.02 Page: 17 / 18

Copyright (C) Siemens AG 2001 All Rights Reserved.

Page 18: PC based Automation - search read.pudn.comread.pudn.com/.../427720/PCbADemoOPC…  · Web view · 2002-01-09Topic: Demo: WinCC as OPC-Client. Author: Ralf Eden. Issued: 09.01.02

Demo: WinCC as OPC-Client

Now the editor Graphics Designer is displayed in which a new WinCC Image is already open. For displaying the variable value Actual_Temperature a smart-object EA-Feld [input/output box] shall be configured in the WinCC user interface. To do this EA-Feld [input/output box] is selected in the object pallet and placed in the image with drag&drop.

After placing the input/output box in the image its configuration dialog is displayed (Figure 22). In the Variable box, the variable Actual_Temperature is set with the displayed button.

Figure 22: E-A Feld Konfiguration

Bei Änderung [When values change] is set in the input box Aktualisierung [Update]. The setting option Feldtyp [Box type] is set to Ausgabe [Output] and Schriftgröße [Font] is set to 20. The dialog is acknowledged with OK. The configuration of the output box can be tested in WinCC Runtime with Datei > Runtime aktivieren [File > activating Runtime] in the menu of the WinCC Graphics Designer.

document.doc 09.01.02 Page: 18 / 18

Copyright (C) Siemens AG 2001 All Rights Reserved.