I'm looking for a way to move a table from AF to a process book display. I would like to display them in some kind of list or grid. What is the most efficient way to do so?
I think the good way should copy your contains of that table into a excel file, and then, you know PI ProcessBook could insert an excel sheet in the .pdi file.
The data in the AF table is a linked table to an outside source that updates automatically. We need to be able to have this as a live interface in ProcessBook so that when the screen is opened, the most recent data is displayed.
If there's a way to get the array of data over, we can parse that in to a grid, just getting the data there is the part we're trying to figure out
There should have no direct way to achieve you goal. I think you could try to make a PI ProcessBook add-in to display your table in PI ProcessBook. You could go to "Download Center" to download the example of PI ProcessBook add-in as the reference to do your own one.
I am wondering if what you are asking for might not already be standard functionality. I have created an Element Relative display. The Trend shows Attributes belonging to the Element selected. By selecting menu "View" -> "Details" you switch the "Details" pane on and off. The details pane allows to select from the list of Data Items and shows data in a grid.
Is this possibly what you are looking for?
Not quite, i'm looking for a table that automatically mirrors the same table I have in AF. The format of the table doesn't have to be the same, even a list of some sort would be fine. So for example in my AF table I have 6 columns, On my process book page I would like a grid or list that displays the top 10 results(most recent) events inside the table. So when a new event gets put into the table it shows a new event on the process book page, with corresponding information from the table.
A nasty limitation of AF is that you do not have direct access to data (rows / columns) stored in the AF tables. Not from AFSDK, and not from OLEDBEnterprise.
The only way using AF (that i know of) is to expose the data in the attributes of an AFelement, using the Table Lookup DataReference.
Be creative in using the table DR to make this work for you, e.g. using a dummy AFelement for the table. And then it's still cumbersome!
Also note that the client connects to the remote table, and NOT the AFserver! So be aware of the architectural impact of this. Every client must have access to the remote database & table.
Since you are linking the table to AF, I'm sure you have a way to connect to your source table via OLEDB; you could use that to populate a grid (msflex gird) activex control in PB
AFTable.Table returns an ADO.NET DataTable object.
For a linked AFTable, it is the AFServer that connects to the external datasource to query the external table.
So my options are limited...
1.Build a attributes for the table (6 rows x 10 columns) so 60 attributes per template.... x 20 templates... seems cumbersome / heavy but it would work,
2. MSflex grid - pro code would query the tables, however each machine this is installed on needs to have the proper activex controls in order to work.... I can't develop msgrids on my windows 7 machine, (even after kb00400) but i can however on my server.... also a little heavy and not efficient in a large corporation
3. Is there no alarms? or banner applications built within PB? most HMI's i've developed have some kind of banner system...?
If using activex control in a desktop app is heavy, then consider using a hyperlink from PB (in a context sensitive way) to bring up a SSRS web page.
You can use SSRS or develop a custom web application running on IIS in order to show the table.
Remember that PI AF SDK cannot be used on PI ProcessBook as this library is pure .NET library and not a COM object. Nevertheless, there is a library called PI AFWrapper developed as a way to solve this problem and it can be downloaded in vCampus. You might have to add a new method to have access to the AF Tables.
I've tried opening this, but the VB code is complaining about locating the AFWrapper.tlb. I can't find this anywhere on the server or in the downloads section of vCampus. Where do I get that reference file?
AFWrapper is available in the Extras section of the vCampus Download Center. Please let us know if it is not appearing there for you and we can take a closer look.
That's where I got the zip file for the AFWrapper. the issue is when opening the processbook file, the VBA script has no reference to the .tlb file and I can't find it anywhere either
If I remember correctly, you need to compile AFWrapper on Visual Studio in order to generate the .tlb file.
Marcos is correct, the AFWrapper download is a sample project that shows how you can create a COM-visible wrapper for AFSDK code. The code includes examples of common AFSDK calls, but you will need to modify it for your specific use case then compile and register the library before you can successfully use in with ProcessBook VBA.
Retrieving data ...