4 Replies Latest reply on Aug 24, 2016 12:05 PM by soltalon Branched to a new discussion.

    AF SDK Update many tags attributes

    soltalon

      I am working on a program to update and create tags based on another system.  Within the AF SDK there is a wonderful function of OSISoft.AF.PI.PIServer called CreatePIPoints.  This function allows me to create a great many tags in a single call and works perfectly.  I need to do something similar with updating tags, so that I can adjust security settings, digitalsets, descriptors, etc as they change in our other system.

      I have found the PI.PIPoint SetAttribute and SaveAttribute, but this process only works on individual points and takes a long time to process large numbers of tags.  I also found the PI.PIPointList SaveAttributes, but this assumes that all points in the list are going to share the same attribute values.  My program needs to be able to customize each points attributes and update them to the server in large numbers.

      The PI SDK had a function for this called EditTags, is there something like this in the AF SDK that I am missing?

       

      Thanks,

      -Eric

        • Re: AF SDK Update many tags attributes
          Rick Davin

          Hi Eric,

           

          There is currently no equivalent of the IPIPoints2.EditTags method in AFSDK.

           

          Alternatives to consider:

          1. If possible, break your tags into groups where all tags in a group have the same changes to attributes.  Then issue PI.PIPointList.SaveAttributes call per group.
          2. Use parallel calls on PI.PIPoint.SetAttribute and SaveAttribute.

           

          Also, when you bulk create tags with AFSDK there are 2 method signatures.  One requires all attributes be the same.  The other allows different attributes per tag.  I don't know if its possible that you create the tags with attributes you want up front rather than changing them later.

           

          Hope this helps,

          Rick Davin

            • Re: AF SDK Update many tags attributes
              soltalon

              Thanks Rick. 

              I am using the bulk create to do exactly that, but when changes are made in bulk on our other system I need to have those same changes made in PI. This has the potential to be in the hundreds of thousands of tags.

              If there was an edit/update option like the bulk create using dictionaries to update them all individually, that would be perfect for my needs.  Is anything like this planned down the road?

                • Re: AF SDK Update many tags attributes
                  Rick Davin

                  Hi Eric,

                   

                  I don't know if any new method signatures are planned.  While it would no doubt help you out, my knee jerk reaction would be that this seems to be a seldom used feature.  How frequently do you foresee the need to make this call?  How frequently do you change any large number of tags?  How frequently do you change the same tag?

                   

                  With hundreds of thousands of tags, I would be looking for opportunities to group them according to changes.  Then you could issue the PI.PIPointList.SaveAttributes call per grouping.  Even if you have 1000 groups out of 100,000 tags, this would be 99,000 fewer calls to the PI Server.

                   

                  Rick

                    • Re: AF SDK Update many tags attributes
                      soltalon

                      Hello Rick,

                       

                           With the way our systems are configured, this call would be getting made 1-2 times a month.  The biggest problem lies in the fact that we don't have a way of knowing if a tag's information has changed in the system of origin (a SCADA system).  Because of this we have to compare every point in PI 130kish right now.  This includes changes to the descriptor which is rather unique and isn't something I would be able to group.  It is looking like the IPIPoints2 EditTags function will better suit my needs for this than what the AF SDK currently offers.  I can just make all the updates in groups of thousands and it does it very quickly.

                           Thank you for all the information and tips Rick.