9 Replies Latest reply on Oct 21, 2010 7:12 PM by spilon

    command bar issue

    telventaustralia

      Hi,

       

      Working in some VBA macros for our customer I found a potential issue with PB  so I would be wondering someone could help me to fix.

       

      I got a display with a command bar. When that display is opened from a C drive or a UNC path " \\server\......\file.pdi it works fine but if the same display is opened from a mapped network drive like ( Z:, X:, etc..) and a command bar button is pressed, a new isntance of the display is opened.

       

      It seem to be that the bar can't manage the drive and open a copy of the display from the equivalent UNC location.

       

      Have you expereinece that before? Is it a bug in PB or Am I doing something wrong?.

       

      Thanks for your help,

       

      The easiest way to try this is by creating a display with a command bar in C: and create a map drive Z: pointing to C: 

       

      1. Open the display first from C: and press the command a bar button to open a userform for exmple.  Everythin should be ok

       

      2. Now open the display form Z: and press the command bar button. Check "windows" menu bar  

       

       

        • Re: command bar issue
          hanyong

          Hi Mauricio,

           

          I've tried something like what you have described; Create a display with a Command Bar button (clicking the button will just show a MsgBox) and open it from a mapped drive. And it seems to work for me. 

           

          Which version of ProcessBook are you using? is this happening for a specific display or a specific machine?

           

          In this case, I would suggest that you contact our Tech Support team as well. They can work with you to investigate into this.

            • Re: command bar issue
              telventaustralia

              Hi Han

               

              I tried in my machine and in couple of my customer's machines using PB 3.2.0.0. so now I'm thinking that is something I'm doing wrong.

               

              Could you please do something for me. Once you have pressed the command bar button check the windows menu option in the application bar and verify that only one instance of the display is open.

               

              Is there a way I ca send a test display to you?

               

              Thanks,

               

              MV

              • Re: command bar issue
                telventaustralia

                Thanks guys,

                 

                This is the file I'm using for testing. I create this to discard that the issue was related to my code.

                 

                I'm also attaching an image when I open the file from z: drive. Once I press the button, PB opens a second file in \\televentmavgal\c\mvtest.pdi as showed in one of the PB bars (top rigth) and in the "window" menu option.

                 

                Z: = \\televentmavgal\c\mvtest.pdi

                 

                I hope you can help me

                 

                thanks,

                  • Re: command bar issue
                    andreas

                    o.k. - I can reproduce the behavior...

                      • Re: command bar issue
                        bkarthikeyan

                        We recently came across this same issue (Adding controls in display menubar by VBA). And I was able to successfully reproduce that issue on my Win XP SP3 machine running ProcessBook 3.2.0.0. The issue was escalated to the ProcessBook developers and we got the following comments from the PB Dev:

                         

                        ##########################

                         

                        Code to control Toolbars should be implemented at the application level which is done via Add-ins (on the OSI TechSupport site locate either "Visual Studio Sample Templates for Creating ProcessBook Add-ins in C#" or "Visual Studio Sample Templates for Creating ProcessBook Add-ins in VB" to see examples). The use of VBA in the display will have various problems trying to react to application level events.

                         

                        In essence the add-in code (which will be in a DLL) will be very similar to the VBA code used in the display. This will also allow the button function to exist independent of any particular display. For best results add the Buttons in the connect event and remove them in the disconnect.

                         

                        ###########################

                          • Re: command bar issue
                            telventaustralia

                            Hi guys

                             

                            Thanks for your help

                             

                            I'm going to explore in deep that posibility. An add-in was my initial aproach but I had a similar issue when multiples displays were open and I tried to run a macro in PB  from the command bar in the add-in ( I lost the current instance of the display) so I decided to go back to the VBA.

                             

                            May be the best approach is to include all the macros in the Add-in but that's the next step.

                             

                            Thanks,

                             

                             

                             

                             

                             

                             

                             

                              

                            • Re: command bar issue

                              Balu Karthikeyan

                              Code to control Toolbars should be implemented at the application level which is done via Add-ins (on the OSI TechSupport site locate either "Visual Studio Sample Templates for Creating ProcessBook Add-ins in C#" or "Visual Studio Sample Templates for Creating ProcessBook Add-ins in VB" to see examples). The use of VBA in the display will have various problems trying to react to application level events.
                              Regarding the implementation .NET ProcessBook add-ins, I would recommend you look into the PI ProcessBook 3.x Add-In Templates on the "Extras" section of the vCampus Download Center. These are more up to date than the ones you will find on the Technical Support website (of course, since the OSIsoft vCampus program is the place for PI Programming topics ).

                               

                              I also recommend you check out the "Programming .NET Add-Ins for PI ProcessBook" webinar under the vCampus Auditorium.

                               

                              And of course, do not hesitate to initiate new threads in this discussion forum, to address questions that come up as you implement your add-in(s)!