Você está na página 1de 90

Configuration Instruction

SIMATIC PCS 7 SIMATIC IT Integration


SIMATIC PCS 7 / SIMATIC IT Integration Pack 2007

PPA KPIs without Production Modeler

Warranty, liability and support


PPA KPIs without Production Modeler

Copyright Siemens AG 2008 All rights reserved

NOTE

26639558

The application examples are not binding and do not claim to be complete regarding the circuits shown, equipping and any eventuality. The
application examples do not represent customer-specific solutions. They
are only intended to provide support for typical applications. You are
responsible in ensuring that the de-scribed products are correctly used.
These application examples do not relieve you of the responsibility in
safely and professionally using, installing, operating and servicing
equipment. When using these application examples, you recognize that
Siemens 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 these application
examples and other Siemens publications - e.g. Catalogs - then the
contents of the other documents have priority.

Warranty, liability and support


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).
However, claims arising from a breach of a condition which goes to the root
of the contract shall be limited to the foreseeable damage which is intrinsic
to the contract, unless caused by intent or gross negligence or based on
mandatory liability for injury of life, body or health The above provisions
does not imply a change in the burden of proof to your detriment.
Copyright 2008 Siemens A&D. It is not permissible to transfer or
copy these application examples or excerpts of them without first
having prior authorization from Siemens A&D in writing.
For questions about this document please use the following e-mail address:
mailto:online-support.automation@siemens.com

V 2.0

22.07.08

2/90

Table of Contents
PPA KPIs without Production Modeler

26639558

Table of Contents

Copyright Siemens AG 2008 All rights reserved

Table of Contents ......................................................................................................... 3


1
1.1
1.2
1.3
1.4

Introduction..................................................................................................... 5
In general.......................................................................................................... 5
Test environment .............................................................................................. 5
Equipment for the Windows active directory domain ........................................ 6
Installed software.............................................................................................. 7
Operating systems ....................................................................................... 7
SIMATIC software ........................................................................................ 7

2
2.1
2.2
2.2.1
2.2.2
2.2.3
2.3
2.3.1
2.3.2
2.3.3
2.4
2.4.1
2.4.2
2.4.3
2.5
2.6

PPA Plant Performance Analyzer............................................................... 8


Configuration database..................................................................................... 8
Storage system................................................................................................. 9
Structure ........................................................................................................... 9
Features............................................................................................................ 9
Licensing........................................................................................................... 9
PPAEngine ..................................................................................................... 10
Administrative Tool ......................................................................................... 10
Features.......................................................................................................... 10
Accessing the tool........................................................................................... 10
Configuration Editor ........................................................................................ 11
Features.......................................................................................................... 11
PPAScheduler ................................................................................................ 11
PPACOM ........................................................................................................ 12
Installation notes............................................................................................. 12
Structure ......................................................................................................... 12

3
3.1
3.2
3.3

Overview how to integrate SIMATIC IT PPA with SIMATIC IT PM ............ 13


Prerequisite..................................................................................................... 13
Overview of production keys........................................................................... 13
Overview of Key Performance Indicators (KPIs) ............................................ 14

4
4.1
4.2
4.3
4.4
4.5
4.5.1
4.5.2
4.6
4.6.1
4.6.2

Overview how to integrate SIMATIC IT PPA with SIMATIC BATCH ......... 15


Electronic Batch data Recording (EBR).......................................................... 15
Batch Analysis tools........................................................................................ 15
Batch Reporting .............................................................................................. 16
Prerequisite..................................................................................................... 16
Configuration PPA for Batch Data .................................................................. 17
Creating a project ........................................................................................... 18
Creating a Class ............................................................................................. 35
Tag Collect and IEPAR in SIMATIC PCS 7 .................................................... 43
Using the TAG_COLL and IEPAR in SIMATIC PCS 7 ................................... 43
Tag Collection imported in SIMATIC IT PPA .................................................. 47

V 2.0

22.07.08

3/90

Table of Contents
PPA KPIs without Production Modeler

26639558

Manage PPA KPI without PM and without SIMATIC BATCH integration. 51


Create PK, Plant Model, Equipment property and PPA Tag .......................... 51
Create the PPA VB Script to activate/deactivate the KPIs.............................. 55
How to activate/ deactivate the KPIs created by user .................................... 56
PPA Class using script as data source ........................................................... 62
Testing KPI created manually......................................................................... 67
PPA Online Monitoring ................................................................................... 69
Using SIMATIC IT Historian ODS to activate/ deactivate the script................ 70
How to compare two different custom KPIs? .................................................. 82

References .................................................................................................... 88

Abbreviations................................................................................................ 89

Copyright Siemens AG 2008 All rights reserved

5
5.1
5.2
5.3
5.4
5.5
5.5.1
5.5.2
5.5.3

V 2.0

22.07.08

4/90

Introduction
PPA KPIs without Production Modeler

Introduction

1.1

In general

26639558

The information to the theme How to set up a running domain with


SIMATIC software can be found in the knowledge management document
SIMATIC software in a domain.
Here just in an overview the environment which is used to give the information to the topic KPI in PPA without Production Modeler.

1.2

Test environment

Copyright Siemens AG 2008 All rights reserved

The following scheme shows the Windows active directory domain


computers:
Figure 1-1 Scheme of the Windows active directory domain computers

A private IP address band is used with fixed IP addresses.

V 2.0

22.07.08

5/90

Introduction
PPA KPIs without Production Modeler

Equipment for the Windows active directory domain

2 Windows active directory domain controllers (DNS, WINS)

2 SIMATIC PCS 7 OS-Server (redundant)

2 SIMATIC BATCH-Server (redundant)

1 SIMATIC PCS 7 Engineering System (ES)

2 SIMATIC PCS 7 OS Multiclient + SIMATIC BATCH Client

1 SIMATIC IT Production Modeler

1 SIMATIC IT Historian + PPA DB

1 SIMATIC IT Report Manager/ CAB engineering

1 SIMATIC IT components software + SITMesDB

1 SIMATIC AS CPU 417 with a CP 443-1

Copyright Siemens AG 2008 All rights reserved

1.3

26639558

V 2.0

22.07.08

6/90

Introduction
PPA KPIs without Production Modeler

1.4

26639558

Installed software

Operating systems
The used operating systems for the domain computers can be found in the
following table.
Table 1-1

Station
Server

Installation
Windows 2003 MUI (Multilanguage User Interface) with SP2
Internet Explorer V6.0 SP2 (6.0.3790.3959)
Image software

Client

Windows XP SP2
Image software

Domain Controller

Windows 2003 MUI (Multilanguage User Interface) with SP2

Copyright Siemens AG 2008 All rights reserved

Internet Explorer V6.0 SP2 (6.0.3790.3959)

SIMATIC software
SIMATIC software and its required software packages (e.g. message queuing, SQL Server 2005 with SPx...) are installed as needed. The installed
software for SIMATIC PCS 7 and SIMATIC IT is the released Integration
Pack 2007 on top of the released SIMATIC Versions.
Table 1-2

Product
SIMATIC PCS 7

Version
V7.0 SP1
Microsoft SQL 2005 SP1 HF
PCS 7 / SIMATIC IT Integration Pack 2007
Part1 Updates SIMATIC PCS 7

SIMATIC IT

V6.3 SP1
Microsoft SQL 2005 SP2
PCS 7 / SIMATIC IT Integration Pack 2007
Part2 Updates SIMATIC IT

A detailed list of the installed SIMATIC software can be found in the attachment A of the document SIMATIC software in a domain.

V 2.0

22.07.08

7/90

PPA Plant Performance Analyzer


PPA KPIs without Production Modeler

26639558

PPA Plant Performance Analyzer


SIMATIC IT Plant Performance Analyzer is a long-term archiving package,
suitable for storing, validating and aggregating process data into a standard
RDBMS (SQL Server). It is part of the SIMATIC IT Historian solution.
SIMATIC IT Plant Performance Analyzer is made up of the following components:

2.1

Configuration database
The configuration database consists of:

the views to access the Online and Offline database set.

all configuration tables.

Copyright Siemens AG 2008 All rights reserved

The configuration tables, updated by means of the configuration tool, contain information regarding data acquisition, processing and management,
for example:

Tag definition, description, initial status and destination archive.

Definition of the events that trigger the acquisitions. These may be:

SIMATIC IT Event Manager events.

Cyclic triggers whose frequency and synchronization of the start


time are specified.

On-data-change triggering conditions.

Definition of source points: source server, as well as the path and mode
for acquiring a point (or points, for snapshots and calculated data).

Definition of validation functions and calculations.

Definition of classes and groups.

Definition of Snapshots.

You can define the name of the configuration database.


All configurations are tracked and consequently you can correlate data in
the storage system with the configuration that generated the data.
The configuration program is the only program with access to create and
modify these tables. However, a read-only access to the configuration information is available via the PPACOM interface.

V 2.0

22.07.08

8/90

PPA Plant Performance Analyzer


PPA KPIs without Production Modeler

2.2

26639558

