Skip to main content
Data Management
PI System
AF SDK

Mitigating the "Event Collection Exceeded" Error in AF SDK

Learn how to navigate the "Event collection exceeded the maximum allowed" error in AF SDK with these strategic approaches.

Roshan Soni

4 min read

In the world of industrial data management, the OSIsoft PI System is a widely acclaimed tool for handling vast streams of sensor data. However, even powerful tools like PI can encounter limitations, such as the dreaded "Event collection exceeded the maximum allowed" error when using the AF SDK, especially with the AFCalculation.CalculateSummaries method.

Understanding AF SDK's Method Limitations

To dive deeper into this issue, it's essential to understand why these errors occur. The AFCalculation.CalculateSummaries method performs calculations on the client side. This is unlike the server-side operations carried out by PIPoint.Summaries and AFData.Summaries methods. While server-side methods calculate summaries within the PI server itself, allowing only the summarized data to be transferred to the client, the CalculateSummaries method demands that all necessary raw input data be brought to the client first.

The key limitation here is the 1.5 million event limit. If you have more recorded values than this, you will hit the cap, leading to the error. Conversely, server-side summaries bypass this hurdle as they handle the raw data processing internally on the server, offering a more efficient solution with much lower data throughput to the client.

Strategies to Overcome the Limitation

Here are a few strategies that can help avoid or alleviate this problem:

1. Opt for Server-Side Calculations

When possible, always choose methods that perform calculations server-side, like PIPoint.Summaries or AFData.Summaries. These methods automatically avoid the event limit issues because the heavy lifting is done server-side, and only the summarized results are transferred over to the client.

2. Use Asset Analytics

If you must use the CalculateSummaries method, consider employing Asset Analytics in combination with it. Pre-calculate chunks of your data using Asset Analytics to reduce the dataset size. By breaking your dataset into manageable pieces before employing client-side calculations, you can effectively skirt the 1.5 million event limit.

3. Adjust Data Retrieval Practices

Consider refining your data input operations. Review your data access patterns and modify queries to reduce the amount of data pulled to the client directly.

4. Evaluate the Need for Client-Side Calculations

Finally, it's essential to assess whether client-side calculations are necessary for your use case. Often, server-side calculations can achieve similar outcomes with greater efficiency and less hassle.

Conclusion

Navigating the limitations of the AF SDK requires a strategic approach and a thorough understanding of both client and server-side operations. By implementing these strategies, you can significantly enhance the performance of your data summaries in PI system environments and continue to leverage the full potential of the PI System without running into event limit issues. Always prioritize server-side operations when possible to maximize both performance and efficiency.

Tags

#OSIsoft PI
#AF SDK
#Data Limits
#Server-side Calculation
#Asset Analytics

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

    Mitigating the "Event Collection Exceeded" Error in AF SDK | Pisharp Blog | PISharp