Professional Documents
Culture Documents
FactoryTalk Historian and PIOLEDB Provider
FactoryTalk Historian and PIOLEDB Provider
Application Requirements
A requirement for the FactoryTalk Historian PIOleDb Data Provider is Administrator privileges to install.
When the install is run it will deploy the PISDK and all necessary components such as MDAC. To access
the PIOleDb Data Provider programmatically you will need Visual Studio 6 or Visual Studio .Net.
Microsoft .Net Visual Studio 2008 is recommended. Here is a list of the components that are installed
by the FactoryTalk Historian PIOleDb Install. The current supported version of the FactoryTalk Historian
PIOleDb Data Provider is 3.3.0.1.
MDAC
MSXML 6.0
PISDK
Available Tools
There are several available tools to use after installation. These can be found in the following directory.
If the Data Provider was installed on a computer that has other Rockwell Software FactoryTalk
Applications then it will be located in the following directory.
In the Tools Folder there are several tools – PIOleDb Tester and the PIOleDb MMC. Both of these will be
shown in the following descriptions
The uses the PIOleDb Tester Application navigate to the following folder location.
When the tester opens you can get a list of sample Statements – select this button and the application is
modified to host sample SQL Statements.
Figure 3 PI OLEDB Tester with Sample SQL Queries
Here you can see that there are groups of statements that you can select and then test. Note that the
statements assume that you have some configuration loaded in the Historian so they may not all work
depending on what is in the Historian.
This tool shows the relationship of the catalogs inside FactoryTalk Historian. This is useful in that the
sub catalogs are Data Providers that support functionality not provided or added at a later time. For
example the picomp2 supports the writing of tags and is the preferred path to write.
If you double click on the table picomp2 there are some built in SQL Statements that you can see.
These SQL Statements are not that useful but they do show the syntax on how to access the data in the
tables. Below is a screen shot showing the SQL statement of the picomp2 table.
Figure 6 PIOLEDB MMC Showing picomp2 SQL Statement
Here you can see the SQL Statement and the results in the upper right corner.
Tag: ABC
Value: 123
Status: 0
"INSERT piarchive..picomp2(tag, time, value, status) VALUES('ABC', '2/24/2011 9:19:44 AM', 123, 0)"
First the tag ABC was created using SMT Pointbuilder- the following screen shots show the status of this
tag.
You can see the point created value and the time the tag was created.
Figure 8 Archive Editor showing ABC Tag Events
The above statement was put into the PIOLEDB Tester and run.
Since there is no returned value or record set the dialog box indicates that there was success.
Now to verify the value in the Archive – at the specified time – I intentionally chose 1 min + 1 sec from
creation.
Figure 10 Tag ABC Current Value and Timestamp after the PIOLEDB Write
Figure 10 shows the value of the tag after the SQL statement at the specified timestamp.
Figure 11 Tag ABC Archive Value and Timestamp after the PIOLEDB Write
Figure 11 shows the value at creation and the archive event of the write at the specified time.
A Batch is the execution of the production of a product or material – this is independent of the
equipment that the batch ran. It is the UnitBatch that is the instance of the batch that is run on a
specific piece of equipment. With this definition it is usually the UnitBatch that we are interested in.
And explains why in the SQL Statements there is always a value of Module – which is intended to be a
piece of equipment.
System Configuration
The Module Database is part of this as well – and in the test environment that this SQL Statement is run
the following is a view of the Module Database.
Figure 12 System Module Database Configuration
In the Module Database there are two Units – Machine 1 and Machine 2. The path to the Module of
Machine 1 is \Reactor Section\Machine 1. This is important as to get the list of unit batches run on
Machine 1 you need to tell the system the path to the Module that you are interested in. Once again
the Module Database is an equipment model here.
ORDER BY starttime
Note the path to the module of interest – this could have been Machine 2
Also note the Function MODULEUID(‘\Reactor Section\Machine 1’). This function gets the UID of the
module specified – the query runs off of the GUID given to the Module in the Module Database the
function allows for us to use the path to the module.
When this query is run in the PIOLEDB Tester here is the result.
Figure 13 Batch Query Record Set
Note the StartTime and the EndTime is provided as well as the product that was run. Each of these
UnitBatches have sub batches.
Another SQL Statement of interest may be to specify a particular batchid since midnight of any child
module of the Reactor Section –
After running this query in the PIOLEDB Tester here is the results – note the batch is in the list in figure
13.
This will return all the batches that have BatchID of M1Part7865 – in this system the batches are
incremented from 1 to 9999 so it is possible to have multiples of this batchid –
There is an overall time period of the search in this case it is ‘t’ which is the PITime of since midnight
today. This could use other times such as ‘*-1000d’ which is now (*) minus 1000 days – if this query was
run there would probably be multiple batches with the same id.
Visualization of Batch Information from FactoryTalk Historian
The question always comes up as to how to visualize the information from FactoryTalk Historian – there
are two answers – Of course one is preferred.
1. FactoryTalk VantagePoint
2. BatchView
It is possible to view BatchView reports or graphs in FactoryTalk VantagePoint – this is with the use of a
client side tool named ActiveView. ActiveView is a runtime render of ProcessBook displays that can be
imbedded in a web page.
Here is the text that is used to embed the ActiveView object in an html page.