Storage system
In SIMATIC IT Plant Performance Analyzer, the configuration database and
the archives, although physically distinct, are dealt with as a single entity.
Together, they are referred to as a "database set".

2.2.1

Structure

Copyright Siemens AG 2008 All rights reserved

A database set, managed as a single database at a project configuration


level, is made up of the following physical Microsoft SQL relational databases:

2.2.2

The configuration database

The online database set

The offline database set (optional)

Features
The various PPA database sets can be configured to reside on:

2.2.3

the same SQL Server.

different instances of the same SQL Server.

distinct SQL Servers.

Licensing
Every instance of SIMATIC IT PPA must run on a PC with its own license,
and can only be connected to one database at a time. Similarly, each instance of Configuration Editor can only connect to one database at a
time.
However, the user can use a single SIMATIC IT PPA license to configure
various databases, test them and then export them to other plants (where
they can, in turn, be associated to a completely different PPA instance).
Conventions used for naming databases:
Table 2-1

Database type
Configuration

DBNAME (Defined by the user)

Online

DBNAME_ONLINE_1, DBNAME_ONLINE_2, etc.


(Automatically assigned by the system)
DBNAME_STARTDATE_ENDDATE
(Automatically assigned by the system)

Offline

V 2.0

Name

22.07.08

9/90

PPA Plant Performance Analyzer


PPA KPIs without Production Modeler

2.3

26639558

PPAEngine
PPAEngine is an out-of-process COM server that:

Copyright Siemens AG 2008 All rights reserved

2.3.1

reads the configuration from the SIMATIC IT PPA configuration database and links to various data sources to retrieve raw data: SIMATIC IT
RTDS and PDA via SIMATIC IT internal APIs, generic relational database via ODBC and SIMATIC IT PPA via ITFSQLLIB.

processes data by performing validations and calculations on arrays of


tag samples.

stores the data into the online databases using a dedicated archiving
server (PPAARCSRV), which is also responsible for the cyclic shift of
the online databases.

Administrative Tool
SIMATIC IT Plant Performance Analyzer Administrative Tool is a high-level
configuration client that enables the management of SIMATIC IT PPA projects, including the creation of SIMATIC IT PPA databases.

2.3.2

Features
Administrative Tool allows the user to work with:

2.3.3

Projects

Databases

Configuration Life Cycle

Accessing the tool


To run the Administrative Tool, select Component > Plant Performance Analyzer (PPA) > Plant Performance Analyzer Configuration from SIMATIC IT Management Console. Only one instance
of the tool is allowed throughout the plant.

NOTE

V 2.0

The Administrative Tool contains a list of all configured databases, thereby allowing the user to simply select the database to work on. Note that
these databases are available to all the other modules as well (e.g. Configuration Editor, etc..).

22.07.08

10/90

PPA Plant Performance Analyzer


PPA KPIs without Production Modeler

2.4

26639558

Configuration Editor
The Configuration Editor is the client that enables the configuration of each
SIMATIC IT PPA project by defining all the tags and snapshots and allows
processing data through PPAEngine.

2.4.1

Features

Copyright Siemens AG 2008 All rights reserved

Configuration Editor allows the user to work with:

Classes

Tags

Resources

Folders

Snapshots

Source Points

VB script functions

Script libraries

Production keys

Messages

Equipment

Properties

Accessing the tool

In Administrative Tool, right-click the project that you want to edit: this
calls up a shortcut menu.

Select either of the following commands

2.4.2

New Configuration to create a new configuration.

Open Configuration to open an existing configuration.

The Configuration Editor environment is displayed.

PPAScheduler
Is a COM server that makes it possible for SIMATIC IT Production Modeler,
as well as other COM-enabled applications, to schedule KPIs and set key
values.

V 2.0

22.07.08

11/90

PPA Plant Performance Analyzer


PPA KPIs without Production Modeler

2.4.3

26639558

PPACOM
PPACOM (the COM server used by SIMATIC IT PPA) exposes a set of
COM interfaces and methods for browsing the SIMATIC IT PPA item configuration and accessing stored data.

2.5

Installation notes
PPAEngine and Configuration Editor must run on a computer with SIMATIC
IT Services installed. However, they do not necessarily need to run on the
same computer.
PPACOM does not require SIMATIC IT Services (in any case, it normally
runs on the same computer hosting the engine).

Copyright Siemens AG 2008 All rights reserved

The SQL Server can reside on any computer.

2.6

Structure
SIMATIC IT Plant Performance Analyzer consists in two environments:

V 2.0

Administrative Tool

Configuration Editor

22.07.08

12/90

Overview how to integrate SIMATIC IT PPA with


SIMATIC IT PM
PPA KPIs without Production Modeler

26639558

Overview how to integrate SIMATIC IT PPA with


SIMATIC IT PM

3.1

Prerequisite
The installation of the SIMATIC IT Business Process Modeler component
within the SIMATIC IT network is a prerequisite for integrating Plant Performance Analyzer with Production Modeler.
SIMATIC IT Production Modeler allows you to organize an enterprises assets into plant areas according to a hierarchical model fully compliant with
the S95 standard. This standard also establishes that one or more properties can be associated with each object of this model.

Copyright Siemens AG 2008 All rights reserved

Because of its tight integration with SIMATIC IT Production Modeler,


SIMATIC IT Plant Performance Analyzer can acquire and store plant data
while mapping it to Production Modelers equipment hierarchy model and to
its KPIs.

3.2

Overview of production keys

Definition
A Production Key is a particular tag (stored in a dedicated database table)
whose alphanumeric value identifies a specific time span/ event corresponding to a specific production run.
Features
Production keys allow the user to associate SIMATIC IT Plant Performance
Analyzer tags with a specific manufacturing context.
For example, you may want to associate one or more tags with a specific
Production Operation triggered by SIMATIC IT Production Modeler, or with
a specific production batch started by a batch management system.
CPO_ID correlation key
SIMATIC IT Production Modeler is provided with a pre-defined correlation
key, which is called CPO_ID:
CPO_ID contains the unique ID of the Production Operations executed by
SIMATIC IT PM, and is used to correlate all data related to the KPIs (Key
Performance Indicators) with the proper Production Operation.
All records containing KPI data stored by SIMATIC IT PPA and the values
of this key are correlated via two different relationships:

V 2.0

Explicit: The "key" used to retrieve data is the PO ID. The corresponding SIMATIC IT PPA tag must be configured so that its destination archive is of indexed type.

22.07.08

13/90

Overview how to integrate SIMATIC IT PPA with


SIMATIC IT PM
PPA KPIs without Production Modeler

26639558

Implicit: The "key" used to retrieve data is the "time stamp". You can
extract the corresponding time span (and, consequently, all data stored
within it) starting from the PO ID (i.e. from a specific value of the corresponding key). The corresponding SIMATIC IT PPA tag must be configured so that its destination archive is NOT of indexed type (e.g. tags
stored cyclically, with fast acquisition/aggregation cycles).

SIMATIC IT PPA stores the values of this key at run-time, this relating them
to the Equipment where the Production Operation was allocated. Consequently, data (single value or time series) is stored and associated with the
pertinent Production Operation ID.
Other production keys are defined in Configuration Editor.
Defining Key Values

Copyright Siemens AG 2008 All rights reserved

Using the COM interface exposed by SIMATIC IT Plant Performance Analyzer, you can set the key value to a significant value (e.g. a Production
Operation ID).
PPAEngine will then associate the value of the tag with that of the key at
run-time and store both values in an indexed archive.

3.3

Overview of Key Performance Indicators (KPIs)


Key Performance Indicators (KPIs) are values, which can be aggregated in
various ways depending on the level of the person who defines and calculates them.
KPIs can refer to different plant areas and can be contextualized and added
to the productive process by integrating SIMATIC IT PM and SIMATIC IT
PPA.

NOTE

V 2.0

Our focus in this document is managing the KPI without SIMATIC IT PM


integration using only the SIMATIC IT PPA and its interfaces.

22.07.08

14/90

Overview how to integrate SIMATIC IT PPA with


SIMATIC BATCH
PPA KPIs without Production Modeler

26639558

Overview how to integrate SIMATIC IT PPA with


SIMATIC BATCH
The integration with SIMATIC BATCH provides the following functions:

4.1

Electronic Batch data Recording

Batch Analysis tools

Batch Reporting

Electronic Batch data Recording (EBR)

Copyright Siemens AG 2008 All rights reserved

Electronic Batch data Recording consists of logging:

batches and their recipe header information.

the batch stepping sequence.

batch-related messages.

batch-related measures.

All events related to the batch stepping sequence are traced in SIMATIC IT
Plant Performance Analyzer.
These events are related to the following elements:

Batch/Control Recipe

Recipe Unit Operation

Recipe Operation

Recipe Phase

All relevant information necessary for Batch analysis and Batch reporting is
stored for each element. This information includes:

Batch/Recipe header information

Recipe Procedural Elements parameters

All stored data allows you to rebuild/display the complete batch stepping
sequence (recipe element executed - with start and end time - plus additional information).

4.2

Batch Analysis tools


Batch Analysis tools consist of:

