11 Replies Latest reply on Feb 3, 2014 4:25 PM by mhamel

    Dynamically Setting Processbook Default Server

    jnissisolutions

      I asked this question to support, but wasn't convinced by the answer. 

       

      I have a situation where I would like to have 3 servers in place... let's call them DEV, TEST and PRODUCTION.  In these servers I want to carry the same tags with the same tagnames.  I would like to develop a batch file that opens PROCESSBOOK based on the server that I would like to work with.  I do not want to get the servers mixed up for obvious reasons.  Also, I would like the PDIs that I develop to be GENERIC so that they could use the same TAG names within Datasets regardless of which server I am pointing at. 

       

      Is there a way within a batch file to set the default server prior to opening up PROCESSBOOK?

       

      I understand the benefit that ProcessBook has in pulling from mutliple servers into one .PDI view.  In this circumstance, I would like to be able to do the opposite of that.  Point at different servers using the same tag set.

       

      Thanks,

       

      Dan

        • Re: Dynamically Setting Processbook Default Server

          Hi Dan,

           

          What was the TechSupport answer? (They are very knowledgable).

           

          Some options that spring to mind (although I haven't thought them through completely).

           

          Create an executable that creates an instance of the ProcessBook application (via a command file), hook the executable in to the "Application BeforeNodeMap" event, have it look at the node being mapped and change it accordingly.  Then when you open the display it will change the node between your DEV, TEST, PROD servers.

           

          OR

           

          Create a PISDK Alias, let's say "PBOOK" that points to your "DEV" PI Server.  Build your display using PBOOK, save it, close it.  Change the server alias "PBOOK" to point to "TEST".  Open your display and it should prompt to change the node etc.

           

          You can't, to my knowledge, open a display so that you can change the nodes used within it without actually loading the display.

           

           

          • Re: Dynamically Setting Processbook Default Server
            cescamilla

            Dan Jablonski

            I asked this question to support, but wasn't convinced by the answer. 

             

            It could be really helpful to have the support call number you are referring to.

             

            Dan Jablonski

            I do not want to get the servers mixed up for obvious reasons.  Also, I would like the PDIs that I develop to be GENERIC so that they could use the same TAG names within Datasets regardless of which server I am pointing at. 

             

            This seems like a contradiction, on one sude you would like to get three different servers and be able to NOT mix them up, but, on the other side, you would like to be able to use the same things on any of those servers. In my oppinion the later will allow you to confuse them easily.

             

            Dan Jablonski

            Is there a way within a batch file to set the default server prior to opening up PROCESSBOOK?

             

            There are some methods you could use, but since PDIs will save the current PI Server being used it will try to connect not to the default PI Server but to the PI Server that was used when you added an specific point. PI SDK will also complain if the ID of the PI Server has changed... this things are in place to prevent the user from swtiching PI Servers inadvertedly (so the user won't mix them up), and it looks like you specifically want to override those mechanisms.

             

            You may very well be better served having 3 different displays and openning the one that connects to the server you want to have oppened.

             

            I don't know of an easy and simple way for you to acchieve this, I'm also having a hard time figuring out why you need to do this.but if you really want to try this out I would suggest (and I will not recommend doing this) removing all the PI Servers from the Known servers list and adding just the one PI Server you want the final user to use. Keep in mind that there is no current programmatic way to do this automatically, You will geet prompted by Processbook as soon as it opens on what server to use and the only server available  would be the right choice.

             

             

             

            Could you explain why you want to do this two things at the same time?

             

            1.- using the same tag names for separate servers

             

            2.- Switching servers seemlessly

              • Re: Dynamically Setting Processbook Default Server
                Asle Frantzen

                Not reading through everything written in this thread so far, I'd suggest checking out what Han Yong wrote here:

                 

                http://vcampus.osisoft.com/forums/p/860/4043.aspx#4043

                 

                 

                 

                The tip is basically for ProcBook to get tags by their tagnames - instead of the normal ProcBook way - getting them by their tag id's. This could perhaps help!

                • Re: Dynamically Setting Processbook Default Server
                  jnissisolutions

                  Cristobal,

                   

                  In some shops there are separate (completely independent) development, test and production environments.  Each environment would have a complete archive copy of production environment.  Rather than build 3 separate sets of .PDIs, simply build one.  When changes are made, they can be developed using the job that applies the .PDI to the development server.  When changes are tested, the same .PDI can be used against the test server.  Once the test crew is satisfied with correctness, the same .PDI is moved into production.

                   

                  In some of the other responses I noticed that there are tools to reset all the tags associated with the servers.  In this case, since the servers have an identical set of tag names, and we are dealing only with historical data, the .PDIs wouldn't need to be changed. 

                   

                  Thanks for your interest.

                   

                  Dan

                    • Re: Dynamically Setting Processbook Default Server
                      cescamilla

                      Dan Jablonski

                      Each environment would have a complete archive copy of production environment.

                       

                      This looks like a backup, if it is a backup, the only thing you would need is for the development computer to only see the development server, everything else would be identical so it won't matter.

                       

                      But, why would you need a "developmet" PI Server just to create .PDI's? it would make sense if you were creating a heavy customized PDI that does a lot more than just displaying your data.

                        • Re: Dynamically Setting Processbook Default Server
                          jnissisolutions

                          Right.  There are other databases involved entering information into the .PDI.  I have some leads to go on though based on all the responses.  Thanks.

                            • Re: Dynamically Setting Processbook Default Server
                              antoine.desnos

                              Hello everyone,

                               

                              I want update this discussion.

                               

                              I'm encountering the same issue explained above on this discussion.

                               

                              What I want to do is create a ProcessBook that working indepently of which server it is collecting the data.

                               

                              For example, I create a display with a PI value object.

                               

                              When you create this type of object you have to specify a correct PI server with a tag. You can also use a PI Calculation, odbc connexion, an AF element or an MDB. But all this way of getting value, you have to specified which PI server you want to connect. During the creation of the value object the server connection have to be working.

                               

                              On that account, the value save the specified server ID.

                               

                              If you try to open the processbook display on another computer, that don't have the connection to the server previously specified, you have to determined an other one.

                               

                              And you have to do this procedure for every display you had configure before. So it could be really lack of time to do this server modification every time you modified a display and for every display.

                               

                              What I'm looking for it's a faster way to modified the server of every object on every display of a piw.

                               

                              As Rhys suggested on 21 Apr 2010, I try to catch the event named BeforeNodeMap, but I didn't succeed to catch it.

                               

                              I also tried to workaround by using a Server Alias and a Path Alias but was not able to use this alias on the ProcessBook object.

                               

                              Thank for your help.

                               

                              Antoine.