GALLON

Storing data in PI with PIPoint.UpdateValues([afvalues], AFUpdateOption.NoReplace) doesn't work as expected

Discussion created by GALLON on Sep 30, 2014
Latest reply on Sep 30, 2014 by ekuwana

We have written a command line tool that reads a formatted data file and writes the data to some PI points using the AFSDK. We want to prevent the overwriting of a value at a given timestamp and the insertion of two values at a given timestamp. We try to use the "OSIsoft.AF.Data.AFUpdateOption.NoReplace" option with the PIPoint.UpdateValues() method as follow :

 

      PIPoint.UpdateValues(theNewAFValues, AFUpdateOption.NoReplace)

 

But we don't get the expected result. Even if a value already exists for a given timestamp, a second value is inserted at the same timestamp. We are sure the timestamps are exactly identical, because those are daily data and we set the same time for all of them in our tool. We are using PI Server 2012 and AFSDK 2.6.

 

What is the best way to prevent the overwriting of a value at a given timestamp and the insertion of two values at a given timestamp ? The perfect behaviour for us would be that this kind of attempts could be logged easily.

Outcomes