V 2.0

22.07.08

15/90

Overview how to integrate SIMATIC IT PPA with


SIMATIC BATCH
PPA KPIs without Production Modeler

4.3

26639558

Message viewer, which allows you to display, sort and filter messages
stored by SIMATIC IT Plant Performance Analyzer.

Production viewer, which allows you to display batches traced by


SIMATIC IT PPA, along with their characteristics and status (tabular
view).

Batch Reporting

Copyright Siemens AG 2008 All rights reserved

SIMATIC IT Report Manager provides batch-related standard reports,


which are based on data collected by SIMATIC IT Plant Performance Analyzer. Available standard report types are:

Electronic Batch data Report (EBR)

Batch Comparison Report

Batch Material Consumption Report

Batch Overview Report

Electronic Batch data Report (EBR)


This report contains all information related to the batch, (e.g. Batch characteristics, Recipe header information, Stepping sequence (with parameters,
collected measures, messages and Bill of Materials)).
Batch Comparison report
Compares the actual values of all parameters (on RP, RUP, ROP and RPH
levels) for the selected batches. This is only practical if the selected
batches are based on the same recipe.
Batch Material Consumption report
The aggregated amount of consumed input materials is given (per material
definition) for the selected Order categories. Since this is a drill-down report, it is possible to zoom in on the (aggregated) amount per order and
even further to the amount per batch.
Batch Overview report
Displays header information regarding batches that comply with a certain
criterion. As an example, the batches with an excessive value for a certain
phase parameter are given.

4.4

Prerequisite
On the Historian Server machine must be installed:

V 2.0

Full Services

22.07.08

16/90

Overview how to integrate SIMATIC IT PPA with


SIMATIC BATCH
PPA KPIs without Production Modeler

26639558

SIMATIC IT BPM

Historian Server (including PPA, PDA, LTA and HDD)

Install additionally the Open PCS7 +


PCS7_COMMUNICATION_IF_V7.0+SP1 software from CD2 of the integration pack 2007

SIMATIC IT Compliance Service (optional)

NOTE

Using the SIMATIC manager, configure the SIMATIC IT Historian machine as a SPOSA station inside the SIMATIC PCS 7 project/ multiproject
(see appendix B in the document Data exchange between SIMATIC
PCS 7 / SIMATIC BATCH and SIMATIC IT Historian for a detailed description).

Copyright Siemens AG 2008 All rights reserved

On the Database Server must be installed:

MS SQL Server 2005 SP2 for SIMATIC IT

SIMATIC IT PPA SQL Extension DLL

SIMATIC IT BPM Scripts

On the Report Manager machine (optional) must be installed:

4.5

SIMATIC IT Report Manager inclusive Business Object

Configuration PPA for Batch Data


The following operations must be performed in order to permit integration
with SIMATIC BATCH.
In SIMATIC IT PPA:

V 2.0

Creating a project

Creating a class

22.07.08

17/90

Overview how to integrate SIMATIC IT PPA with


SIMATIC BATCH
PPA KPIs without Production Modeler

4.5.1

26639558

Creating a project

Start the PPA Server on the Historian Server machine from the management console Component > Plant Performance Analyzer
(PPA) > Plant Performance Analyzer Server. Alternative
you can use the autostart function of the Management Console.

Figure 4-1 Run Plant Performance Analyzer Server

Copyright Siemens AG 2008 All rights reserved

You can check if the PPA Server is running using the tab Management
Control Task List to check.

Figure 4-2 Check PPA Server is running

V 2.0

Start the Plant Performance Analyzer Configuration on the Historian


Server machine from the management console Component > Plant
Performance Analyzer (PPA) > Plant Performance Analyzer Configuration

22.07.08

18/90

Overview how to integrate SIMATIC IT PPA with


SIMATIC BATCH
PPA KPIs without Production Modeler

26639558

Figure 4-3 Run Plant Performance Analyzer Configuration

The PPA Administration tool window will open and you can create a
new project following these steps:

In Administrative Tool, select the Project > Add


command:
The Project Configuration Wizard is started. Click Next.

Copyright Siemens AG 2008 All rights reserved

Figure 4-4 Add Project wizard

V 2.0

22.07.08

19/90

Overview how to integrate SIMATIC IT PPA with


SIMATIC BATCH
PPA KPIs without Production Modeler

26639558

Select the SQL Server Instance and click Next.

Copyright Siemens AG 2008 All rights reserved

Figure 4-5 SQL Server instance

V 2.0

22.07.08

20/90

Overview how to integrate SIMATIC IT PPA with


SIMATIC BATCH
PPA KPIs without Production Modeler

26639558

Enter the SQL Server Login parameters and click Next.

Copyright Siemens AG 2008 All rights reserved

Figure 4-6 SQL Server Login

V 2.0

22.07.08

21/90

Overview how to integrate SIMATIC IT PPA with


SIMATIC BATCH
PPA KPIs without Production Modeler

26639558

In the PPA Database Set Configuration dialog box select the Add a
new database set radio button, and click Next.

Copyright Siemens AG 2008 All rights reserved

Figure 4-7 Select new Database set

V 2.0

22.07.08

22/90

Overview how to integrate SIMATIC IT PPA with


SIMATIC BATCH
PPA KPIs without Production Modeler

26639558

Choose a name for the new PPA Database Set (here Color) and
click Next.

Copyright Siemens AG 2008 All rights reserved

Figure 4-8 Create new Database set

V 2.0

22.07.08

23/90

Overview how to integrate SIMATIC IT PPA with


SIMATIC BATCH
PPA KPIs without Production Modeler

26639558

Choose the Configuration Database location and click Next.

Copyright Siemens AG 2008 All rights reserved

Figure 4-9 PPA Database set location

V 2.0

22.07.08

24/90

Overview how to integrate SIMATIC IT PPA with


SIMATIC BATCH
PPA KPIs without Production Modeler

26639558

Copyright Siemens AG 2008 All rights reserved

Figure 4-10 PPA Database set location

V 2.0

22.07.08

25/90

Overview how to integrate SIMATIC IT PPA with


SIMATIC BATCH
PPA KPIs without Production Modeler

26639558

Set the Number of Online Databases, and click Next.

Copyright Siemens AG 2008 All rights reserved

Figure 4-11 Number of Online Databases

V 2.0

22.07.08

26/90

Overview how to integrate SIMATIC IT PPA with


SIMATIC BATCH
PPA KPIs without Production Modeler

26639558

Define the Online Database Set location / Transaction Log location


and click Next.

Copyright Siemens AG 2008 All rights reserved

Figure 4-12 Select PPA Online Database set location / Transaction Log location

V 2.0

22.07.08

27/90

Overview how to integrate SIMATIC IT PPA with


SIMATIC BATCH
PPA KPIs without Production Modeler

26639558

Enter the Online Database Set parameters "Initial Transaction Log


Size" and click Next.

Copyright Siemens AG 2008 All rights reserved

Figure 4-13 PPA Online Database set parameters / Initial Transaction Log size

V 2.0

22.07.08

28/90

Overview how to integrate SIMATIC IT PPA with


SIMATIC BATCH
PPA KPIs without Production Modeler

26639558

Define the PPA Server (here SITHIST) and click Next.

Copyright Siemens AG 2008 All rights reserved

Figure 4-14 Define PPA Server

V 2.0

22.07.08

29/90

Overview how to integrate SIMATIC IT PPA with


SIMATIC BATCH
PPA KPIs without Production Modeler

26639558

In the Project Type Definition dialog box, select the "SIMATIC


BATCH Integration" check box to connect the engine to SIMATIC
BATCH. Optional select the Include batch-related tags check box,
to enable the automatic creation of tags.

Copyright Siemens AG 2008 All rights reserved

Figure 4-15 Define Project Type

V 2.0

22.07.08

30/90

Overview how to integrate SIMATIC IT PPA with


SIMATIC BATCH
PPA KPIs without Production Modeler

26639558

Define Electronic Signature Assignment (optional) and click Next.

Copyright Siemens AG 2008 All rights reserved

Figure 4-16 Define ESIG (optional)

V 2.0

22.07.08

31/90

Overview how to integrate SIMATIC IT PPA with


SIMATIC BATCH
PPA KPIs without Production Modeler

26639558

Define the Offline Database Set location parameters and click


Next.

Copyright Siemens AG 2008 All rights reserved

Figure 4-17 PPA Offline Database set parameters

If you select the same Online and Offline Database Location the
system shows you an error.

Figure 4-18 Error Online and Offline location

V 2.0

22.07.08

32/90

Overview how to integrate SIMATIC IT PPA with


SIMATIC BATCH
PPA KPIs without Production Modeler

26639558

Select in this case a different Offline Database location and click


Next.

Copyright Siemens AG 2008 All rights reserved

Figure 4-19 Offline Database Set location

V 2.0

22.07.08

33/90

Overview how to integrate SIMATIC IT PPA with


SIMATIC BATCH
PPA KPIs without Production Modeler

26639558

Set the Number of Offline Databases and click Next.

Copyright Siemens AG 2008 All rights reserved

