Thanks for the fast response

, I'll post the entire method i got so far and an example how i would use it.
Example Code:
List<string> tagsToFetchData = new
List<string>();
tagsToFetchData.Add("SUBSTN.ANGLE1");
tagsToFetchData.Add("SUBSTN.ANGLE2");
List<Period> periods = new
List<Period>();
periods.Add(new
Period(new
DateTime(2010, 1, 1), new
DateTime(2010, 1, 2)));
//Analyse Data from 1 january 2010 to 2 january 2010periods.Add(new Period(new
DateTime(2010, 1, 5), new
DateTime(2010, 1, 6)));
//Also Analyse from 5 january 2010 to 6 january 2010
//the following is wrong but you'll understand my problem here..I'm trying to round the values but also i want the values that aren't questionable also for all tagsstring filterExp = "Round([ALL_TAGS], 22.5) AND IsSet([ALL_TAGS], \"q\") = 0"
public
DataTable GetTagsInterpulatedValues(
List<string> tagsToFetchData,
List<Period> periods,
string filterExp)
{
DataTable dt = new
DataTable();
DataColumn timestamp = new
DataColumn("timestamp",
Type.GetType("System.String"));
dt.Columns.Add(timestamp);
PointList points = new
PointList();
foreach (
string tag
in tagsToFetchData) {
PIPoint point = piServer.PIPoints[tag];
points.Add(point);
DataColumn dc = new
DataColumn(tag, Type.GetType("System.String"));
dt.Columns.Add(dc);
}
ListData points_data = points.Data;
NamedValues trash;
foreach(
Period p
in periods) {
PointValueLists period_vals = points_data.InterpolatedValues(p.iniPeriod, p.endPeriod, 0, filterExp,
FilteredViewConstants.fvRemoveFiltered, out trash, null);
foreach (
PointValueList lst
in period_vals)
{
PIValues pointValues = lst.PIValues;
}
}
return dt;
}
I know It's rather complicated, if its not possible could you suggest anything i could optimize here?
Quote:Another optimising technique is to make use of the multi-threaded PI server by making asynchronous PISDK calls instead of synchronous. In some cases there has been 10 times performance improvement but really depends on what you are doing.
I find this interesting, is there any documentation i could see or an example how to achieve this?
Again thanks for your help

**EDIT** i forgot to assign the results to the DataTable but you get the main idea of what I'm trying to do