主要内容

getParent

Get parent attribute of AF attribute

Since R2026a

    Description

    parentAttribute = getParent(attributeObj) returns the parent attribute of the AF attribute specified by attributeObj.

    To get parent element of a specific AF element, use getParent.

    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");

    Find an attribute on the AF server using the AF database path of the attribute.

    aPath = "\\EVS-HydroPlant\OSIDemo_PG_HydroPlant\Flynn River Hydro\Flynn I\GU1\GU1 Generator|Active Power|Minimum";
    guAttribute = findAttributeByPath(afclientObj,aPath)
    guAttribute = 
    
      Attribute with properties:
                     Name: "Minimum"
                     Path: "\\EVS-HydroPlant\OSIDemo_PG_HydroPlant\Flynn River Hydro\Flynn I\GU1\GU1 Generator|Active Power|Minimum"
               Categories: ""
              Description: ""
              ElementName: "GU1 Generator"
           ServerDataType: "Double"
              DefaultUnit: "megawatt"
               ReadAccess: 1
              WriteAccess: 0
        HasTimeSeriesData: 0

    Retrieve parent attribute of the specified the AF attribute.

    parentAttribute = getParent(guAttribute)
    parentAttribute = 
    
     Attribute with properties:
                     Name: "Active Power"
                     Path: "\\EVS-HydroPlant\OSIDemo_PG_HydroPlant\Flynn River Hydro\Flynn I\GU1\GU1 Generator|Active Power"
               Categories: "Electrical Data;"
              Description: "Active Power generated by the generation unit."
              ElementName: "GU1 Generator"
           ServerDataType: "Double"
              DefaultUnit: "megawatt"
               ReadAccess: 1
              WriteAccess: 0
        HasTimeSeriesData: 1

    Input Arguments

    collapse all

    AF attribute, specified as an icomm.af.Attribute object. You can create attribute object using functions like getAttributes or findAttributeByPath. Or, you can use the Asset Framework Browser to graphically browse the AF database, and then select an attribute to create an icomm.af.Attribute object.

    Output Arguments

    collapse all

    Parent attribute of the input AF attribute, returned as an icomm.af.Attribute object. For more information, see AF Attribute Properties.

    Version History

    Introduced in R2026a