3 Replies Latest reply on Jan 28, 2014 1:48 PM by cmanhard

    PISDK RemoveValues in AFSDK

    richardmarcell

      I've seen the question or the AFSDK PI interface not having and equivalent to RemoveValues raised a couple of times. The answer given was to use UpdateValues with an UpdateOption of Remove. What I don't understand is the RemoveValues is given a start time and end time and all archive values in that range are removed. UpdateValues is given a value list. Do you have to first retrieve the archived events and pass them to UpdateValues (works I guess but not really equivalent). What am I missing?

        • Re: PISDK RemoveValues in AFSDK
          mhamel

          @Richard: Yes, you need at least have called the UpdateValues method to retrieve the values you want to remove. You might have stored them locally in your application as List<AFValue> to passed them to UpdateValues method to remove them.

           

          This "removal" mechanism allows the PI Buffer Subsystem to intercept the request to buffer the change(s) to be applied to collective members.

            • Re: PISDK RemoveValues in AFSDK
              Rick Davin

              On a tangent topic, if you have duplicate archived values at the same event, then the AFSDK UpdateValues will only remove as many values for that one event as you pass in the list.  If you only want to prune out one duplicate, you will only pass one value for that event in the list - it will not remove both of them unless you pass it the same value twice.

                • Re: PISDK RemoveValues in AFSDK
                  cmanhard

                  Note that the PI Server itself does not have a "Remove" events capability that takes a time range.  The PI SDK implementation of RemoveValues over a time range is to read all values in the range, and send them back via an update.  When the PI Server does implement this requested feature, the AF SDK will add a method.  Until then, we think it is clearer, and potentially more efficient, to expose the functionality as it is implemented in the server.