メインコンテンツ

getElement

Get parent element of AF attribute

Since R2026a

    Description

    parentElement = getElement(attributeObj) returns the parent element owning the AF attribute specified by attributeObj.

    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.

    path = "\\EVS-HydroPlant\OSIDemo_PG_HydroPlant\Flynn River Hydro\Flynn I\GU1\GU1 Generator|Active Power|Minimum";
    guAttribute = findAttributeByPath(afclientObj,path)
    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.

    parentElement = getElement(guAttribute)
    parentElement = 
    
     Element with properties:
                 Name: "GU1 Generator"
                 Path: "\\EVS-HydroPlant\OSIDemo_PG_HydroPlant\Flynn River Hydro\Flynn I\GU1\GU1 Generator"
             Database: "OSIDemo_PG_HydroPlant"
           Categories: ""
             Template: "Generator"
          Description: ""
          NumChildren: 0
        NumAttributes: 53

    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 element of the input AF attribute, returned as an icomm.af.Element object. For more information, see AF Element Properties.

    Version History

    Introduced in R2026a