AnsweredAssumed Answered

AFEventFrameSearch serach element at element level and recursively

Question asked by Jagan on Mar 1, 2019
Latest reply on Mar 2, 2019 by Jagan


Using latest AF SDK "PI Server 2018" version, trying to find event frames at element level. The need is to look for event frames at the element level and optionally also recursively for all elements under the selected element.

What I tried below is not working, any comments on how to achieve this?


Trying to do the same with AFEventFrameSearch

tokens.Add(new AFSearchToken(AFSearchFilter.Target, AFSearchOperator.Equal, context.Element.GetPath()));

Printing of search shows it as : search: SortOrder:Desc Start:>="2019-01-30T15:47:32.1211531Z" End:<="2019-03-01T15:47:32.1481544Z" Root:"\\SRV\PROD_CM\Customers\DemoCustomer\DemoSite\UNIT1" AllDescendants:true



search.FindEventFrames(startIndex, fullLoad: true, pageSize: limit + 1);is resulting into following error

System.FormatException: The object for '\\SRV\PROD_CM\Customers\DemoCustomer\DemoSite\UNIT1' in search criteria 'Root:"\\SRV\PROD_CM\Customers\DemoCustomer\DemoSite\UNIT1"' was not found.

   at OSIsoft.AF.Search.AFSearch.ResolveObjectPath[T](AFSearch search, AFIdentity identity, AFSearchToken token, String path, Boolean throwOnError, Boolean systemLevel)