15 Replies Latest reply on Jun 9, 2012 9:55 AM by MarkusSchulz

    Where are the ERD Search items history stored?

    GreenTech

      Hi Experts,

       

      We are in the process of deploying a purpose built application using processbook & the ERD. The install package by default connected to the UAT Pi System which (although easy for users to change) we updated on the test system to the Prod Pi system. The question is: where is this information stored? I can confirm that now when we open the pdi of interest, it does connect to the correct system, and has all of the expected elements in its search collection, but the .pdi file itself has not been updated (the date hasn't changed). Neither can I find an updated ini or config file and I can't find the name of the search system or elements in the registry.

       

      Any other clues?

       

      Thanks all.

        • Re: Where are the ERD Search items history stored?
          hanyong

          Hi Rob,

           

          I wouldn't call myself an expert on this topic, but I am going to take a shot at this query based on what I know. I think the information related to the ERD plugin are stored within the pdi file itself, including the selected element of interest in the ERD pane, and the parameters used in the last element search dialog. I'll check in with the developers and see if they can give more insight into this.

           

          From what you described, it seems when you point the pdi from the UAT environment to the production environment, things still work as expected, and you just want to to find out how it happens? like how ProcessBook reference to the PI tags when pointing towards different PI Servers?

            • Re: Where are the ERD Search items history stored?
              dhollebeek

              Rob,

               

              All ERD info for a PDI is stored in it's NamedValues collection.  To view this info, run the following VBA:

               
              Sub DumpNamedValues()
                  Dim nv As PBNamedValue
                  
                  For Each nv In ThisDisplay.NamedValues
                      Debug.Print nv.Name & "=" & nv.Value
                  Next
              
              End Sub
              

               This will print the entire NamedValues collection to the immediate window in VBA.  For one of my test displays, the results look like this:

               

              ERD.DockWindowVisible=True
              ERD.Context1=\\PHLAFS02\Wind Farm Small\TxLake\WPU_TxLKE_001
              ERD.Context1.PersistString=178 {9895150E-085D-4fcb-A16D-5EF5D2527196} 2\{f105c9ff-384b-412a-a630-d16540b3e800}\Elements[{537b0625-f19b-442f-9f98-b569e7094946}]*PHLAFS02\Wind Farm Small\TxLake\WPU_TxLKE_001
              ERD.Context2=\\PHLAFS02\Wind Farm Small\TxLake\WPU_TxLKE_002
              ERD.Context2.PersistString=178 {9895150E-085D-4fcb-A16D-5EF5D2527196} 2\{f105c9ff-384b-412a-a630-d16540b3e800}\Elements[{6caa2f31-05d1-4126-a472-f617e8c5ab39}]*PHLAFS02\Wind Farm Small\TxLake\WPU_TxLKE_002
              ERD.Context3=\\PHLAFS02\Wind Farm Small\TxLake\WPU_TxLKE_003
              ERD.Context3.PersistString=178 {9895150E-085D-4fcb-A16D-5EF5D2527196} 2\{f105c9ff-384b-412a-a630-d16540b3e800}\Elements[{cdaf9fa3-4d80-42a6-a071-ca507ea2b73c}]*PHLAFS02\Wind Farm Small\TxLake\WPU_TxLKE_003
              ERD.Context4=\\PHLAFS02\Wind Farm Small\TxLake\WPU_TxLKE_004
              ERD.Context4.PersistString=178 {9895150E-085D-4fcb-A16D-5EF5D2527196} 2\{f105c9ff-384b-412a-a630-d16540b3e800}\Elements[{472a3bcb-88d0-4d74-a6fd-dd45f1f76f9a}]*PHLAFS02\Wind Farm Small\TxLake\WPU_TxLKE_004
              ERD.Context=\\PHLAFS02\Wind Farm Small\TxLake\WPU_TxLKE_001
              ERD.Context.PersistString=178 {9895150E-085D-4fcb-A16D-5EF5D2527196} 2\{f105c9ff-384b-412a-a630-d16540b3e800}\Elements[{537b0625-f19b-442f-9f98-b569e7094946}]*PHLAFS02\Wind Farm Small\TxLake\WPU_TxLKE_001
              ERD.LastSearch.PISystem=\\PHLAFS02
              ERD.LastSearch.Database=\\PHLAFS02\Wind Farm Small
              ERD.LastSearch.RootElementString=
              ERD.LastSearch.IncludeSubElements=True
              ERD.LastSearch.ElementName=
              ERD.LastSearch.Category=
              ERD.LastSearch.ElementTemplate=
              ERD.LastSearch.AFElementType=-1
              ERD.LastSearch.MaximumQueryCount=1000

               

              If you want to change what server you are using, just update ERD.Context and ERD.Context1, etc.  You can safely remove the ERD.xxx.PersistString settings, as they are just used for performance and will be regenerated.

               

              Any more questions, feel free to ask!

               

              -Dave

                • Re: Where are the ERD Search items history stored?
                  GreenTech

                  Thanks Han, David.

                   

                  We do use the named values collection, I was really asking about how processbook remembers these settings. Contrary to what I said in the post it does look like they are saved in the .pdi

                   

                  Thanks for your replies,

                   

                  Rob

                    • Re: Where are the ERD Search items history stored?
                      dhollebeek

                      The named values collection is stored in the PDI. it may not be in human readable format though.

                        • Re: Where are the ERD Search items history stored?
                          aommeren

                          Hello,

                           

                          I have a similar question about the ERD options and how to use the navigation based on elements of interest.

                           

                          To start with a simple question:
                          I have defined a simple structure like this:

                           

                          Plant
                             SectionA
                                Element1
                                Element2
                             SectionB
                                Element3
                                Element4
                                Element5

                           

                          I have Plant (with sub elements) as my element of interest.

                           

                          The first thing I want to solve is the fact that I lose my navigation when I switch PDI views.
                          When I have opened my Element PDI which is an ERD, I can use the navigation to select an element and my ERD shows some relevant attributes. This is the basic concept which works fine.
                          But, when I select another pdi which is already open (for example by going to the Window menu and selecting another file) and afterward come back to my Element ERD, the selected element is still active but the navigation pane has collapsed the Tree again to show the root level: "Plant"

                           

                          When I want to navigate to another element I have to click the nodes again to find the Element or another one.

                           

                          Can I stop this tree collapsing when I change views?

                           

                          Alternatively I want to open the tree from VBA code and set it to the right path/location in the element hierarchy

                           

                          The second thing I want to accomplish is opening pdi's based on the choice in the tree.
                          I want to have 2 different pdi's for SectionA and SectionB.
                          When I am on the SectionA pdi and the user selects SectionB I want to change (open) the SectionB pdi. I believe I can do this because I can read the ElementPath from a PIValue (maybe there are better ways) - but anyway : one I have opened the SectionB pdi the navigation is gone, the tree has collapsed. So once I have opened the SectionB pdi I want to set the navigation to the original view.
                          This is all focused on user experience, this is an application I am developing.

                           

                          I already found some references to the NamedValues collections, but I did not manage to reproduce. I decided to describe my use case and I hope there are some experienced virtual helpers around to guide me in the right direction!!

                           

                          Thanks,

                           

                          Ad

                           

                           

                           

                           

                           

                           

                           

                           

                            • Re: Where are the ERD Search items history stored?
                              Asle Frantzen

                              Hi Ad

                               

                              I would also be interested in using VBA to set the correct path/location in the ERD menu, so please update this thread when you discover how to do this

                               

                              For your second part, I can tell you that we have done this for a ProcessBook project including 15-20 displays just recently. We had help from Dan Lopez from techsupport, so instead of trying to explain this here I will rather just tip you to contact techsupport, ask your question and refer to this call number: TechSupport Call # 392078

                               

                              .a

                                • Re: Where are the ERD Search items history stored?
                                  Asle Frantzen

                                  Andreas

                                  have you found this thread vcampus.osisoft.com/.../9024.aspx ?

                                   

                                   

                                  I hadn't seen this before, but I haven't explicitly searched for it either. It seems what you're doing in the example code is to clear the Elements of interest, and then add three new ones?

                                   

                                  My goal would be to just expand the ERD hierarchy down to the element which was selected before focus was lost, or whatever happens. Even if I don't use the NamedCollection variable I can get the path of the element I want selected.

                                    • Re: Where are the ERD Search items history stored?
                                      andreas

                                      Asle Frantzen @ Amitec

                                      It seems what you're doing in the example code is to clear the Elements of interest, and then add three new ones?

                                       

                                      right, from this you should be able to set the context (similar to the example using MDB that is linked in that thread as well) - so it is only covering a small part of the request.

                                       

                                      if you store your current context, you can navigate to that (and therefor open the tree) by display_activate:

                                       
                                      Private Sub Display_Activate()
                                          
                                          Dim ErdContextHandler As ContextHandler
                                          Set ErdContextHandler = Application.ContextHandlers("E")
                                          ErdContextHandler.CurrentContext(ThisDisplay) = SelectedContext
                                          
                                      End Sub
                                      

                                       

                                      • Re: Where are the ERD Search items history stored?
                                        andreas

                                        Asle Frantzen @ Amitec

                                        My goal would be to just expand the ERD hierarchy down to the element which was selected before focus was lost, or whatever happens. Even if I don't use the NamedCollection variable I can get the path of the element I want selected.

                                         

                                         

                                         

                                         

                                        and here is the complete code to what i was thinking:

                                         
                                        Option Explicit
                                        Private SelectedContext As String
                                        Private WithEvents ErdContextHandler As ContextHandler
                                        
                                        Private Sub Display_Activate()
                                            If Not (ErdContextHandler Is Nothing) Then
                                                ErdContextHandler.CurrentContext(ThisDisplay) = SelectedContext
                                            End If
                                        End Sub
                                        
                                        Private Sub ErdContextHandler_ContextChanged(FromDisplay As Display, FromContextHandler As ContextHandler)
                                            SelectedContext = ErdContextHandler.CurrentContext(ThisDisplay)
                                        End Sub
                                        
                                        Private Sub Display_Open()
                                            Set ErdContextHandler = Application.ContextHandlers("E")
                                            SelectedContext = ErdContextHandler.CurrentContext(ThisDisplay)
                                        End Sub