Reference Solution: AVEVA PI System Current Values to Narrow Table Format
This article captures the design considerations for creating a solution to poll PI Asset Framework for asset attribute current values and create a data payload for a narrow table format
What Does This Article Cover?
An Intelligence Hub solution can be created to poll AVEVA PI System at a specified frequency to obtain the current value of Asset Framework asset attributes. The solution can be configured to shape the data payload so that the values for all attributes are written to the same values column. The following describes how this solution can be created.
Design Assumptions
The following are some of the design considerations.
- This approach should be used when polling at a frequency of fractions of a minute or slower is acceptable.
- This approach uses the Intelligence Hub PI Connection Asset Current Values Input that returns the current values of all attributes including asset attributes that are and are not associated to a PI Point.
- This Connection Input queries PI Asset Framework and can be a long duration query if there are many assets returned by the query.
- This approach captures new PI Asset Framework assets and new attributes assuming the query defined in the Connection Input will obtain the new assets. For example, the reference project uses a PI Asset Framework template in the query so as new assets are added in PI using the template they will be returned by the query.
- The reference solution only captures the PI Asset's element ID. The assumption is that the narrow table is linked to another table containing asset metadata.
Overall Solution Configuration
The following describes the Intelligence Hub configuration objects.
- Obtain data from PI using the PI Connection Asset Type Input to Get Current Values.
- Model the desired output schema using an Intelligence Hub Model.
- Create a Pipeline with Flow stage configured with the desired polling frequency.
- Configure the Connection Input as the Reference of the Flow stage.
- Configure the Connection Output for the respective data store.
Pipeline Configuration
The following describes the Intelligence Hub Pipeline design.
- Breakup the incoming array.
- Move context to metadata.
- Use JavaScript to create an array separating each unique attribute.
- Add context from metadata.
- Determine of the value is a number or not.
- Map the payload to the predefined schema using the Intelligence Hub Model.
- Buffer transactions using a strategy that aligns with the solution requirements for latency. It may be beneficial to buffer transactions for a cloud data warehouse, like Snowflake for example.
- Consider the use of the Buffer Key based on use case.
- Create the desired file format for the data lake if applicable.
- Write to the data lake configuring the desired file name format.
Other Considerations
The following should be considered related to this design
- The Intelligence Hub PI Connection Current Values Input query is relatively slow and may not be capable of returning values for hundreds or more PI Assets
- The timestamp is the polling time and not the timestamp for the last value change in PI.
- The reference example simply considers whether the value is a number or not. Additional logic may be needed to handle a variety of values including Boolean, etc.
Solution Video
The following video captures a reference solution.
Additional Resources