matlab-find-pi-assets

Find and query PI Data Archive tags and Asset Framework elements using MATLAB.

995|122|Updated Apr 3, 2026
One-click install
npx skills add https://github.com/matlab/matlab-agentic-toolkit --skill matlab-find-pi-assets
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: matlab-find-pi-assets
Source: https://github.com/matlab/matlab-agentic-toolkit/tree/main/skills-catalog/test-and-measurement/matlab-find-pi-assets
Command: npx skills add https://github.com/matlab/matlab-agentic-toolkit --skill matlab-find-pi-assets

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Locating the right PI tag or Asset Framework element in large OSIsoft PI systems is error-prone, and writing raw .NET AFSDK interop code in MATLAB is verbose and fragile. This Skill guides an AI agent through MATLAB's Industrial Communication Toolbox workflows to discover servers, navigate asset hierarchies, and read current or historical data correctly.

Core Features & Use Cases

  • Direct PI Tag Lookup: Connect with piclient, search tags by name or description pattern, and read current values or historical data with aggregation (R2022a+).
  • Asset Framework Navigation: Connect with afclient, list databases, find elements by name, template, or path, and retrieve attributes with disambiguation tables (R2026a+).
  • Server and Database Discovery: Enumerate available PI Data Archive and AF servers via .NET AFSDK, with mandatory user confirmation before connecting.
  • Use Case: An engineer asks for the average active power of generator GU1 last month. The agent discovers the AF server, confirms the database and element with the user, validates the attribute has time-series data, and reads hourly averaged history with readHistory.

Quick Start

Ask the agent to find the PI tag or AF element for your asset and read its current value or historical data over a date range.

Frequently Asked Questions about matlab-find-pi-assets

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I read data from a PI tag in MATLAB?

Connect to the PI Data Archive server with piclient, search for the tag using tags(piObj, Name='pattern*'), then call read(piObj, tagName) for the current value or add DateRange, Interval, and AggregateFcn for historical data. This requires Industrial Communication Toolbox R2022a or later.

How do I find PI Asset Framework elements in MATLAB?

Connect with afclient, select a database, then use findElementByName with a wildcard pattern, findElementByTemplate for type-based search, or findElementByPath with a double-quoted string path. AF navigation requires MATLAB R2026a or later.

What is the difference between piclient and afclient in MATLAB?

piclient connects to PI Data Archive for direct tag lookup and is best when you know the tag name. afclient connects to PI Asset Framework for navigating element and attribute hierarchies, templates, and databases.

Why does findElementByPath fail even when the AF path is correct?

findElementByPath and findAttributeByPath silently fail when given a char array in single quotes. Always pass the path as a double-quoted string, for example findElementByPath(afObj, "\\server\db\path").

Can this skill create or modify PI AF elements or write data back?

No. The skill covers read-only workflows: finding tags, navigating AF hierarchies, and reading current or historical data. It does not support creating or modifying AF elements, writing data, event frames, notifications, or PI Vision access.