Figure 4-20 Number of Offline Databases

V 2.0

Click Next.

22.07.08

34/90

Overview how to integrate SIMATIC IT PPA with


SIMATIC BATCH
PPA KPIs without Production Modeler

26639558

Click Finish.

Copyright Siemens AG 2008 All rights reserved

Figure 4-21 Add Project Wizard Finish

4.5.2

Creating a Class

Overview of classes
A class is a template used for predefining shared data source and acquisition settings for multiple tags and snapshots. Creating a tag or snapshot
starting from a class will result in the tag or snapshot automatically inheriting shared parameters. In addition, any subsequent changes to parameters
defined at a class level will be inherited by all tags and snapshots in that
class.

NOTE

V 2.0

Classes are a pre-requirement for tags and snapshots, i.e. when creating
a tag or snapshot, you must first assign it to a class. If no existing class
has suitable parameters, you must create a new one. No tag or snapshot
can be created without first defining its class.

22.07.08

35/90

Overview how to integrate SIMATIC IT PPA with


SIMATIC BATCH
PPA KPIs without Production Modeler

26639558

Creating a Class for Batch Data


A Batch class is used to import batch tags, i.e. the imported tags inherit its
features.
A default Batch class (whose parameters can be modified) is provided and
cannot be deleted. However, a new Batch class can be created and set as
the default one.
Figure 4-22 Default SIMATIC_BATCH Class

Copyright Siemens AG 2008 All rights reserved

To create a new Batch class follow these steps:

In Configuration Editor, click the Classes button on the Editing/Development Bar.

Figure 4-23 Classes environment

V 2.0

22.07.08

36/90

Overview how to integrate SIMATIC IT PPA with


SIMATIC BATCH
PPA KPIs without Production Modeler

26639558

Select the File > New > Class command which starts the New
Class Configuration Wizard. Click Next.

Figure 4-24 New class configuration

Copyright Siemens AG 2008 All rights reserved

Figure 4-25 New class configuration wizard

V 2.0

22.07.08

37/90

Overview how to integrate SIMATIC IT PPA with


SIMATIC BATCH
PPA KPIs without Production Modeler

26639558

In the Class definition dialog box, type the name of the new class in the
Class Name edit box, select SIMATIC_BATCH in the Data Source
drop down list. Then select the "Default Class" check box to set the
class as default while importing from Business Process Modeler.

Copyright Siemens AG 2008 All rights reserved

Figure 4-26 Class definition

Figure 4-27 Class definition

V 2.0

Click Next.

22.07.08

38/90

Overview how to integrate SIMATIC IT PPA with


SIMATIC BATCH
PPA KPIs without Production Modeler

26639558

Define the Acquisition Event and click Next.

Copyright Siemens AG 2008 All rights reserved

Figure 4-28 Acquisition Event definition

V 2.0

22.07.08

39/90

Overview how to integrate SIMATIC IT PPA with


SIMATIC BATCH
PPA KPIs without Production Modeler

26639558

Define the Acquisition Buffer and click Next.

Copyright Siemens AG 2008 All rights reserved

Figure 4-29 Acquisition Buffer definition

V 2.0

22.07.08

40/90

Overview how to integrate SIMATIC IT PPA with


SIMATIC BATCH
PPA KPIs without Production Modeler

26639558

Set the Initial Status and click Next.

Copyright Siemens AG 2008 All rights reserved

Figure 4-30 Initial Status definition

V 2.0

22.07.08

41/90

Overview how to integrate SIMATIC IT PPA with


SIMATIC BATCH
PPA KPIs without Production Modeler

26639558

Set the Destination Folder and click Next.

Copyright Siemens AG 2008 All rights reserved

Figure 4-31 Destination Folder Definition

Click Finish.
Figure 4-32 NewClass_Batch created

V 2.0

22.07.08

42/90

Overview how to integrate SIMATIC IT PPA with


SIMATIC BATCH
PPA KPIs without Production Modeler

4.6

26639558

Tag Collect and IEPAR in SIMATIC PCS 7


Our goal is to archive one or more tags during the runtime of a specific
phase. To do this we can use the Tag Collect block and the IEPAR blocks.
The Tag Collect block (TAG_COLL) serves as a collector block for the
IEPARs (Equipment Parameter Module) used in transition conditions in the
BATCH recipe editor and that are not available as parameters in the phase.
Process tags can also be included as parameters that are used in the batch
measured value acquisition. The parameters of TAG_COLL are purely actual values and the SP_VAL inputs are therefore not written. Only
ACT_VAL and QACT_VAL are significant.

Copyright Siemens AG 2008 All rights reserved

The IEPAR is used to set the desired values and to collect the actual values. The signal applied to the inputs SP_VAL or ACT_VAL is transferred to
the outputs Q_SP_VAL or QACT_VAL respectively. SP_VAL is set typically
by the batch control or the IEPH faceplate, ACT_VAL by the user program.

4.6.1

Using the TAG_COLL and IEPAR in SIMATIC PCS 7


In the Test plant we collect the Reactor temperature during the heating and
cooling phase.

Figure 4-33 TAG_COLL and IEPAR_RE example

V 2.0

Open the RC01_Temp chart and insert the TAG_COLL and the
IEPAR_REAL blocks.

Open the TAG_COLL properties, change block name and insert the
mnemonic name Temp_RC in the F_TYPE field.

Connect the EPE_CONN TAG_COLL output to the EPE_CONN


IEPAR_REAL input.

22.07.08

43/90

Overview how to integrate SIMATIC IT PPA with


SIMATIC BATCH
PPA KPIs without Production Modeler

26639558

Connect the ACT_VAL of IEPAR_REAL input to the tag desired.

Right click on the QACT_VAL output of the IEPAR_REAL and select


the Object Properties. Select the Archiving mode in the Archive box.

Copyright Siemens AG 2008 All rights reserved

Figure 4-34 IEPAR_REAL configuration

V 2.0

Compile and download to the AS

22.07.08

44/90

Overview how to integrate SIMATIC IT PPA with


SIMATIC BATCH
PPA KPIs without Production Modeler

26639558

Open the SIMATIC BATCH configuration on the Multi Project level and
verify the Archive measured variable is checked

Copyright Siemens AG 2008 All rights reserved

Figure 4-35 SIMATIC BATCH Multi Project level

V 2.0

22.07.08

45/90

Overview how to integrate SIMATIC IT PPA with


SIMATIC BATCH
PPA KPIs without Production Modeler

26639558

Open the SIMATIC BATCH configuration on the PCell level and link
the measured variable to the WINCC TAG LOGING

Copyright Siemens AG 2008 All rights reserved

Figure 4-36 SIMATIC BATCH Pcell level Measured variable empty

Figure 4-37 SIMATIC BATCH Pcell level Measured variable linked

V 2.0

Compile, generate and propagate the batch

22.07.08

46/90

Overview how to integrate SIMATIC IT PPA with


SIMATIC BATCH
PPA KPIs without Production Modeler

4.6.2

26639558

Tag Collection imported in SIMATIC IT PPA


If the SIMATIC BATCH Integration and Include batch-related tags options were selected (see the chapter 4) when you open the PPA configuration and select the Import from BPM command the system import all
WINCC Tag Logging tags linked to the TAG_COLLs defined in the
SIMATIC PCS 7 project as KPIs tag.

Copyright Siemens AG 2008 All rights reserved

Figure 4-38 PPA Project Type Definition

V 2.0

22.07.08

47/90

Overview how to integrate SIMATIC IT PPA with


SIMATIC BATCH
PPA KPIs without Production Modeler

26639558

Copyright Siemens AG 2008 All rights reserved

Figure 4-39 PPA TAG_COLL

V 2.0

22.07.08

48/90

Overview how to integrate SIMATIC IT PPA with


SIMATIC BATCH
PPA KPIs without Production Modeler

26639558

Copyright Siemens AG 2008 All rights reserved

Figure 4-40 Batch-related tags imported properties

V 2.0

22.07.08

49/90

Overview how to integrate SIMATIC IT PPA with


SIMATIC BATCH
PPA KPIs without Production Modeler

26639558

After configuring the formula/recipe and starting the batch, we can use the
SIMATIC IT HDD to show the KPIs values archived into the PPA database.
This can be seen in the following picture.

Copyright Siemens AG 2008 All rights reserved

Figure 4-41 Using SIMATIC IT HDD to view KPI

For more information about SIMATIC BATCH and SIMATIC IT Historian integration please read the knowledge documentation Data exchange between SIMATIC PCS7 / BATCH and SIMATIC IT Historian.

V 2.0

22.07.08

50/90

Manage PPA KPI without PM and without SIMATIC


BATCH integration
PPA KPIs without Production Modeler

26639558

Manage PPA KPI without PM and without SIMATIC


BATCH integration
We can create manually the KPIs without the Production Modeler and
SIMATIC BATCH integration and then activate/ deactivate these KPIs using
the PPAScheduler functions. To do this we must perform these steps:
1. Create the Production Key (PK).
2. Create the Plant Model.
3. Create the Equipment and its Property.
4. Create the PPA tag .
5. Create Scripts to create the production key and activate/ deactivate the
key.

