Hi,

new to PI and wondering if it is possible to bulk load a group of atributes into matlab. i have a list of these attributes and would like to be able to pass this and time range to a .NET/af SDK function if available

thanks in advance

Hi,

new to PI and wondering if it is possible to bulk load a group of atributes into matlab. i have a list of these attributes and would like to be able to pass this and time range to a .NET/af SDK function if available

thanks in advance

- 1 person found this helpful
Hi John,

I haven't played with this utility but we do have a PI-to-MATLAB Utility that may be of use to you:

White Paper - Using the PI-to-MATLAB Utility.pdf

If this isn't applicable, check out this White Paper as well: White Paper - Using PI Data with MATLAB

Paul, thankyou for the quick response.

i have been using the utility and AF SDK and related functions which work well.

the latest version of the utility has the facility to import either individual tags/attributes or select/highlight multiple tags/attributes and import those (as a list) to the matlab workspace in one call. i'd like to be able to replicate this from matlab by passing a list of tags/attributes to the appropriate underlying SDK function just not sure which function is it.

best regards

The source code for this utility is available on GitHub: PI-to-MATLAB-Utility/AFAccess.cs at master · osisoft/PI-to-MATLAB-Utility · GitHub

The section specifically involved in data access is in the AFAccess.cs. It looks like the getData method (starting on line 163) has the majority of the logic. The line that specifically requests the information for an attribute is on 200, and PI points are on 225.

Hopefully this helps! If I misunderstood your question or you need more info, let me know.

Paul

thanks, and sorry for the late acknowledgement.

i was wondering if there was a function in the AF SDK that would bulk load attributes. basically was looking to optimize some code that loads 20 - 40 tags x 12 installations x 1hz x 1 - 90days

that said i've found that the method described in the white paper has the performance needed for the time being;

now my challenge is the ConvertAFValues function does not handle Ints or Digital tags for some reason. i've tried a few modifications trying to incorporate AFValuesToArray function (line 269) in the code you posted. however not being a C# guy i've not had much success.

anyway, thanks for your help

The source code for this utility is available on GitHub: PI-to-MATLAB-Utility/AFAccess.cs at master · osisoft/PI-to-MATLAB-Utility · GitHub

The section specifically involved in data access is in the AFAccess.cs. It looks like the getData method (starting on line 163) has the majority of the logic. The line that specifically requests the information for an attribute is on 200, and PI points are on 225.

Hopefully this helps! If I misunderstood your question or you need more info, let me know.