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

    AF SDK AFUpdateOption.Remove

    ErnyC

      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.

      Thanks

      Ernesto

        • 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.

           

          Dan

          • Re: AF SDK AFUpdateOption.Remove
            mtippett

            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:

             

            https://techsupport.osisoft.com/Documentation/PI-AF-SDK/html/abef2d11-6350-4fd7-87f9-2c8a18b6d94e.htm

            1 of 1 people found this helpful