Handling the 24:00 Timestamp in OSIsoft PI UFL
Explore solutions for parsing 24:00 timestamps with OSIsoft's PI UFL after version updates.
Roshan Soni
Handling the 24:00 Timestamp in OSIsoft PI UFL
OSIsoft's PI System is revered for its robustness in handling real-time data streams from various assets. The PI UFL (Universal File and Stream Loading) interface is a component that enables users to parse and process data from almost any text-based source. Recently, users upgrading to the latest version of UFL may have encountered an issue parsing 24:00 timestamps, which, while not standard, are surprisingly common. Here, we'll explore the problem and share solutions users have implemented.
The Issue with 24:00 Timestamps
In many programming standards, the representation of time should range from 00:00 to 23:59. While "24:00" is commonly used to indicate the end of a day, it often lies outside the standard acceptability range for parsers dealing strictly with HH:MM formats. In version 3.6.7.136 of UFL, a configuration challenge appears where the parser skips lines containing 24:00 timestamps without throwing an error.
Before updating, users could process data with non-standard timestamps such as:
HM3635 1 12/10/2020 24:00 0
After the update, this line is ignored, indicating a change or tightening in the parsing behavior regarding timestamp formats.
Solutions: Enhancing UFL Configuration
The crux of resolving this issue lies in managing how UFL interprets timestamps. Here are some potential solutions:
-
Modify Timestamp Format: Right now, the simplest fix is transforming the timestamp "24:00" to "00:00" of the next day. This can be done in pre-processing scripts or directly during the data acquisition stage if possible.
-
Script-Based Adjustment: Extract the date and time into separate variables using UFL's scripting capabilities. If UFL encounters "24:00," increment the date by one day and set the hour and minute to "00:00".
// Example UFL Script Concept
GetDateTime = if(TimeStamp == "24:00", DateTime.AddDays(1).ToString("MM/dd/yyyy 00:00"), TimeStamp);
- Request UFL Enhancements: Users can provide feedback to OSIsoft for supporting non-standard timestamps like "24:00" as part of their configuration files in the next UFL updates.
Conclusion
While the current UFL version requires workarounds to handle non-standard timestamps, these solutions help in adapting existing configurations and scripts. Users should consider implementing these fixes within their data pipelines or pushing for feature enhancements to better support these timestamp formats in future UFL iterations.
Maintain your data streams' integrity by staying aware of parsing changes during software updates, and always test configurations in a controlled setting before full implementation.
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
Developing Expertise in PI System and Related Technologies: A Comprehensive Training Roadmap
This blog outlines a comprehensive training roadmap for developing expertise in the PI System and related technologies. Structured over four weeks, the program covers essential technologies like the PI System, Asset Framework, and various APIs, providing a strong foundation for data management and analytics.
Roshan Soni
Traversing an AF Database Hierarchy to Count All Elements Using OSIsoft AF SDK
Learn how to use the OSIsoft AF SDK in C# to traverse an AF database and count all elements within its hierarchy. This blog post provides a comprehensive guide with code examples for connecting, traversing, and counting AF elements.
Roshan Soni
A Beginner's Guide to Learning the OSIsoft PI System
Unlock the power of real-time data management and analytics with OSIsoft PI System. This beginner's guide provides a structured learning path and key resources to help you effectively learn the PI System.
Roshan Soni