Extracting Single Values from PI Point Arrays in PI System 2018 SP3
How to deal with the need to extract individual values from PI Point Arrays in PI System 2018 SP3, especially when array functions are not available.
Roshan Soni
Extracting Single Values from PI Point Arrays in PI System 2018 SP3
Working with arrays in PI Asset Framework (AF) can be both powerful and challenging — especially when using older versions of the PI System. One question that often arises is: How can I extract or reference single values from a PI Point Array for further calculations, particularly when these arrays are the result of a table lookup?
In this post, we’ll walk through why this scenario arises, discuss the challenges in PI System 2018 SP3, and present some practical solutions (and workarounds) for dealing with PI Point Arrays.
Why Use PI Point Arrays?
A typical use case for PI Point Arrays is when you perform a table lookup in PI AF with a result that consists of multiple tag references (e.g., 10 flow tags per equipment row). The table lookup returns these references as an array, which can be handy for storing multiple related points. However, further analytics usually require individual tag values — not the entire array.
The Challenge: Accessing Individual Elements
While later versions of PI AF introduced additional array functions, in PI System 2018 SP3 (and earlier), native support for referencing or extracting specific elements from PI Point Arrays in PI Asset Analytics is limited — and functions like ArrayElement() aren’t available.
Example Scenario
- You perform a table lookup and load results into a PI Point Array attribute (
FlowTagsArray). - You need the value from the 2nd element (e.g., for a calculation:
FlowTagsArray[2]), but array element referencing syntax or functions are not supported in 2018 SP3 analytics.
Workarounds in PI System 2018 SP3
1. Splitting the Table Lookup
If feasible, design your table lookup such that each tag is retrieved by a separate attribute, instead of one array attribute. This avoids the array and lets you reference each tag directly in analyses.
2. Manual Attribute Creation
If restructuring isn’t possible and the array must be used, create individual PI Point reference attributes, each pointing to the respective tag. Use table lookup for each attribute with a filter (if your table and lookup logic allow for it).
3. Custom Scripting or AF SDK
For more advanced scenarios, use the PI AF SDK with C# (e.g., in a custom Data Reference or external application) to read the array and programmatically extract individual values. While this requires additional development, it’s a robust workaround where analytics functions fall short.
4. Upgrade to a Newer Version (if possible)
Newer versions of PI System afford greater flexibility with array functions in analytics. If your operational requirements allow, consider coordinating an upgrade with your admin team to enable these features.
Conclusion
In summary, while direct extraction of elements from PI Point Arrays isn’t supported in PI System 2018 SP3 analytics, there are practical workarounds — from restructuring your table lookup and attribute setup, to leveraging AF SDK scripting, or considering a system upgrade.
If your requirements are recurring or becoming more complex, it may be time to talk to your PI System administrator about options for upgrading or deploying custom solutions.
Have you run into this challenge? Got a creative workaround? Share your experience in the comments below!
Tags
About Roshan Soni
Expert in PI System implementation, industrial automation, and data management. Passionate about helping organizations maximize the value of their process data through innovative solutions and best practices.
No comments yet
Be the first to share your thoughts on this article.
Related Articles
Enhancing PI ProcessBook Trends with Banding and Zones: User Needs, Workarounds, and the Road Ahead
A look at the user demand for trend banding/zoning in OSIsoft PI ProcessBook, current VBA workarounds, UI challenges, and how future PI Vision releases aim to address these visualization needs.
Roshan Soni
Migrating PIAdvCalcFilVal Uptime Calculations from PI DataLink to PI OLEDB
Learn how to translate PI DataLink's PIAdvCalcFilVal advanced calculations—like counting uptime based on conditions—into efficient PI OLEDB SQL queries. Explore three practical approaches using PIAVG, PIINTERP, and PICOunt tables, and get tips for validation and accuracy.
Roshan Soni
Understanding PI Web API WebID Encoding: Can You Generate WebIDs Client-Side?
Curious about how PI Web API generates WebIDs and whether you can encode them client-side using GUIDs or paths? This article explores the encoding mechanisms, current documentation, and best practices for handling WebIDs in your applications.
Roshan Soni