I noticed that the Data.RecordedValues function does not accept AF attributes as an argument, it only accepts PIPoint.
Is there another way to do this?
Yes. Quit using PI SDK and use AF SDK. Help on AFAttribute.Data.RecordedValues.
As this is an application that will be developed in Excel, I can not use the PI AF SDK. I need to use PI SDK.
Only other option is to then use the PI Web API within your excel application. The PI SDK cannot reference attributes and there is no workaround for that.
PI Web API Client libraries already published
GitHub - osisoft/PI-Web-API-Client-VBA: PI Web API Wrapper for VBA generated using the Swagger specification
To add on to Rick Davin's comment, the AF SDK is a Microsoft .NET based programmatic library that provides structured access to the variety of data stored in the OSIsoft PI System.
Also keep in mind that AF SDK is not limited to only interacting with the AF Server. It provides rich, powerful methods to interact directly with the PI Data Archive and is almost always more appropriate to use than the older PI SDK. The AF SDK data access methods in the OSIsoft.AF.Data namespace and the OSIsoft.AF.PI namespace supersede the functionality provided by PI SDK.
You can find examples in the documentation and sample videos at Developing Applications with PI AF SDK
Hello Thyagarajan Ramachandran!
As this is an application that will be developed in Excel, I can not use the PI AF SDK. I need to use PI SDk.
As an alternative to Vincent's post, if you search in Techsupport Website, you can find an AF wrapper that allows you to use AF SDK in VBA. You can customize this wrapper to make it work for you in your application.
Before using it, please read the notice carefully.
The AF wrapper is a learning tool and not a complete product for use in a production environment. It is offered "as is." This download provides an example demonstrating how to create a COM-based add-in using .NET and AF SDK within Visual Studio. It is intended for experienced .NET developers and not VBA programmers with only a beginner’s level of .NET experience. The DLL performs only a few basic, read-only AF SDK calls. Significant time and resources may be required depending upon the level of customization you wish to include for your particular business requirements.
If you are not familiar with .NET, then it is probably better to use the PI Web API wrapper instead.
I think Vincent Kaufmann has given the best answer, although I would modify his statement to be: The only other viable option is to then use the PI Web API within your Excel application. He included the link to the PI Web API Client library for VBA. This is far more full featured than the bare bones AF Wrapper Example. We no longer recommend the AF Wrapper, which is only available to paid PI DevClub subscriptions, as it usually requires a different skill set than the average Excel or ProcessBook coder possesses. The PI Web API Client library for VBA is more flexible and feature rich than the AF Wrapper.
Retrieving data ...