AnsweredAssumed Answered

AFData.PlotValues problem with multiple calls

Question asked by cymerman on Mar 15, 2019
Latest reply on Mar 18, 2019 by gregor

Hi, I have specific problem and I dont know how to handle it...


please look at my code:


List<AFAttribute> values...

var afValues1 = values[0].Data.PlotValues(new AFTimeRange(new AFTime(criteriaStartTime), new AFTime(criteriaEndTime)),


Im using it to get values for plot for specific element, and... it works, let say that when im doing a request i have in response 14 values what is fine for me, but when I have multiple request in same time for getting data for plots (I have view when i can show multiple plots) i have random situations when getting those plot values returns list with one element with value:


afValues1[0]:PI Data Archive '%@\ConfigurationItems|PIServer%' was not found

Value:System.InvalidOperationException: PI Data Archive '%@\ConfigurationItems|PIServer%' was not found

   at OSIsoft.AF.Asset.DataReference.PIPointHelper.ResolvePIServer(IDataReference dataReference, String serverName, String serverId, String& resolvedServerName, String& resolvedServerId, Boolean& nameSubstituted, Boolean& configuredServerIdInvalid)

   at OSIsoft.AF.Asset.DataReference.SinglePIPointResolvedConfiguration.Resolve(IDataReference dataReference, SinglePIPointConfiguration config)

   at OSIsoft.AF.Asset.DataReference.PIPointDR.GetSinglePIPointResolvedConfiguration(IDataReference context)

   at OSIsoft.AF.Asset.DataReference.PIPointDR.PlotValues(AFTimeRange timeRange, Int32 intervals, AFAttributeList inputAttributes, AFValues[] inputValues, List`1 inputTimes)

   at OSIsoft.AF.Data.Query.PlotValuesQuery.ExecuteQueryForSource(AFDataReference dataReference)

   at OSIsoft.AF.Data.Query.MultipleValuesQuery.OSIsoft.AF.Data.IExecutableDataQuery<OSIsoft.AF.Asset.AFValues>.ExecuteQueryForSource(AFAttribute attribute, AFDataReference dataReference, UOM desiredUOM)


In moment when it happens im trying to retry operation (even multiple times) but it ends in same result.


Do you have any ideas why it happening and what I have to do to have responses all the time, even when it would be a lot of requests.


And maybe information that i tried to get same data by WebApi, in multiple tabs for same url and for every request I had correct response.