Copyright Siemens AG 2008 All rights reserved

6. Create PPA Class using the Script created as Data Source.

5.1

Create PK, Plant Model, Equipment property and PPA Tag


Follow these steps to create the Plant Model, Equipment property and PPA
Tag:

In the SIMATIC IT Management Console run the PPA Server.

Figure 5-1 Run PPA Server

When the PPA Administrative tool is running right click to the project
and create new configuration from the Scratch.

Figure 5-2 Create new configuration

V 2.0

22.07.08

51/90

Manage PPA KPI without PM and without SIMATIC


BATCH integration
PPA KPIs without Production Modeler

26639558

In the PPA Configuration editor click on the Production Keys table and create the PKTest Production Key.

Figure 5-3 Create new Production Key

In the PPA Configuration editor click on the Class table and create
the Class based on the RTDS data source and triggered On Data
Change. In this class create also the Tag1 tag with following properties:

Copyright Siemens AG 2008 All rights reserved

Figure 5-4 Class1 details

Figure 5-5 Tag1 Initial Status External Activation

V 2.0

22.07.08

52/90

Manage PPA KPI without PM and without SIMATIC


BATCH integration
PPA KPIs without Production Modeler

26639558

Copyright Siemens AG 2008 All rights reserved

Figure 5-6 Tag1 Source Point Definition RTDS floating point

Figure 5-7 Tag1 Storage Settings Indexed Archive

V 2.0

22.07.08

53/90

Manage PPA KPI without PM and without SIMATIC


BATCH integration
PPA KPIs without Production Modeler

26639558

Figure 5-8 Class1 and Tag1 overview

In the PPA Configuration editor click on the Equipment table and


create the following Plant Model.

Copyright Siemens AG 2008 All rights reserved

Figure 5-9 Plant Model

Right click on the Test_Equip_01 to create new Property.

Figure 5-10 Create Property

V 2.0

Create the property associated to:

equipment Test_Equip_01

Tag1

Set as KPI checked

22.07.08

54/90

Manage PPA KPI without PM and without SIMATIC


BATCH integration
PPA KPIs without Production Modeler

26639558

Figure 5-11 Test_Equip_01 Property

Click on the Tag1 created in the Class1 to select its Property Definition in the KPI and Target Definition table.

Copyright Siemens AG 2008 All rights reserved

Figure 5-12 Tag1 Select Property Choose the Test_Prop_01

5.2

Create the PPA VB Script to activate/deactivate the KPIs


The COM interface of SIMATIC IT Plant Performance Analyzer is supplied
by means of four out-of-process COM components named respectively
PPACOM, PPAScheduler, PPAOBCOM and OBCOM.

V 2.0

22.07.08

55/90

Manage PPA KPI without PM and without SIMATIC


BATCH integration
PPA KPIs without Production Modeler

26639558

The PPACOM component retrieves data from SIMATIC IT PPA, which can
then be used by an application developed by a third party (for example, in
Visual Basic).
The PPAScheduler component schedules and activates properties and
tags/snapshots, which are configured in SIMATIC IT PPA.
The PPAOBCOM component exposes the functions relative to the custom
objects of SIMATIC IT PPA.
The OBCOM component exposes the functions necessary to set and get
the values of the custom objects properties created by PPAOBCOM Interfaces.

5.3

How to activate/ deactivate the KPIs created by user

Copyright Siemens AG 2008 All rights reserved

To manage the KPI created by the user we must follow these steps:

Create Production Key (PK) object in the PPA Database.

Sets a specific value for a key and stores the time at which it starts its
validity.

Activate the key.

Deactivate the key.

Resets a value previously set for a key on a specific piece of equipment


and stores the validity end time of the key.

Unregister the client from PPAScheduler.

In the following paragraphs we create three user functions:


1. F_SetKey function to set a specific value for a key and store the time at
which it starts its validity.
2. F_ScheduleVarByKeyID to activate the key.
3. F_ResetKet to deactivate the key and Reset a value previously set for a
key on a specific piece of equipment and store the validity end time of
the key.

Create PK object in the PPA Database


To create a PK object in the PPA Database please follow these steps:

V 2.0

In the PPA Configuration Editor click on the Script Library table and
create a new library called KPI_Lib; right click on the KPI_Lib to
add new Global Object called MySch.

22.07.08

56/90

Manage PPA KPI without PM and without SIMATIC


BATCH integration
PPA KPIs without Production Modeler

26639558

Copyright Siemens AG 2008 All rights reserved

Figure 5-13 New Global Object MySch

In the PPA Configuration Editor click on the Script Library table and
then edit the VBInit source inside the PPA\VBSystem.

Comment any code in this source using the symbol.

At the end of the VBInit source add these codes:

Dim retval, PK_ID


Set MySch =
CreateObject("PPAScheduler.PPASchedulerVBS.1")
retval = MySch.PPAInit("PKTest", PK_ID)
Dim allows us to declare some variant type internal variable.
CreateObject allows us to create an instance of the object called
PPAScheduler.PPASchedulerVBS.1 and then we can use its functions.
PPAInit is a PPAScheduler function and it allows us to register the client
for PPASchedulerVBS and create PK object in the PPA Database, it creates also the PK-ID associated to the PK object. This ID is unique.
In this way when the PPA server is started and this configuration has been
approved the system runs this script and creates the PKTest (in our example the PK name is hard coded in the script) in the PPA Database.
Unregister the client from PPAScheduler
To unregister the client from PPAScheduler please follows these steps:

Edit the VBEnd source inside the PPA\VBSystem.

Comment any code in this source using the symbol.

At the end of the VBEnd source add these codes:

Dim retval
retval = MySch.PPAEnd

V 2.0

22.07.08

57/90

Manage PPA KPI without PM and without SIMATIC


BATCH integration
PPA KPIs without Production Modeler

26639558

Set MySch = Nothing


PPAEnd is a PPAScheduler function and allows us to unregister the client
from PPAScheduler and performs an implicit reset for every key that has
been opened.
Set MySch = Nothing destroys the PPAScheduler instance.
In this way when the PPA server will stop the system resets every key and
destroys the PPAScheduler instance.
Set a specific value for a key
To set a specific value for a key and store the time at which it starts its validity please follows these steps:

Click on the KPI_Lib library and create a new function called


fSetKey and insert in this function three new parameters:

Copyright Siemens AG 2008 All rights reserved

Table 5-1

Name

Type

Description

iKeyID

RTDS Point

Key ID

TriggerTime

Trigger Time

Trigger Time

bTriggerTag

RTDS Point

Trigger Tag

Figure 5-14 fSetKey function and its parameters

Right click on the F_SetKey select Edit Source and insert this code:

Dim retval
If bTriggerTag.Value = 1 Then
retval = MySch.SetKey("Key_"& cstr(iKeyID.Value), _
"Test_Plant\Test_Area_01\Test_Equip_01", _
"Test Key_"& cstr(iKeyID.Value) & " " & _
"in the Test_Plant\Test_Area_01", _
TriggerTime)

V 2.0

22.07.08

58/90

Manage PPA KPI without PM and without SIMATIC


BATCH integration
PPA KPIs without Production Modeler

26639558

End If
To avoid that the fSetKey starts automatically when the PPA Server is
started we check the bTriggerTag.Value.
The SetKey is a PPAScheduler function and allows us to set a specific
value for a key and stores the time at which it starts its validity. The SetKey
function has these parameters:
.SetKey (KeyValue, EquipmentName, KeyAttribute, Time) where:
1. KeyValue is run-time key value.
2. EquipmentName is name and full path, starting from the equipment
root, of the equipment that the key value refers to. If multiple levels are
present, each level is separated by a backslash (\), e.g.
Cars\AssemblyLine.
Copyright Siemens AG 2008 All rights reserved

3. KeyAttribute is optional description string associated to the key.


4. Time is validity start time of the data stored in KeyValue, expressed as
UTC (seconds from 1/1/1970).
Activate the Key
In our test we would like to activate the Cyclic KPI and to do this please follow these steps:

Copy the fSetKey function to the new function called fScheduleVarByKeyID.

Also in this function we have three parameters as in the fSetKey function parameters:

Table 5-2

Name

Type

Description

iKeyID

RTDS Point

Key ID

TriggerTime

Trigger Time

Trigger Time

bTriggerTag

RTDS Point

Trigger Tag

Right click on the F_ScheduleVarByKeyID select Edit Source delete


all code in this function and insert new:

Dim retval, TimeUTC


