3 Replies Latest reply on Aug 7, 2017 7:50 AM by ErnyC

    AF SDK AFUpdateOption.Remove


      Hi all

      Trying to remove PI Archive values with AF SDK (v4.0.30319) and UpdateValues with AFUpdateOption.Remove.

      Everything works fine except when a point is locked by Buffering.

      I know it's possible to unlock the point with piartool, but I ask if it's possible to unlock e delete value via AF SDK.



        • Re: AF SDK AFUpdateOption.Remove
          Dan Fishman

          If your AF SDK program performed a buffered write, it would then have a lock on the point until another buffered source writes and locks the point.. Also, only the most current value (snapshot) should be locked so historical data can be deleted. You might be able to come up with some creative solutions such as writing a duplicate value or a value right after the snapshot value and then deleting it and the previous value.



          • Re: AF SDK AFUpdateOption.Remove

            Hi Ernesto,


            I don't believe that there is a way to remove a buffer lock with the AF SDK.  I believe that this is by design so that the compression algorithm is applied by the PI buffer subsystem only when it is used.


            In your case I think the best solution would be to use UpdateValues with the AFBufferOption.BufferIfPossible (or .Buffer) option.  This would mean that the writes to the archive would go through the PI buffer subsystem.  As buffer subsystems will not lock each other out (they will just transfer the lock from one PIBufss instance to another) this will prevent you from getting this error.


            Some information on how to enable this is available at the link below:



            1 of 1 people found this helpful