Calculations to backfill PI Totalizers

Discussion created by mcsparronm on Jul 16, 2014
Latest reply on Jul 18, 2014 by Gregor

I am writing an application that will backfill a PI Totalizer, using data from a source tag between two specific dates. This application must be capable of back filling the PI Totalizer with the correct data based on the calculation type (e.g. average, min, max, std dev etc.).


I had hoped there would be a method within the PI SDK that would allow me to plug in the settings and let PI do the work, rather than having to pull out the data and manually perform calculations. Here's code/pseudocode for my train of thought right now:

NamedValues vals = new NamedValues();
// Populate vals

// Create new Totalizer point
connectedServer.PIPoints.Add("test_tag_1", "Totalizer", PointTypeConstants.pttypInt32, vals);

Once the tag is created, then get the data from the source tag between the two dates. Configure calculation settings, perform calculations and then UpdateValue().


Can someone point me in the right direction here? What methods to use etc.