aldorexbraam

Migration from AF 2.4 ==> 2.5 RC3

Discussion created by aldorexbraam on Aug 15, 2012
Latest reply on Aug 15, 2012 by cmanhard

 

 

We are currently migrating from 2.4 to 2.5 and want to benefit from the new PI data access features, 

 

As such we are looking for an alternative to delete values from the pi archive for an attribute. 

 

Problem is that there does not seem to be an alternative for the PISDK RemoveValues function. 

 

following replacement code does not remove the values from the archive. 

 

// AF 2.4 code

 

PISDK.PIPoint point = (PISDK.PIPoint)att.RawPIPoint;

 

point.Data.RemoveValues(startdate, enddate, PISDK.DataRemovalConstants.drRemoveAll, null);

 

 

 

 

 

// AF 2.5 Code 

 

 

 

OSIsoft.AF.PI.PIPoint pipoint = att.PIPoint;

 

AFValues vals = pipoint.RecordedValues(new AFTimeRange(startdate.ToLocalTime(), enddate.ToLocalTime().AddHours(1)), OSIsoft.AF.Data.AFBoundaryType.Outside, null, true, 0);

 

vals.RemoveAll(e => e.Value != null);

 

 

Outcomes