AnsweredAssumed Answered

Updating PI Points in PI server in batches

Question asked by Shubhangi on Jul 6, 2020
Latest reply on Jul 6, 2020 by Shubhangi

Hey Everyone, I am working on a piece of code where i have to update the PI Points in Pi Server and have to know whether all PI Points are updated successfully or only some Points are updated.

 

I am able to update the PI Points in PI Server with the below mentioned piece of Code.

 

{

// Extract the PI point
PIPoint pIPoint = PIPoint.FindPIPoints(piServer, tagName).FirstOrDefault();
AFAttribute aFAttribute = new AFAttribute(pIPoint);

 

// Create an AFValue with tag value and timestamp
var result = AFValue.Create(aFAttribute, double.Parse(tagValue), new AFTime(Convert.ToString(timestamp).DateTimeFromUnixTimestampMillis()));
afValues.Add(result);

}


//Updating the PIServer with the PI Points
AFErrors<AFValue> errors = piServer.UpdateValues(afValues, OSIsoft.AF.Data.AFUpdateOption.Replace);


if (!errors.HasErrors)
{
isWriteToDeviceSuccess = true;
}
else
{

}

 

My Question is how to know whether all pi points are updated or some of the points are not updated.

pipoints updatevalues() aferrors

Outcomes