主要内容

findAttributeByPath

Find attributes by path in AF server

Since R2026a

    Description

    afAttributes = findAttributeByPath(afclientObj,attributePath) finds attributes in the AF server at the locations in the database hierarchy specified by attributePath.

    Note

    You must install the AF SDK library to connect to a PI AF server from MATLAB®. For more information, see AF SDK Overview.

    example

    Examples

    collapse all

    Create an AF client. The client is associated with the default database of the PI AF server.

    afclientObj = afclient("EVS-Hydroplant");

    Change the connection to a database that includes the required attributes.

    selectDatabase(afclientObj,"OSIDemo_PG_HydroPlant");

    Find an attribute in the AF server using specified path. The path describes a hierarchy of elements in the database leading to the desired attribute.

    path = "\\EVS-HydroPlant\OSIDemo_PG_HydroPlant\Flynn River Hydro\Flynn II\GU4\GU4 Turbine|Active Power";
    guAttribute = findAttributeByPath(afclientObj,path)
    guAttribute = 
    
      Attribute with properties:
                     Name: "Active Power"
                     Path: "\\EVS-HydroPlant\OSIDemo_PG_HydroPlant\Flynn River Hydro\Flynn II\GU4\GU4 Turbine|Active Power"
               Categories: "Electrical Data;"
              Description: "Active Power generated by the generation unit."
              ElementName: "GU4 Turbine"
           ServerDataType: "Double"
              DefaultUnit: "megawatt"
               ReadAccess: 1
              WriteAccess: 0
        HasTimeSeriesData: 1

    Input Arguments

    collapse all

    AF client, specified as an icomm.af.Client object created using the afclient function.

    Path of an AF attribute in an AF database, specified as a string, character vector, or string array.

    Data Types: char | string

    Output Arguments

    collapse all

    AF attribute, returned as an icomm.af.Attribute object or array of icomm.af.Attribute objects. For more information, see AF Attribute Properties.

    Version History

    Introduced in R2026a