Escolar Documentos
Profissional Documentos
Cultura Documentos
Technical Paper
Using Proficy Real-time Information Portal for Event
Creation in Proficy Plant Applications
Software
EUROPE
18/07/2005
Version: 1.0
Software
Technical Paper
Using Proficy Real-time Information
Portal for Event Creation in Proficy
Plant Applications
GE Fanuc Automation
This Technical Paper describes a method to use Proficy Real-time Information Portal for Event Creation in
Proficy Plant Applications.
Release: 18/07/2005
File: 287775018.doc
Page 2 of 21
Jakob Hall
Software
Technical Paper
Using Proficy Real-time Information
Portal for Event Creation in Proficy
Plant Applications
GE Fanuc Automation
Revision History
Table - Revision Status lists the latest version and date for the various sections of the specification.
Versions 0.X are prerelease draft versions.
Versions 1.X to X.X are post release versions.
The number to the left of the decimal in the version number indicates the major version number. The
number to the right of the decimal in the version number indicates the minor version number.
The major version number will change for the following reasons:
Information added to document.
Information removed from document.
Rearrangement of sections in the document.
Revisions to the scope or purpose of the document.
The minor version number will change for the following reasons:
Spelling corrections.
Page layout or formatting corrections.
Minor changes that do not affect the scope or purpose of the document.
Version
Date
1.0
18.07.2005
Description
Initial release
Release: 18/07/2005
File: 287775018.doc
Page 3 of 21
Jakob Hall
Software
Technical Paper
Using Proficy Real-time Information
Portal for Event Creation in Proficy
Plant Applications
GE Fanuc Automation
Table of Contents
1
2
3
4
5
6
Introduction.......................................................................................................................................................... 5
Overview............................................................................................................................................................... 6
Creating Local Result Set Tables................................................................................................................. 10
Creating 601 Models in PA................................................................................................................................ 11
Creating the SQL Historian................................................................................................................................. 8
Controls and Statements within RTIP..............................................................................................................13
6.1
DEFINE RTIP CONTROLS............................................................................................................ 13
6.1.1 Production Unit.................................................................................................................... 13
6.1.2 Production Line.................................................................................................................... 13
6.1.3 Department.......................................................................................................................... 13
6.1.4 Batch Number...................................................................................................................... 14
6.2
CREATE STATEMENT................................................................................................................... 14
Release: 18/07/2005
File: 287775018.doc
Page 4 of 21
Jakob Hall
Software
Technical Paper
Using Proficy Real-time Information
Portal for Event Creation in Proficy
Plant Applications
GE Fanuc Automation
1 Introduction
This document describes a method step-by-step to use Proficy Real Time Information Portal (from now on
RTIP) as a front end for Proficy Plant Applications (from now on PA). The versions used are RTIP version
2.5 build 2107 and PA version 4.1.
It is assumed that the reader is experienced in configuring and setup PA, including experience with SQL
Stored Procedures and Result Sets.
Release: 18/07/2005
File: 287775018.doc
Page 5 of 21
Jakob Hall
Software
Technical Paper
Using Proficy Real-time Information
Portal for Event Creation in Proficy
Plant Applications
GE Fanuc Automation
2 Overview
This method utilize the messaging system employed by PA, that allow safe updates of the database and
notify the standard thick PA clients about the changes made. Result Sets allow you to add real time
messages to Model based custom SQL Stored Procedures and to Plant Applications Variable Stored
Procedure Calculations. The Models are triggered by the Event Manager service and the Calculations are
triggered by the Calculation Manager service So it has to be one of these services that sends out a
result set for having the PA messaging system recognize it as an update of the PA database and to
ensure updates of the standard thick PA clients. These services are not directly accessible from within
RTIP.
One of the great features within RTIP is the possibility to write SQL statements, including end-user
selections as inputs. These statements can be select, insert, update or delete statements, but it can also
be a call statement that can execute a stored procedure. This method is utilizing this feature: the stored
procedure executes logic that transforms the end-user selections into the type of data needed for a
specific result set and the data is then inserted into a local Result Set table. The columns and order of
the local Result Set table are equivalent with the parameters and order of the specific result set.
There is a one-to-one relation between the type of events that should be created, updated or deleted from
RTIP and different local Result Set tables.
The stored procedure executed from within RTIP is also updating a tag within a SQL based historian. This
is done since RTIP do not have directly access to the Event Manager service or the Calculation Manager
service. The SQL Historian includes tags for each different event type that needs to be created, updated
or deleted from within RTIP. Using the generic 601 model, PA can be configured to have the Event
Manager service executing a stored procedure, when a tag in the SQL based historian is changing value.
The stored procedure (executed by the Event Manager service) is taking data from the local Result Set
table and sends it out as a result set the PA database will then be updated and the standard thick PA
clients will be notified about the changes.
Figure 1 below visualizes the method. The stored procedures and table on the PA side (the blue dotted
box on the right side of the figure) will be the same for each project and site, and only the configuration of
the pages and the statements on the RTIP side will differ which is bringing the implementation time
down.
Figure 1
Release: 18/07/2005
File: 287775018.doc
Page 6 of 21
Jakob Hall
Software
Technical Paper
Using Proficy Real-time Information
Portal for Event Creation in Proficy
Plant Applications
GE Fanuc Automation
The following sections will go step-by-step through Figure 1 (from right to left), starting with how to create
the SQL Historian, how to create the local Result Set tables, how to set up the 601 models and finalizing
with a section with an example on how to create statements in RTIP and linking end-user selection with
the statements.
The document includes import files and stored procedures that will cover most of the actions that needs
to be done, and the steps on the PA side will be equivalent for all projects including a RTIP as front-end
of PA scope.
This document includes result sets for Production Events, Variable Values, Grade Change, Downtime
Events, User Defined Events, Waste Events and Production Plan. It should be easy to use the attached
examples to extend the functionality to cover other Events than the one provided.
Release: 18/07/2005
File: 287775018.doc
Page 7 of 21
Jakob Hall
Software
Technical Paper
Using Proficy Real-time Information
Portal for Event Creation in Proficy
Plant Applications
GE Fanuc Automation
S QL His torian.zip
ReadBeforeSQL
ReadBetweenSQL
TimeSQL
More information about SQL Historian can be found in the Proficy Plant Applications Administrator
Documentation.
The Tag-Ids is the number of the Result Set Example: A value change for the tag with Tag-Id equals 1
will activate the 601 model for the Production Event.
Remark that it is needed to fill in a tag value for each tag in the SQL Historian before the tag can be seen
from a browse tag window in PA administrator. The scripts in Insert Tag Values zip file can be used to
Release: 18/07/2005
File: 287775018.doc
Page 8 of 21
Jakob Hall
Software
Technical Paper
Using Proficy Real-time Information
Portal for Event Creation in Proficy
Plant Applications
GE Fanuc Automation
insert the first values for Production Events, Variable Values, Grade Change, Downtime Events, User
Defined Events, Waste Events and Production Plan.
Release: 18/07/2005
File: 287775018.doc
Page 9 of 21
Jakob Hall
Software
Technical Paper
Using Proficy Real-time Information
Portal for Event Creation in Proficy
Plant Applications
GE Fanuc Automation
Release: 18/07/2005
File: 287775018.doc
Page 10 of 21
Jakob Hall
Software
Technical Paper
Using Proficy Real-time Information
Portal for Event Creation in Proficy
Plant Applications
GE Fanuc Automation
The different models are triggering a stored procedure when a value change occurs for a specific tag in
the SQL Historian. The stored procedure follows the structure below (this example is using the Production
Event. The Local_RTIPProductionEvents is the local Result Set table and the Local_SQLHistorian is the
SQL Historian table):
CREATE Procedure spLocal_TriggerRTIPProductionEvents
@ReturnStatus int OUTPUT,
@ReturnMessage varchar(255) OUTPUT,
@EC_Id int,
@TriggerTimestamp datetime
AS
Declare
@MaxTimeStamp DateTime
-- In case a end-user inserts a new row during the execution of this SP
Update Local_RTIPProductionEvents Set Flag = 1 Where Flag = 0
-- Select * from local Result Set table
Select 1, Id, Transaction_Type, Event_Id, Event_Num, PU_Id, Convert(VarChar(30),TimeStamp,120),
Applied_Product, Source_Event, Event_Status, Confirmed, User_Id, Post_Update, Conformance,
TestPctComplete, StartTime, TransNum, TestingStatus, CommentId, EventSubTypeId, EntryOn,
ApprovedUserId, SecondUserId, ApprovedReasonId, UserReasonId, UserSignOffId, ExtendedInfo
From Local_RTIPProductionEvents Where Flag = 1
-- Deletes processed rows from the local Result Set table
Delete From Local_RTIPProductionEvents Where Flag = 1
-- Set @MaxTimeStamp to the latest time where the specific tag in the SQL Historian was changed
Select @MaxTimeStamp = Max(tTimeStamp) From Local_SQLHistorian Where Tag_Id = 1
-- Delete all tag changes from the SQL Historian but the last
Delete From Local_SQLHistorian Where Tag_Id = 1 and tTimeStamp <> @MaxTimeStamp
The zip file below includes the stored procedures for Production Events, Variable Values, Grade Change,
Downtime Events, User Defined Events, Waste Events and Production Plan. These scripts need to be
executed within a SQL Query Analyzer.
Release: 18/07/2005
File: 287775018.doc
Page 11 of 21
Jakob Hall
Software
Technical Paper
Using Proficy Real-time Information
Portal for Event Creation in Proficy
Plant Applications
GE Fanuc Automation
The model has to be set up at any production unit in the Plant Model (one unit could be created only for
this purpose). The models can be configured importing the Excel sheet below. Remember to substitute
the Production Line, Production Unit, Event Subtype and name of the SQL Historian.
Activate the models in the Proficy Plant Applications Administrator. Navigate to the unit where the Models
have been attached. Select Configure Events, select the Configure Event Detection Models and active
the models one-by-one.
Release: 18/07/2005
File: 287775018.doc
Page 12 of 21
Jakob Hall
Software
Technical Paper
Using Proficy Real-time Information
Portal for Event Creation in Proficy
Plant Applications
GE Fanuc Automation
6.1.1
1.
2.
3.
4.
5.
The Production Unit control has been dragged from the system tree (see figure
The Object Type has been selected as a combo box
Both Unit Description and Unit Id columns has been displayed
Selected Item Column is Unit Description
Selected Value Column is Unit Id
6.1.2
1.
2.
3.
4.
5.
6.
Production Line
The Production Line control has been dragged from the system tree
The Object Type has been selected as a combo box
Both Line Description and Line Id columns has been displayed
Selected Item Column is Line Description
Selected Value Column is Line Id
The Select Value Property has been linked to the Line Id of the Production Unit control
6.1.3
1.
2.
3.
4.
5.
6.
Production Unit
Department
The Department control has been dragged from the system tree
The Object Type has been selected as a combo box
Both Department Description and Department Id columns has been displayed
Selected Item Column is Department Description
Selected Value Column is Department Id
The Select Value Property has been linked to the Department Id of the Production Line control
Release: 18/07/2005
File: 287775018.doc
Page 13 of 21
Jakob Hall
Software
Technical Paper
Using Proficy Real-time Information
Portal for Event Creation in Proficy
Plant Applications
GE Fanuc Automation
Figure 2
6.1.4
Batch Number
Figure 3
6.2Create Statement
The only task for the statement used from RTIP to Create, Update or Delete an event in PA is to insert the
parameter values into the local Result Set table. This is done using a Call statement, executing a
stored procedure. The Call statement will include input values coming from the end-user selections (in
our example this will be the Production Unit Id and Batch Number). These input values can now be used
directly as parameter values into the local Result Set table or used to derive other parameter values.
In our example the stored procedure looks as follows:
Release: 18/07/2005
File: 287775018.doc
Page 14 of 21
Jakob Hall
Software
Technical Paper
Using Proficy Real-time Information
Portal for Event Creation in Proficy
Plant Applications
GE Fanuc Automation
Page 15 of 21
Jakob Hall
Software
Technical Paper
Using Proficy Real-time Information
Portal for Event Creation in Proficy
Plant Applications
GE Fanuc Automation
If @BatchExist <> 0
Begin
Select 'Batch already exists' as Message
Return
End
-- Send success message
Select 'Success Updating: ' + @BatchNum as Message
This script needs to be executed in a SQL Query Analyzer and can be found in the zip-file below:
Before using the stored procedure in a Call statement it has to be included in a Schema (see RTIP
documentation for how to create Schemas). Select the Schema where you want to include the stored
procedure in the SQL Statement Builder, right click and select Add Table etc..
Figure 4
Select that the Schema contains Procedures. Click Next >.
Figure 5
Release: 18/07/2005
File: 287775018.doc
Page 16 of 21
Jakob Hall
Software
Technical Paper
Using Proficy Real-time Information
Portal for Event Creation in Proficy
Plant Applications
GE Fanuc Automation
Select the stored procedures that should be added to the Schema. Click Next > and Finish, and the
stored procedure are now included.
Select New Statement in the SQL Statement Builder and select Call as the type of SQL statement.
Hereafter drag the stored procedure from the Schema folder into the empty Table Diagram frame.
Figure 6
Save the Statement and give it a name.
RTIP has already built the Statement in the SQL Statement frame, and has selected names for the input
parameters (par0_@BatchNum and par1_@PUId). RTIP concludes these input parameters by looking at
the header of the stored procedure, but it is needed to execute the stored procedure from inside RTIP for
RTIP to know what type of output it should expect. Execute Statement
will prompt for values for the
input parameters.
Figure 7
Release: 18/07/2005
File: 287775018.doc
Page 17 of 21
Jakob Hall
Software
Technical Paper
Using Proficy Real-time Information
Portal for Event Creation in Proficy
Plant Applications
GE Fanuc Automation
Click OK.
Figure 8
The result frame displays the output of the stored procedure (Message: Success Updating: ABC002).
Return to the configure mode of the display with the input parameter, select the Data Source tab in the
System Tree and drag the Statement just created into the display. Select the Object Type as Text Box and
select to display the message column.
Release: 18/07/2005
File: 287775018.doc
Page 18 of 21
Jakob Hall
Software
Technical Paper
Using Proficy Real-time Information
Portal for Event Creation in Proficy
Plant Applications
GE Fanuc Automation
Figure 9
Select the Production Unit Combo Box and link the Selected Value property to the Message Text Box
par1_@PUId.
Figure 10
Release: 18/07/2005
File: 287775018.doc
Page 19 of 21
Jakob Hall
Software
Technical Paper
Using Proficy Real-time Information
Portal for Event Creation in Proficy
Plant Applications
GE Fanuc Automation
Select the Batch Number Text Box and link the Text property to the Message Text Box par0_@BatchNum.
Figure 11
Now the two input values are linked to the input parameter of the statement. The last thing is a button to
execute the statement. Insert the button and link the control to the Text Box Insert Batch (the Message
Text Box).
Release: 18/07/2005
File: 287775018.doc
Page 20 of 21
Jakob Hall
Software
Technical Paper
Using Proficy Real-time Information
Portal for Event Creation in Proficy
Plant Applications
GE Fanuc Automation
Figure 12
Thats it. Now change the display to Run Mode and Select Department, Production Line, Production Unit
and Insert Batch Number and Click on the Create Batch button to create a new Batch within the Proficy
Plant Applications Database.
Figure 13
Release: 18/07/2005
File: 287775018.doc
Page 21 of 21
Jakob Hall