formerpigeek

Getting a tag list from a PI server takes quite long time.

Discussion created by formerpigeek on Jan 22, 2010
Latest reply on Mar 16, 2010 by ken

We have a program that has trend displays to show the data from a PI server (similar to the Tend Display in PI ProcessBook. The problem we had is that the trend configuration form in our program takes about 60 - 75 seconds to load the tag list. And after selecting a tag, it takes about 30 seconds to show the data in the trend. The time of retrieving the tag list (total 40,000 tags in the server) is quite long comparing to ProcessBook (if I create a trend display using the same PI tag in PI ProcessBook). The program uses PI-SDK to open a connection to PI server and retrieves the tag list and point data. The following is the code in the program:

PISDK.PISDKClass piSDK;
PISDK.Server piServer;

piSDK = new PISDK.PISDKClass();
piServer = piSDK.Servers[“servername”];

//Connect using a trusted connection
piServer.Open(String.Empty);

Regex regExp = newRegex(“tag filter string from the configure form”);

PISDK.PointList piPoints;
string filter = "pointsource = 'O'";

piPoints = piServer.GetPoints(filter, null);

DataSet dataDS = newDataSet("BrowseTag");
DataTable dataDT = newDataTable("BrowseTag");
dataDT.Columns.Add("tagName");

// Build the return dataset
foreach (PISDK.PIPoint piPoint in piPoints)
{
    // Only return points match the regexp filter
    if (regExp.IsMatch(piPoint.Name) == true)
    {
        DataRow dataDR = dataDT.NewRow();

        dataDR["tagName"] = piPoint.Name;
        dataDT.Rows.Add(dataDR);
    
}
dataDS.Tables.Add(dataDT);

Then just return the dataDS to the function caller. The function caller will display the tag list in the trend config form.

 

I like to know what caused the delay of returning the tag list. What is the reasonable time to filter a group of tags from a PI server (we have about 40,000 tags with pointsource='O'). What can we do to improve the performance? This 60 seconds delay in returning a tag list is too long. 

 

Your help will be very much appreciated.

 

Tina

Outcomes