If bTriggerTag.Value = 1 Then
retval =
MySch.ScheduleProperty("Key_"&cstr(iKeyID.Value), _
"Test_Plant\Test_Area_01\Test_Equip_01", _
TriggerTime, _

V 2.0

22.07.08

59/90

Manage PPA KPI without PM and without SIMATIC


BATCH integration
PPA KPIs without Production Modeler

26639558

"Test_Prop_01", _
"\", 1)
End If
Also there to avoid that the fScheduleVarByKeyID starts automatically
when the PPA Server is started we check the bTriggerTag.Value.
The ScheduleProperty is a PPAScheduler function and allows us to activate / deactivate a Cyclic or On Event Over Time property or triggers a
property On Event. The ScheduleProperty function has these parameters:
ScheduleProperty (KeyValue, KeyEquipment, Time, Property, Equipment,
Action) where:
1. KeyValue is run-time key value previously set by the SetKey method.

Copyright Siemens AG 2008 All rights reserved

2. KeyEquipment is name and full path, starting from the equipment root,
of the equipment on which the production key was set. If multiple levels
are present, each level is separated by a backslash (\), e.g.
Cars\AssemblyLine.
3. Time is property scheduling (i.e. activation/deactivation or trigger) time
expressed as UTC (seconds from 1/1/1970).
4. Property is name of the property to be scheduled (activated/deactivated
or triggered). In association with the equipment it is a member of, it
uniquely identifies a SIMATIC IT PPA tag.
5. Equipment is name of the equipment, which Property is a member of. It
needs not to coincide with KeyEquipment, but it must be a child of it.
The path is relative to KeyEquipment, therefore if they coincide, Equipment only consists in the separator (\), otherwise Equipment is expressed as the name and relative path of Equipment, starting with the
separator.
6. Action defines the scheduling type. Depending on the type of property,
it can assume the following values:

1 = Activation: for Cyclic properties, it indicates tag activation; for


properties On Event Over Time, it indicates the start of the acquisition interval. Not allowed for properties On Event

2 = Deactivation: for Cyclic properties, it indicates tag deactivation;


for properties On Event Over Time, it indicates the end of the acquisition interval. Not allowed for properties On Event.

3 = One shot: applies to On Event properties and means that the


trigger occurs at a specific moment rather than over a time range, or
that the time range is defined at a configuration level.

Deactivate the Key


In our test we would like to deactivate the Cyclic KPI and to do this please
follow these steps:

V 2.0

22.07.08

60/90

Manage PPA KPI without PM and without SIMATIC


BATCH integration
PPA KPIs without Production Modeler

26639558

Copy the fSetKey function to the new function called fResetKey

Also in this function we have three parameters as the fSetKey function


parameters:

Table 5-3

Name

Type

Description

iKeyID

RTDS Point

Key ID

TriggerTime

Trigger Time

Trigger Time

bTriggerTag

RTDS Point

Trigger Tag

Right click on the F_ResetKey select Edit Source delete all code in
this function and insert new:

Dim retval, TimeUTC


Copyright Siemens AG 2008 All rights reserved

If bTriggerTag.Value = 1 Then
retval =
MySch.ScheduleProperty("Key_"&cstr(iKeyID.Value), _
"Test_Plant\Test_Area_01\Test_Equip_01", _
TriggerTime, _
"Test_Prop_01", _
"\", 2)
End If
Also here to avoid that the F_ResetKey is started automatically when the
PPA Server is started we check the bTriggerTag.Value.
Please read the previous paragraph to have a description about ScheduleProperty parameters.
Resets a value previously set for a key
In the fResetKey function insert this code before the End If instruction at the
end of the function:

retval = MySch.ResetKey("Key_"& cstr(iKeyID.Value), _


"Test_Plant\Test_Area_01\Test_Equip_01", _
"Test Key_"& cstr(iKeyID.Value) & " " & _
"in the Test_Plant\Test_Area_01", _
TriggerTime)

V 2.0

22.07.08

61/90

Manage PPA KPI without PM and without SIMATIC


BATCH integration
PPA KPIs without Production Modeler

26639558

The ResetKey is a PPAScheduler function and allows us to reset a value


previously set for a key on a specific piece of equipment and stores the validity end time of the key. The ResetKey function has these parameters:
ResetKey (KeyValue, EquipmentName, KeyAttribute, Time) where:
1. KeyValue is run-time key value previously set by the SetKey method.
2. EquipmentName is name and full path, starting from the equipment
root, of the equipment containing the property that the key value refers
to. If multiple levels are present, each level is separated by a backslash
(\), e.g. Cars\AssemblyLine.
3. KeyAttribute is optional description string associated to the key.
4. Time is validity start time of the data stored in KeyValue, expressed as
UTC (seconds from 1/1/1970).

Copyright Siemens AG 2008 All rights reserved

5.4

PPA Class using script as data source


After creating our functions fSetKey, fScheduleVarByKeyID and fResetKey
now we must create a new class based on the script to trigger our function.
To do this please follows these steps:

In the Class table create a new class with these configurations:

Figure 5-15 Script_Class Data Source

V 2.0

22.07.08

62/90

Manage PPA KPI without PM and without SIMATIC


BATCH integration
PPA KPIs without Production Modeler

26639558

Copyright Siemens AG 2008 All rights reserved

Figure 5-16 Script_Class Trigger Condition On Data Change

Leave the Default Data and Folder to the default values.

In the Script_Class create also three tags, these tags are needed to activate the enclosed script:

Tag_SetKey
This tag is created and associated to the fSetKey function and we
need to define some parameters for this function.

Figure 5-17 Custom Function associated to the Tag

V 2.0

22.07.08

63/90

Manage PPA KPI without PM and without SIMATIC


BATCH integration
PPA KPIs without Production Modeler

26639558

Figure 5-18 Set Parameters

Copyright Siemens AG 2008 All rights reserved

V 2.0

Click on the parameter name the Set Value button will be able, now
we can choose RTDS integer variable connected to our Tag. When
the popup Set Parameter will appear select the check box Set as
Trigger for the iKeyID tag.

22.07.08

64/90

Manage PPA KPI without PM and without SIMATIC


BATCH integration
PPA KPIs without Production Modeler

26639558

Copyright Siemens AG 2008 All rights reserved

Figure 5-19 Choose RTDS point

V 2.0

Select RTDS Boolean point associated to our bTriggerTag. In this


case do not check the Set as Trigger. Let other Tag_SetKey setting parameter skipped default.

Tag_Schedule
This tag is created and associated to the fScheduleVarByKeyID and
also there we must set some parameters for this function. Note that
the bTriggerTag is connected at the same RTDS boolean point used
for the fSetKey, in this way when the RTDS boolean trigger tag is
true all the functions connected will be enabled at the same time.

22.07.08

65/90

Manage PPA KPI without PM and without SIMATIC


BATCH integration
PPA KPIs without Production Modeler

26639558

Figure 5-20 Custom Function associated to the Tag

Copyright Siemens AG 2008 All rights reserved

Figure 5-21 Set Parameters

Tag_ResetKey
This tag is created and associated to the fResetKey and also there
we must set some parameters for this function. Note that the bTriggerTag is connected to the same RTDS boolean point used for the
fSetKey and fScheduleVarByKeyID, in this way when the RTDS
boolean trigger tag is true all the functions connected will be enabled at the same time.

Figure 5-22 Custom Function associated to the Tag

V 2.0

22.07.08

66/90

Manage PPA KPI without PM and without SIMATIC


BATCH integration
PPA KPIs without Production Modeler

26639558

Figure 5-23 Set Parameters

In summary we have created these RTDS tags to manage our scripts:


Copyright Siemens AG 2008 All rights reserved

Table 5-4

RTDS Tag

Type

PPA Tag

Script

Test_PB0

Boolean

Trigger_Test_PB0

fSetKey / fScheduleVarByKeyID /
fResetKey

Test_PI1

Integer

SetKey_Test_PI1

fSetKey

Test_PI2

Integer

Schedule_Test_PI2

fScheduleVarByKeyID

Test_PI3

Integer

ResetKey_Test_PI3

fResetKey

5.5

Testing KPI created manually


After approving the new configuration and activating the new configuration
we can open the PPA online monitoring environment to test our script.
The following Windows Task Manager List shows the different processes
listed before/after running PPA server.

V 2.0

22.07.08

67/90

Manage PPA KPI without PM and without SIMATIC


BATCH integration
PPA KPIs without Production Modeler

26639558

Copyright Siemens AG 2008 All rights reserved

Figure 5-24 Windows Task Manager list before PPA server running

Figure 5-25 Windows Task Manager list after PPA server running

V 2.0

22.07.08

68/90

Manage PPA KPI without PM and without SIMATIC


BATCH integration
PPA KPIs without Production Modeler

5.5.1

26639558

PPA Online Monitoring


When the PPA Online Monitoring opens, click on the Equipment table, expand the Test_Plant\Test_Area_1 and click on the Test_Equip_01 the
system shows us the Test_Prop_01 property details.
Figure 5-26 PPA Online Monitoring Test_Equip_01

Copyright Siemens AG 2008 All rights reserved

Figure 5-27 PPA Online Monitoring Test_Prop_01 details

In the Test_Prop_01 details we have:

V 2.0

Name Property Name

Status can have one of the following status:

Enable Running The engine is archiving the item according to the


desired configuration.

Disabled Online The engine is not managing the item and no


event related to the item is being checked for.

Idle Enabled The item is currently not being archived because the
trigger event is inactive.

Configuration Error PPAEngine is ignoring the item due to a configuration error detected at run-time by the engine.

Runtime Error This error can occur only on items associated to a


SCRIPT data source, either if the function generates a VBScript runtime error or if it times out. Unlike with configuration errors, in case
of a run-time error PPAEngine will retry to manage the item at the
next trigger and, if the error does not occur any more, PPAEngine
restarts archiving the item.

Description Property description

KPI Type For scheduling the KPI by Production Modeler.

Type Type of the associated item:

22.07.08

69/90

Manage PPA KPI without PM and without SIMATIC


BATCH integration
PPA KPIs without Production Modeler

5.5.2

Tag

Snapshot

26639558

Item Name Tag name associated to the Property

KPI Property as a KPI or not

Using SIMATIC IT Historian ODS to activate/ deactivate the script


In the 5.4 we associated some RTDS points to our script. Now in the
SIMATIC IT Management Console we must start the Operation Debugging
Support (ODS) to manage these tags.

Copyright Siemens AG 2008 All rights reserved

Figure 5-28 Run ODS

When the ODS window is open, create a new monitor and add the tags associated to the script before.
Figure 5-29 Create new ODS monitor

We can add RTDS tags in the new ODS monitor clicking on the icon

V 2.0

22.07.08

70/90

Manage PPA KPI without PM and without SIMATIC


BATCH integration
PPA KPIs without Production Modeler

26639558

Figure 5-30 Add tags in the ODS monitor

Copyright Siemens AG 2008 All rights reserved

The PPA Online Monitoring and the SIMATIC IT Historian ODS are displayed in the following figure:
Figure 5-31 PPA Online Monitoring and ODS

To activate the script we need to set the Test_PB0 Trigger Tag to TRUE,
then changing value for:

V 2.0

Test_PI1 tag to activate the function fSetKey the key registered in the
PPA database will have the name KEY_[tag value]

Test_PI3 to activate the function fResetKey

Test_PI2 to activate the function fScheduleVarByKeyID

22.07.08

71/90

Manage PPA KPI without PM and without SIMATIC


BATCH integration
PPA KPIs without Production Modeler

26639558

Changing the Test_PI1value to 104 and then open the SQL Enterprise
Manager we can see the Key created in the PPA SQL table.
Figure 5-32 KEY created in the PPA SQL database

Copyright Siemens AG 2008 All rights reserved

In this SQL table we have the information about our KEY:

KeyValueID unique Key Value ID associated to the our Key.

KeyID Key ID associated to the PKTest created using the PPAScheduler function PPAInit. We can check this information opening the SQL.

Figure 5-33 KeyID associated to the PKTest created using P

KeyValue Key name

Description Key description

Time / Msec Validity start time of the data stored in KeyValue, expressed as UTC (seconds from 1/1/1970).

EquipmentID Unique ID associated to the equipment where the property is contained.

Changing the Test_PI2 value to 104 we activate the fScheduleVarByKeyID


script function and start to archive tag value and associate these samples
to our PKTest.

V 2.0

22.07.08

72/90

Manage PPA KPI without PM and without SIMATIC


BATCH integration
PPA KPIs without Production Modeler

26639558

Figure 5-34 Activate fScheduleVarByKeyID script function

Right click on the Tag1 and select the Query Statistics we can check the
number of samples archived. When these samples are enough to be visualized by a trend we can stop the archiving

Copyright Siemens AG 2008 All rights reserved

Figure 5-35 Activate Query Statistics

Figure 5-36 Samples number in the Query Statistics window

V 2.0

22.07.08

73/90

Manage PPA KPI without PM and without SIMATIC


BATCH integration
PPA KPIs without Production Modeler

26639558

Changing the Test_PI3 value to 104 we activate the fResetKey script function and stop to archive tag value.
Figure 5-37 Activate ffResetKey script function

Opening the SQL Enterprise Manager we can see the KEY stopped to archive the samples.

Copyright Siemens AG 2008 All rights reserved

Figure 5-38 KEY_31 stopped by fResetKey function

To show the archived samples we must open the SIMATIC IT Historian


HDD.
Figure 5-39 Run SIMATIC IT HDD

When the HDD window is open create a new Production Viewer.

V 2.0

22.07.08

74/90

Manage PPA KPI without PM and without SIMATIC


BATCH integration
PPA KPIs without Production Modeler

26639558

Figure 5-40 Production Viewer

When the new production viewer window is open, click on the configuration
wizard to configure it.

Copyright Siemens AG 2008 All rights reserved

Figure 5-41 Configure Production Viewer

V 2.0

22.07.08

75/90

Manage PPA KPI without PM and without SIMATIC


BATCH integration
PPA KPIs without Production Modeler

26639558

Copyright Siemens AG 2008 All rights reserved

Figure 5-42 Click on "Next" button to continue

V 2.0

22.07.08

76/90

Manage PPA KPI without PM and without SIMATIC


BATCH integration
PPA KPIs without Production Modeler

26639558

Copyright Siemens AG 2008 All rights reserved

Figure 5-43 Choose ONLINE archive and click on "Next" button to continue

Figure 5-44 In the Key drop down choose PKTest Production Key

V 2.0

22.07.08

77/90

Manage PPA KPI without PM and without SIMATIC


BATCH integration
PPA KPIs without Production Modeler

26639558

Figure 5-45 Choose appropriate time stamp to view the PK

Copyright Siemens AG 2008 All rights reserved

Figure 5-46 Click on "Finish" button to finish the Configuration Wizard

V 2.0

22.07.08

78/90

Manage PPA KPI without PM and without SIMATIC


BATCH integration
PPA KPIs without Production Modeler

26639558

Copyright Siemens AG 2008 All rights reserved

Figure 5-47 Production Key General viewer

In the General tab of this viewer we can have information about our
KEY_31 KPI:

V 2.0

Key Value (name)

Key description

Start time to archive samples

End time to archive samples

Equipment where the property is contained

22.07.08

79/90

Manage PPA KPI without PM and without SIMATIC


BATCH integration
PPA KPIs without Production Modeler

26639558

Copyright Siemens AG 2008 All rights reserved

Figure 5-48 Production Key KPI viewer

In the KPI tab of this viewer we can have information about our KEY_31
KPI:

Property name

Value - are there samples archived for this KPI or not

Equipment path where Equipment property is contained

Item name

Right click on the Test_Prop_01 property name and click on Add To


New > Standard Trend we can show these value in the HDD trend
format.
Figure 5-49 Adding KPI value in the HDD Standard Trend

V 2.0

22.07.08

80/90

Manage PPA KPI without PM and without SIMATIC


BATCH integration
PPA KPIs without Production Modeler

26639558

Copyright Siemens AG 2008 All rights reserved

Figure 5-50 KPI values

The Start to Archiving corresponds to the time when the fSetKey function
started. The Sample Archived corresponds to the time when the fScheduleVarByKeyID started and the Stop to Archiving corresponds to the time
when the fResetKey function started.

V 2.0

22.07.08

81/90

Manage PPA KPI without PM and without SIMATIC


BATCH integration
PPA KPIs without Production Modeler

5.5.3

26639558

How to compare two different custom KPIs?


There is no system function which allows you to compare two different custom KPIs archived in the PPA DB. The PPA exposes some COM methods
and using the Microsoft VB we can retrieve all information and data from
our KPI. In the following steps one example how to extract the KPIs value
using VB is shown.

Example to retrieve the custom KPIs value using VB


There are five steps you must perform if you need to manage the custom
KPIs archived in the PPA DB:
1. Retrieve the PPA project configuration as PPA DB, PPA Server and
SQL Server.
2. Open the connection to the PPA Project.
3. Get the KPIs list.
Copyright Siemens AG 2008 All rights reserved

4. Select the KPI and then get the KEY list associated to this KPI.
5. Retrieve the values archived selecting the KEY in KEY list.
Create one function to retrieve the PPA project configuration like this:

Private Sub GetPPAProjList_Click()


Dim strdelc As Variant
GetPPAProjList.Enabled = False
Set GetProjList = New PPAProjectBrowsing
strdelc = GetProjList.GetProjectList(projects)
If strdelc = PPA_SUCCESS Then
PPADB.Clear
For i = 1 To projects.Count
PPADB.AddItem (projects.Item(i).SQLDatabase)
Next
PPADB.Text = projects.Item(1).SQLDatabase
PPASrv.Text = projects.Item(1).PPAServer
SQLSrv.Text = projects.Item(1).SQLServer
PPADB.Enabled = True
OpenConnect.Enabled = True
Else
MsgBox "An error occurred in GetProjectList " &
strdelc & ".", vbCritical

V 2.0

22.07.08

82/90

Manage PPA KPI without PM and without SIMATIC


BATCH integration
PPA KPIs without Production Modeler

26639558

End If
GetPPAProjList.Enabled = True
End Sub
After that we must connect to the PPA server using the information coming
from the previous function:

Private Sub OpenConnect_Click()


Dim RetVal
' connect to DB-the Connect is Public Function provide to create some PPA object and
' open the connection to the SQL instance. Return
PPA_RETURN_VALUE
Copyright Siemens AG 2008 All rights reserved

RetVal = TestPPA.Connect(SQLSrv.Text, PPADB.Text,


PPASrv.Text)
If (RetVal <> PPA_SUCCESS) Then
MsgBox "An error occurred in PPABrowsing connecting
to " & strSQL & ".", vbCritical
Else
MsgBox "PPABrowsing connected to " & SQLSrv.Text
PPAPKList.Enabled = True
GetPKList.Enabled = True
OpenConnect.Enabled = False
PPADB.Enabled = False
End If
End Sub

V 2.0

22.07.08

83/90

Manage PPA KPI without PM and without SIMATIC


BATCH integration
PPA KPIs without Production Modeler

26639558

The property Connect in the previous function is the custom property like
this:
Public Function Connect(ByVal strSQL As String, ByVal
strPPA_Db As String, ByVal strPPA) As PPA_RETURN_VALUE
Dim RetVal As PPA_RETURN_VALUE
Set MySch = CreateObject("PPAScheduler.Schedule.1",
strPPA)
Set MyAccVBS = CreateObject("PPACOM.PPAAccessVBS.1",
strPPA)
Set MyBrwVBS = CreateObject("PPACOM.PPABrowsingVBS.1", strPPA)
Set GetServ = CreateObject("PPAScheduler.PPAItemManagement.1", strPPA)

Copyright Siemens AG 2008 All rights reserved

Set PKAccessCli = CreateObject("PPAOBCOMCLI.PPAProductionKeyAccess.1", strPPA)


' PPAOBCOMCli.PPAProductionKeyAccess.1
Connect = MyBrwVBS.OpenConnection(strSQL, strPPA_Db)
End Function
Create one function to retrieve all KEY associated to the KPI selected. We
use one data grid to fill the result.

Private Sub GetKeyList_Click()


Dim RunSQLErr As String
Dim strSQL As String
strSQL = "select distinct t1.keyvalue, t1.keyvalueid,
t2.equipmentname, t4.PropertyName "
strSQL = strSQL & "From ((dbo.view_read_keyvalue t1
join dbo.Equipment t2 on t1.keyid = 4 and "
strSQL = strSQL & "(t2.equipmentid = t1.equipmentid))
join dbo.equipment_property t3 on "
strSQL = strSQL & "(t3.equipmentid = t1.equipmentid)
and (t3.version_id = (select distinct t6.Version_Id
from "
strSQL = strSQL & "(dbo.version_history t7 Join
(dbo.ProductionKey t5 Join dbo.Productionkey_version t6
on "
strSQL = strSQL & "t5.keyname = 'PKTest') on
t7.is_current = 1 and t6.Version_Id = t7.Version_Id)))
Join "
strSQL = strSQL & "dbo.Property t4 on (t3.PropertyID
= t4.PropertyID)) Order by t1.keyvalue ASC"

