mfalkowski

Adding Points Using UpdateValues

Discussion created by mfalkowski on Jul 17, 2009
Latest reply on Aug 9, 2011 by IRDS

I am new to using the SDK with PI (and PI in general). I went through the material available online, but was not able to find a solution (or even cause) for the behavior I am going to attempt to explain.

 

I would like to use the UpdateValues command from the SDK to preload a test PI Server (default vCampus Install) with some historical records (roughly 2-weeks of 1sec data for about 120 tags).

 

I had started with a single tag, which I manually added in the Point Builder (No Compression, Zero’s and Spans set correctly, classic data point, point source=L, Archiving=On).

 

Below is the C# code I used to update the values to the existing point.

PISDK.Server srv_write;
PISDK.PIPoint ptPIPoint;

srv_write = g_SDK.Servers[textBox1.Text];// server object from the name in textBox1
ptPIPoint = srv_write.PIPoints["PLTFP09FV-1294"];
PISDKCommon.PIAsynchStatus asyncStatus = new PISDKCommon.PIAsynchStatus();

for (int jj = 0; jj < 300; jj++)

    ptPIPoint.Data.UpdateValue(COArray[jj], TimeStamp[jj]
        ,PISDK.DataMergeConstants.dmInsertDuplicates , asyncStatus);
}

I can get the UpdateValues to perform as expected on a small amount of data points (<50 points). But, if I start adding larger amounts (say 300 points, ). Only a small fraction of the points actually get added to the Server, and some of the previously added points get removed. If I do a line by line check of the data as I am updating the Values, using:

ptPIPoint.Data.ArcValue(TimeStamp[jj], PISDK.RetrievalTypeConstants.rtAuto, asyncStatus).Value)

it shows every value is being written.

 

But when I use the “Recorded Values” in the PI System Management Tools, it will only list a fraction of the data I loaded. If I try to just add the data in batches of 50 and hit “Refresh” on the Recorded Values, the values that were previously there no longer show up.

 

I know I must be missing some crazy simple, but for the life of me I cannot figure it out. I am not using any interfaces. I have only added this one Point to the PI Server.

 

I appreciate any guidance you can provide!

 

Thanks,
Matt

Outcomes