Crafting Daily Counters in OSIsoft PI: ACE vs. AF Analytics
Explore how to implement daily counters in PI System using ACE and AF Analytics, including configuration tips and advanced reset logic strategies.
Roshan Soni
Alarms, counters, and timers form the backbone of many industrial automation operations, from simple temperature checks to complex machinery monitoring. Within the realm of PI System analytics, such capabilities are vital. Today, we're addressing a common question: is it feasible to implement a counter within OSIsoft PI using ACE (Advanced Computing Engine) or AF Analytics?
Why the Need for Counters?
Counters in PI System are used to track occurrences over time. Imagine needing to count the number of days since a specific event last occurred. This could be, for example, tracking maintenance intervals or monitoring machine downtimes. Implementing an efficient counter ensures you have precise control over such operations.
Leveraging ACE and AF Analytics
Traditionally, many rely on ACE for writing custom calculations that go beyond what the standard configuration-based tools in AF (Asset Framework) can achieve. ACE allows calculations in a programming environment familiar to developers. However, some users have expressed the need for enhancements such as support for modern programming languages like C# and Python.
Using ACE
Here’s the scenario: you want to increment a counter every 24 hours to measure the days elapsed since an event occurred. While achievable using ACE by setting a periodic execution, issues often arise when the same PI tag is used for both input and output due to conflicts with ACE’s I/O handling.
Why AF Analytics Might Be a Better Fit
AF Analytics provides a more robust and reliable method, especially for users who may not want to delve into heavy programming. Here’s how you can set it up to achieve the same result:
-
Create an Attribute with a PI Point Data Reference: This attribute will hold the history of your counter values.
-
Configure a Periodic Analysis: The analysis should run at the desired interval, say daily at midnight.
-
Write the Analysis Expression: A simple formula like
DayCount + 1allows AF Analytics to read the current value of the attribute, increment it by one, and write it back. -
Implementation Details: Make sure 'DayCount' is the attribute tied to your PI tag. This setup effectively reads, processes, and updates the PI Point regularly, achieving the counting mechanism.
Advanced Needs: Timing Logic and Resets
A more advanced requirement might involve resetting the counter at specific times, say 06:30 and 18:30, even if events triggering the counter don't happen exactly at these times. The method involves using both event-triggered and periodic scheduling within AF Analysis. Advanced tips shared within the community often suggest leveraging the current and previous event timestamps to control reset logic.
Conclusion
Both ACE and AF Analytics offer pathways to create counters within PI System. While ACE offers more granularity and programming power for developers, AF Analytics simplifies the task using configuration-based setups, perfect for routine operations. For specialized tasks, though, an enhanced ACE environment supporting more programming languages could greatly augment user capabilities. Still, AF Analysis remains a potent tool for efficiently managing and deploying simple to moderately complex analytics solutions.
By understanding these tools' strengths and limitations, professionals can make informed decisions about which method best suits their operational and technical requirements.
Do you have unique use cases with ACE or AF Analytics? Share your experiences 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