V 2.0

22.07.08

84/90

Manage PPA KPI without PM and without SIMATIC


BATCH integration
PPA KPIs without Production Modeler

26639558

RetVal = RunSQL(strSQL, RunSQLErr)


Set DataGrid2.DataSource = Nothing
Set DataGrid2.DataSource = recTemp
DataGrid2.ReBind
TotalRecKeyVal.Text = "Total Records: " & recTemp.RecordCount
Set recTemp = Nothing
End Sub
Selecting one of the KEY present in the KEY list we can retrieve the values
associated to this KEY.

Private Sub DataGrid2_SelChange(Cancel As Integer)


Copyright Siemens AG 2008 All rights reserved

Dim RunSQLErr As String


Dim strSQL As String
If ((DataGrid2.Row > -1) And (DataGrid2.SelStartCol =
-1)) Then
DataGrid2.Col = 1
KeyValueID = DataGrid2.Text
strSQL = "select distinct Point, Name, PointID from
PPA_Test.dbo.Point t1 "
strSQL = strSQL & "where t1.PointID in (select
t2.PointID from PPA_Test.dbo.Tag t2 "
strSQL = strSQL & "where t2.TagID in (select distinct v1.TagID from View_Read_IndexedFloatArchive v1 "
strSQL = strSQL & "where v1.KeyValueId = '" & KeyValueID & "')) order by Point"
RetVal = RunSQL(strSQL, RunSQLErr)
Set DataGrid3.DataSource = Nothing
Set DataGrid3.DataSource = recTemp
DataGrid3.ReBind
GetValArch.Enabled = True
GetTagList.Enabled = True
Else
End If
End Sub

