Is there SDK equivalent call for TimeEq PE function? I do not have option to use event frames currently.
Check out the IPICacluation interface and specifically the Calculate method or the PrecentTrue method. Let us know if you have questions and I can provide sample code.
This is what I am using. But results are not same as PE tag results. Am I doing something wrong here?
PE = "TimeEq('" + StatusTagName + "', 't', '*', ""RUNNING"")/3600"
Dim values As PIValues
values = ipicalc.TimedCalculate(PEtime, PE) ' .Calculate(PEtime, PEtime, PE, SampleTypeConstants.stRecordedValues, 1)
I tried two different methods to do this and got the same results as my PE and even Datalink (just to be sure).
String filterExp = "'ba:active.1' = \"Active\"";
PISDKCommon.NamedValues nvalues = ipidata.FilteredSummaries("t", "t+10H", null, filterExp, ArchiveSummariesTypeConstants.asCount, CalculationBasisConstants.cbTimeWeighted);
string PE = " TimeEq('ba:active.1','t','t+10h',\"Active\")";
values = ipiCalc.Calculate(starttime,endtime,PE,SampleTypeConstants.stRecordedValues,null,null);
Hope this helps!
Nice meeting you here. I was searching the same solution. By trying the approach you mentioned, I realize that the DataLink formula could be fulfilled by PI-SDK (deprecated though), which is great. The "percenttrue" does work for me, but the "TimeEq" method doesn't carry out the exact results expected. I may need to try it later.
For people first get in touch with the relation btwn PI-SDK and DataLink, the following table is a fantastic lead to begin with.
AF SDK Equivalents for DataLink Functions (reference-only for PI SDK)
Retrieving data ...