|
|
Rank: Newbie Groups: Member
Joined: 10/20/2009 Posts: 1 Location: Budapest
|
Hello,
I am looking for a way to call the "Tag Search" window using VBA.
I want people using my program to have a way to put a certain tag of their choice in the list of tags that need calculating.
So I have the following options: 1) they need to search it first using PI or the Excel Tag Search and copy the number then use the form I use in my program to indicate what calculations have to be done and where they have to be mailed to/ stored.
2) the more userfriendly way which I would prefer to use: They can use the "browse" button on the form they called up and that one fills in the correct tagname for them after they selected it from the Tag Search window.
I tried recording the call with a "record macro" but unfortunately the "tag search" leaves the recording blank, which is why I ask here what the correct syntax is.
Thank you, Matthias
|
|
|
|
|
OSIsoft vCampus is a subscription-based, online offering that consists of providing everything people need to develop applications on the PI System. We invite you to take a "tour" of the OSIsoft Virtual Campus - also feel free to consult the FAQ or contact OSIsoft vCampus for more details.
|
|
|
Rank: Administration
 Groups: Administration
Joined: 6/20/2008 Posts: 617 Location: Cheshire, United Kingdom.
|
Hi Matthias, Welcome to the forum. You need to add 2 references to your VBA project: - PISDK Type Library - PISDK Dialogs Then you can call the Tag Search and retrieve a PISDK.PointList object. For example: Code: Private PList as PISDK.PointList
Private Sub CallTagSearch()
Set PList = PISDKDlg.TagSearch.Show()
Debug.Print "Number of tags selected = " & PList.Count
End Sub
The PointList object is a collection of PIPoint objects. Enjoy! Rhys. Principal Consultant Real-Time Data Management @ Wipro Technologies
|
|
|
Rank: Newbie Groups: Member
Joined: 10/6/2010 Posts: 1 Location: Norway
|
Hi,
I`m doing almost the same, but i want to have dthe selected tag put in to my cell in my worksheet.
Normaly i can select a cell, then open tag search and dobble click on the tag i want, and it is returned to the cell.
But when i use Set PList = PISDKDlg.TagSearch.Show(), it just dissepears when i dobble clik on a tag.
Is there a quick fix to this ?
Torgeir
|
|
|
Rank: Administration
 Groups: Administration
Joined: 6/20/2008 Posts: 617 Location: Cheshire, United Kingdom.
|
Hi Torgeir, That is because when you double click on a tag the focus returns to your code, where you need to process the selected tag. Code: Set PList = PISDKDlg.TagSearch.Show() If PList.Count > 0 Then Me.Application.Selection.Value = PList(1).Name End If
Principal Consultant Real-Time Data Management @ Wipro Technologies
|
|
|
|
Guest
|