V 2.0

22.07.08

85/90

Manage PPA KPI without PM and without SIMATIC


BATCH integration
PPA KPIs without Production Modeler

26639558

Also in this function we use one data grid to fill the result. The RunSQL in
the previous function is the custom function like this:

' This function allow us to run the SQL query, but this
query must start with SELECT statement.
' The return is recTemp global variable declaired in
General/Declarations
Public Function RunSQL(ByVal strSQL As String, ByRef
strError As String, Optional ByRef varValues As Variant, _
Optional ByVal
msgBoxAdv As Boolean) As Long
Dim dbConnection As ADODB.Connection
base connection object

' data-

Dim strTemp() As String


Copyright Siemens AG 2008 All rights reserved

RunSQL = -1
strTemp = Split(strSQL, " ")
' What kind of SQL Statement ?
Select Case Trim(Ucase(Replace(strTemp(0), """",
"")))
Case "SELECT"
Set dbConnection = New ADODB.Connection
' The connection string in this case is hardcoded but we can also read it from the txt file
dbConnection.ConnectionString = "Provider=SQLOLEDB.1;Password=password;Persist Security
Info=True;User ID=sa;Initial Catalog=PPA_Test;Data
Source=SITCOMP\SQL05;"
dbConnection.Open
Set recTemp = New ADODB.Recordset
recTemp.Open strSQL, dbConnection, adOpenStatic, adLockReadOnly, adCmdText
Case Else
strError = "Unknown/Wrong SQL Statement (only
SELECT statement SQL Query supported): " & strSQL
End Select
Set dbConnection = Nothing
End Function

V 2.0

22.07.08

86/90

Manage PPA KPI without PM and without SIMATIC


BATCH integration
PPA KPIs without Production Modeler

26639558

Now we have the KPI values and we can use Microsoft Excel to compare
or manage these data.

Copyright Siemens AG 2008 All rights reserved

Figure 5-51 KPI values from Microsoft VB

V 2.0

22.07.08

87/90

References
PPA KPIs without Production Modeler

26639558

References

From SIEMENS software installation path:

From SIEMENS sources:

SIMATIC IT online help

From the SIEMENS Service & Support Portal:

SIMATIC software in a domain

Data exchange between SIMATIC PCS7 / BATCH and SIMATIC IT


Historian

Copyright Siemens AG 2008 All rights reserved

..\ICUBESYS\SIT\BIN\PPACOMENG.CHM

V 2.0

22.07.08

88/90

Abbreviations
PPA KPIs without Production Modeler

26639558

Abbreviations
Abbreviations used in this manual:
Table 7-1

Copyright Siemens AG 2008 All rights reserved

Abbreviation

V 2.0

Complete name

AD

Active Directory

API

Application Programming Interface

AT

Audit Trail

BPM

Business Process Modeler

BCC

Batch Control Center

CAB

Client Application Builder

CH_DI

Channel Digital Input

CH_DO

Channel Digital Output

CIL

Cross Industry Library

COM

Component Object Model

CP

Communication Processor

CPU

Central Processor Unit

CS

Compliance Service

DB

Data Base

DCF

Distributed Configuration File

DCOM

Distributed Component Object Model

DHCP

Dynamic Host Configuration Protocol

DCS

Distribution Control System

DIS

Data Integration Service

DNS

Domain Name Service

EBR

Electronic Batch Reporting

ES

Engineering System

ESIG

Electronic SIGnature

FAQ

Frequent Asked Question

GMP

Good Manufacturing Practice

HDD

Historical Data Display

HF

Hot Fix

HMI

Human Machine Interface

IP

Internet Protocol

ISA

Industry Standard Architecture

KPI

Key Performance Indicator

LTA

Long Term Archiving

MM

Material Manager

22.07.08

89/90

Abbreviations
PPA KPIs without Production Modeler

26639558

Copyright Siemens AG 2008 All rights reserved

Abbreviation

V 2.0

Complete name

MR

Master Recipe

MUI

Multilanguage User Interface

ODBC

Open Data Base Connectivity

OPC

Ole for Process Communication

OS

Operator Station

OSM

Optical Switch Module

OU

Organizational Unit

PLC

Programmable Logical unit

PPA

Plant Performance Analyzer

PDA

Plant Data Archive

PDefM

Production Definition Manager

PK

Production Key

PM

Production Modeler

PRS

Production Suite

RTDS

Real Time Data Server

SFC

Sequence Function Chart

SIT

SIMATIC IT

SQL

Structured Query Language

SP

Service Pack

UPS

Uninterruptible Power Supplies

UTC

Universal Time Coordinated

VB

Visual Basic

WINS

Windows Internet Naming Service

22.07.08

90/90

Você também pode gostar