AnsweredAssumed Answered

PI API w/multiple channels using Element Templates

Question asked by NickNH on Sep 11, 2020



We have a system that contains over 8000 assets. Obviously this means that we would really like to take advantage of using the element templates for our AF structure. The problem we are running into is that we need to get data in bulk from these 8000 assets. If we organize our AF structure in a way that makes sense, we wind up with a handful of templates (less than 10), and a nice simple 2 layer tree, where we have about 300ish parents that the 8000 assets live underneath (varying amongst the other 9 element templates).


But once we connected to the web sockets to listen on the channels to the MANY attributes on each of the assets, we found that this is not possible. See PI Web API  & GetChannel GET streamsets/{webId}/channel. If we make the socket request for the parent, it does not listen for the childrens' attributes. While I understand we can include multiple web Ids in the request, that creates a very tiny limit given the max character length for urls. So it appears to us that we must either create 8000 connections, which seems ridiculous. Or we must add all the attributes on the parent, which means that each parent has [# of assets * # of attributes] as it's attributes. Which then becomes unmaintainable because we've lost the ability to use the element templates and is incredibly time consuming. 


Please tell me there is something we are missing or there is another way to manage this. With over 8000 assets and possibly 50 attributes per asset, this isn't a realistic solution for us.