Skip to main content
Data Management
PI System
Industrial Automation

Optimizing Dynamic Tag Queries in PI SQL DAS OLEDB

Explore the best practices in handling dynamic tag mappings in OSIsoft PI while querying archived data using PI SQL DAS OLEDB.

Roshan Soni

4 min read

Solving PI SQL DAS OLEDB Dynamic Tag Mapping Challenges

Handling dynamic attributes in OSIsoft PI can be particularly challenging when querying archives using PI SQL DAS OLEDB. Especially when you have a situation where tag mappings in your AF (Asset Framework) application change based on operational conditions or specific parameters, retrieving accurate historical data becomes complicated.

This post delves into effectively addressing the issue of dynamic tag retrieval and how to maintain accuracy in historical data queries.

The Challenge

Consider an industrial setting where data from a seed fermentor is transferred to a production fermentor. The seed fermentor might transfer materials to different production fermentors (e.g., FE2000 or FE3000), each identified by a unique 'Prod Fermentor Number'. In a typical setup, your AF might have attributes set with string substitutions that reflect these conditions, dynamically switching the underlying PI tag based on the current 'Prod Fermentor Number'.

The problem arises when querying archived values with PI SQL DAS OLEDB. When executing a query, it sometimes fetches data associated with the currently active tag rather than the relevant tag during the historical event time frame. Consequently, this could lead to data mismatches or inaccuracies when reviewing past operations.

Proposed Solution

One effective way to handle this challenge is by revising your data architecture involving AF Analyses, which handles dynamic tag correlations and writes it to a set PI tag. Here’s a step-by-step approach:

  1. Setup Analysis in AF: Create an analysis in your AF setup that captures the active ‘Prod Fermentor’ number and writes this along with any relevant data to a dedicated PI tag. This ensures that regardless of dynamic changes in tag affiliation, historical data is consistently stored.

  2. Tag Energy Aggregation: The PI tag created by the analysis will aggregate data for all potential dynamic mappings. Whenever a switch occurs between production fermentors, the analysis ensures correct data attribution at all times.

  3. Update SQL Queries: Adjust your PI SQL DAS OLEDB queries to reference these new consolidated PI tags. This process simplifies the retrieval process, ensuring that historical data queries correctly reflect the operational environment at any query-time.

This solution leverages AF and PI Analysis’ ability to contextually switch and store data, ultimately improving reliability in operational intelligence.

Best Practices and Tips

  • Frequent Synchronization: Ensure your AF templates and analyses are frequently synchronized with PI Data Archive records. Consistent updates minimize discrepancies.
  • Historic Validation: Regular audits of historical data versus operational logs can validate accuracy in retrieval setups.
  • Documentation: Document every operational change in AF templates where dynamic attributes are extensively used. Having a detailed change log helps in troubleshooting and mapping queries effectively in diverse scenarios.

By using AF Analyses to manage dynamic tag mapping challenges, querying historical data via PI SQL DAS OLEDB becomes more reliable and less prone to the pitfalls of dynamic mappings. These improvements pave the way for more robust data-driven decision-making, essential for operational excellence in dynamic industrial environments.

Feel free to share your insights or additional solutions you might have implemented for similar scenarios in the comments below!

Tags

#OSIsoft PI
#AF Analysis
#PI SQL DAS OLEDB
#Dynamic Tags
#Data Querying

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

    Optimizing Dynamic Tag Queries in PI SQL DAS OLEDB | Pisharp Blog | PISharp