15 Replies Latest reply on Mar 23, 2016 9:11 AM by gregor

    ProcessBook Add-in

    dupuism

      Hello all,

       

      I am about to start writing an add-in for ProcessBook using VB. The add-in is supposd to make it possible to edit PI Tag values directly from processbook. Before I started since I am new to ProcessBook and the PI system I wanted to make sure there was not already a way to do this incorporated into ProcessBook. Also if anyone as a good place to start or something I should reference to learn how to code in ProcessBook that would alos be of great help.

       

       

       

      Thanks in advance

        • Re: ProcessBook Add-in

          The Details pane is the only built-in way you can write data back to PI, and it's only for Annotations (i.e. not the actual values themselves). This is as of the current version of PI ProcessBook (v3.2.0.0) and I don't know whether OSI has plans to change that behaviour in the future (I couldn't find anything in the ProcessBook Known Issues or on the Engineering Plan...).

           

          That said, the Details Pane add-in simply makes use of the PI SDK "Archive Editor" control - it does use it in read-only mode but this PI SDK control does support read/write. Your best bet at this point would be to wrap this control up in a .NET ProcessBook add-In (use one of the templates in the "Supporting Files" section of the Download Center) and implement it such that it supports data edits.

           

          Hope this helps...

            • Re: ProcessBook Add-in

              It has been suggested to OSI in this thread that manual inputs are very much in demand from ProcessBook users, your post also emphasises this.  I would expect to see this in a future version (next generation?) of ProcessBook but don't expect it anytime soon (unless OSI are working on this already).

               

              I have written a few manual entry mechanisms for ProcessBook (just been awarded another project to develop a slick manual entry system for ProcessBook), each had a specific purpose and was not "general" enough for an all purpose manual entry mechanism for ProcessBook - plus, clients own the source code.  There is a lot to consider, especially if processes dictate that entered data should be limit checked, restricted to certain values (or types), auditable (more than just searching the PI Message Logs), Collective aware etc 
              For a lot of scenarios something like PI-ManualLogger is suitable, especially if you start looking at data that is collected at regular intervals.  I am guessing that your scenario is because you only want 1 tool to monitor & manipulate real time data as opposed to 2?  This is often the case.

               

              I suspect there are a lot more ProcessBook addins out there that allow manual entries, but most will be built by customers and not available to be shared.

               

              You also have the option of using password protected VBA in displays, which reference PISDK.  Not the prefered approach but an option.

               

               

               

               

               

               

                • Re: ProcessBook Add-in
                  dupuism

                  Thank you for the great insight into what writing this application will take. This is going to be a challeenge for someone like me who is relatively new to the PI system. I had started writing the code in VBA to login into the add-in. I want this add-in to be limit to a specific group of people. However I am already running into some difficulties using the PIGroups.Add. The syntax I have is srv.PIGroups.Add("PIAdmins", "Unlimited Access"). This is how I am trying to create the group. Following the programmers reference this appears to be correct however I am getting an error that states I have a Null Reference Exception.

                   

                  I am thinking I need to define something as a new group. maybe dim grp As New PIGroup?

                   

                   

                   

                   

                    • Re: ProcessBook Add-in
                      andreas

                      Mike,

                       

                      you should not get a null reference exception - however, your code should not work on a new system as there is already a piadmins group (name change ).

                       

                      So here is a code I just tested:

                      Dim _PISDK As PISDK.PISDK
                      _PISDK = New PISDK.PISDK()

                      Dim _PIServer As PISDK.Server
                      _PIServer = _PISDK.Servers("ANDREASPC")

                      _PIServer.Open("")
                      _PIServer.PIGroups.Add("mypiadmins", "my pi admins")
                      _PIServer.Close()

                       

                       

                      • Re: ProcessBook Add-in

                        Just before you go down that path, I would like to understand the motivation behind creating a group programmatically. Is it something that will be done regularly in your add-in? Isn't it a one-time action you can accomplish via the PI System Management Tools (SMT)?

                         

                        I mean, once the security is properly configured on the server (PI Users, PI Groups, PI Identities, PI Point security, Database Security, etc.), you shouldn't have to do anything on the cliend end. The Archive Editor control will behave based on the level of access of the current user, and will not effectively edit values if you don't have "write" access to it.

                         

                        Does that make sense? Maybe I misunderstood something too...

                          • Re: ProcessBook Add-in
                            dupuism

                            Steve,

                             

                            Thanks for the help. Thinking about it more I believe you are correct. There does not seem to be a reason to do this programmatically. It is just desired that this tool is available to a very limited number of people so I was thinking about doing it in the program. However, your suggestion is much easier and makes a lot more sense.

                             

                            Thanks again

                              • Re: ProcessBook Add-in
                                dupuism

                                If the group and users are created using PI SMT, how can I access that information to use in my code? Where are the user names and passwords stored when they are created with PI SMT? Also is there an easy way to send the userID and Password from one form to another?

                                 

                                Thanks in advance

                                  • Re: ProcessBook Add-in
                                    andreas

                                    The PI Users and Groups are stored in the PI Server - PI SMT is just a client to maintain that. Said that the security would be compromised if you could retrieve the password from the server and send it to another form.

                                     

                                    However, what Steve has had in mind is that you take advantage of the new windows integrated security (WIS) release of PI. What that means is for your case that you create a PI Identity and map a Microsoft AD Group to this identity with PI SMT. You configure the tags you want to write to so that this PI Identity has write access to the tags (again with PI SMT) and then the only thing you have to do is adding your windows users to this windows group and connect to the PI Server. With this mechanism you control read/write access to tags similar how you control read/write access to files on your network drives.

                                     

                                    You should get the idea in the PI System Manager I: Essential Skills training, Chapter 7 - Security. However, the online version has not been updated to reflect WIS, but it should provide you with the basics of PI Tag security, showing you that the database can control the access to the tags so you do not need to control the front end for this. This moves the security to standard tools that simplify the maintenance.

                        • Re: ProcessBook Add-in
                          bryancouch

                          I would just like to echo the need for the ability to write from Processbook to the PI archives!!!

                            • Re: ProcessBook Add-in
                              Eugene Lee

                              Hi Bryan,

                               

                              You can use VBA with PI SDK in Processbook to do so. Let me know if you need an example.

                                • Re: ProcessBook Add-in
                                  Joe Carter

                                  If you have any examples, that would be great!  I am new to VBA and PI SDK and don't really know where to start.  I am needing to have a place for the user to input data once a day, or week, or month; however often it is needed.  Would like the data to write to a tag so it can be archived.

                                    • Re: ProcessBook Add-in
                                      Eugene Lee

                                      Hi Joe,

                                       

                                      Here is some sample code to write the value 100 at 5pm local time to the point cdt158 to get you started.

                                       

                                      Dim srv As Server
                                      Dim pt As PIPoint
                                      Set srv = Servers.DefaultServer
                                      Set pt = srv.PIPoints("cdt158")
                                      pt.Data.UpdateValue 100, "17:00"
                                      
                                      • Re: ProcessBook Add-in
                                        gregor

                                        Hello Joe,

                                         

                                        Please keep in mind that PI ProcessBook is a visualization client and we recommend against using it as a manual data entry client. Please allow me to warn you about possible issues that you may run into like

                                         

                                        • Failing write attempts because points being locked by a buffer subsystem instance
                                        • Manual data entries not becoming replicated to secondary members of PI Collectives
                                        • "Disappearing" writes because of compression
                                          • Re: ProcessBook Add-in
                                            Joe Carter

                                            I am needing to have a user input a number to a "tag". The "tag" will not be reading from anywhere, only update to tag will be whatever the user types in. We need the "tag" to be archived because the number will be part of a formula used in AF.  How could we do this? It doesn't have to be in Processbook, but it will be an operator inputing the data every other day, so a simple process would be great.

                                              • Re: ProcessBook Add-in
                                                gregor

                                                Hello Joe,

                                                 

                                                The product designed for this purpose is PI Manual Logger but PI System Management Tools (SMT) -> Archive Editor plug-in can serve as well. I didn't intend to say the use of ProcessBook for this purpose is illegal but you should understand the implications.

                                                I still don't know if your PI System has a PI Data Archive Collective. If this would be the case how would you ensure Secondary Collective members receive the updates? I am not saying it's impossible but please use caution.