AnsweredAssumed Answered

Data written to the attributes disappear shortly after

Question asked by Sivakanesh on Nov 4, 2015
Latest reply on Nov 4, 2015 by Marcos Vainer Loeff

I'm trying to add some data into my development PI server using AF SDK.  The data I want to update are from last year and in the following format.

 

DatevalFeedVol
01/04/2014 23:00:001.24
02/04/2014 23:00:001.14
03/04/2014 23:00:001.22

 

I have created a simple code block that take this data and inserts into the attribute.  The code appears to work and can see the data in SMT.

However, what I find is that the data disappears after a minute or so and I can't see it from SMT or other tools.

Is this something to do with how the data is written to the archive?  Can I make it so that the data is permanently accessible please?  I'm just starting out with the PI System, so I might be missing something fundamental here.

Here is the code.

 

PISystem system = new PISystems()["pisys"];
system.Connect();
var dbCHP = system.Databases["CHP"];
UOM uomM3 = system.UOMDatabase.UOMs["m3"];
PIServer piServer = PIServers.GetPIServers().DefaultPIServer;

AFAttribute AttribFeedVol = AFAttribute.FindAttribute(@"\\pisys\Feed Volume", dbCHP) as AFAttribute;
AttribFeedVol.DefaultUOM = uomM3;
AttribFeedVol.ConfigString += ";ReadOnly=False";
AFValues newValuesFeedVol = new AFValues();

//Code block for reading the source data from Excel- not shown here.
foreach(row in ExcelRows){
 DateTime dtDateTime = (DateTime)(row["Dateval"]);
 double dblFeedVol = double.Parse((row["FeedVol"].Value2.ToString());

 AFValue afvFeedVol = new AFValue(AttribFeedVol, dblFeedVol, dtDateTime, uomM3);
 newValuesFeedVol.Add(afvFeedVol);
}

AttribFeedVol.PIPoint.UpdateValues(newValuesFeedVol, AFUpdateOption.InsertNoCompression);
system.Disconnect();

 

Thanks.

Outcomes