Skip to main content
PI System
Troubleshooting
PI DataLink

Why Does PI DataLink's PIAdvCalcExpVal Have Expression Length Limits?

Discover why PI DataLink's PIAdvCalcExpVal function behaves inconsistently with long expressions, and learn how to workaround the character limits in both direct Excel formulas and the Advanced Calculated Data dialogue.

Roshan Soni

4 min read

Understanding PI DataLink's PIAdvCalcExpVal Expression Length Limitations

One of the essential tools in the PI System ecosystem for working with real-time and historical data in Excel is PI DataLink. Among its flexible and powerful functions, PIAdvCalcExpVal allows users to perform advanced calculations using PI expressions. However, users may sometimes encounter unexpected errors, especially when working with complex or lengthy expressions.

The Issue: Inconsistent Behavior with Long Expressions

A common point of confusion occurs with long PI expression strings. Users have observed that:

  • Direct Formula Entry: If you enter a long PIAdvCalcExpVal expression directly into an Excel cell formula, it will often be accepted—even if the string is quite long. Results are returned as expected.

  • Dialogue Entry: Entering the same lengthy expression via the Advanced Calculated Data dialogue window leads to an error:

    Error is pasting array Choose a different output cell address

  • Expression Length: This dialogue window error appears when the total formula length exceeds approximately 163 characters in DataLink v3.x (and around 156 characters in DL4).

  • Output Cells Not at Fault: The issue is independent of whether the destination is a single cell or an array. Trimming the formula until it is below the length threshold resolves the error.

  • Not All Functions Affected: This length restriction doesn't seem to apply identically to other DataLink functions like PIExpVal.

Why Does This Happen?

Excel add-ins and their user interfaces sometimes have internal limits set on input buffers. It appears that the Advanced Calculated Data dialogue of PI DataLink enforces a stricter character limit than the formula parser invoked by direct cell entry. This restriction is not always clearly documented, which can be confusing.

Workarounds and Recommendations

  • Direct Formula Entry: If your advanced calculation expression is long, you may have better success entering it directly as a formula in the cell instead of through the dialogue window.
  • Shorten Expressions: Where possible, break complex expressions into smaller components or leverage AF (Asset Framework) or calculated attributes to encapsulate logic, reducing string length in DataLink.
  • Stay Updated: OSIsoft (now part of AVEVA) periodically updates DataLink, addressing bugs and increasing limits. Consider upgrading to the latest version if you frequently hit these limits.
  • Contact Technical Support: For persistent issues, or if you encounter limitation thresholds that impact your workflow, reaching out to AVEVA/OSIsoft Technical Support is recommended. They can provide workarounds or log feature requests for future releases.

Final Thoughts

Understanding the subtle differences between how PI DataLink processes direct cell formulas and dialogue entries can help prevent frustration and enable smoother Excel integration. When in doubt, consult technical support—especially if you run into undocumented behavior or find that existing product limitations constrain your work.

Have you encountered this, or similar, DataLink quirks? Share your experiences in the comments!

Tags

#OSIsoft
#PI DataLink
#AVEVA
#excel
#PIAdvCalcExpVal
#expression limit
#Advanced Calculated Data

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.

Sign in to comment

Join the conversation by signing in to your account.

Comments (0)

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