How to show PI tag search dialog and return tag as string?

How can I show the search dialog for a PI tag, and secondly, how can I get the selected tag name from it?

+3
source share
3 answers

I hope this comes in handy:

private void Button1_Click(object sender, EventArgs e) {
    TagSearch dialog = new TagSearch();

    PointList results = dialog.showTagSearch(
        new string[] { }, SearchOptions.SingleSelect);

    if (results.Count > 0) {
        object index = 1;
        string serverTag = 
            string.Format(
                CultureInfo.InvariantCulture, 
                @"\\{0}\{1}", 
                results.get_Item(ref index).Server.Name, 
                results.get_Item(ref index).Name);
    }
}
+3
source

Download the PI ProcessBook user guide from the OSIsoft technical support website and see “Search for PI tags” (page 57):

http://techsupport.osisoft.com/Techsupport/NonTemplates/Download%20Center/DownloadCenter.aspx?download_file=26B66920-EF5F-4ECE-866B-44CD446EED49

0
source

FYI , .

, , ( ) , . SDK. () :

public PIPoint SearchForPoint()
    {
        TagSearch searchDialog = new TagSearch();
        PointList result = searchDialog.Show(null, TagSearchOptions.tsoptSingleSelect);
        if (result.Count > 0)
        {
            return result[1];
        }
        return null;
    }

This also requires a link to the PISDKdlg library (my version is 16.8.0.0).

0
source

All Articles