主要内容

getChildren

Get all child attributes of AF attribute

Since R2026a

    Description

    childAttributes = getChildren(attributeObj) returns child attributes of the AF attribute specified by attributeObj.

    To get child elements of a specific AF element, use getChildren.

    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 II\GU4\GU4 Generator|Oil Level";
    guAttribute = findAttributeByPath(afclientObj,path)
    guAttribute = 
    
      Attribute with properties:
                     Name: "Oil Level"
                     Path: "\\EVS-HydroPlant\OSIDemo_PG_HydroPlant\Flynn River Hydro\Flynn II\GU4\GU4 Generator|Oil Level"
               Categories: "Mechanical Data;"
              Description: "Returns the actual Oil Level. Data generated randomly."
              ElementName: "GU4 Generator"
           ServerDataType: "Double"
              DefaultUnit: "liter"
               ReadAccess: 1
              WriteAccess: 0
        HasTimeSeriesData: 1

    Retrieve the child attributes of the specified attribute.

    guAttributes = getChildren(guAttribute)
    guAttributes = 
    
    1×8 Attribute array:
        Index   Name                                                  Path                                                      ServerDataType
        -----  -------  -----------------------------------------------------------------------------------------------------   --------------
          1    Target   \\EVS-HydroPlant\OSIDemo_PG_HydroPlant\Flynn River Hydro\Flynn II\GU4\GU4 Generator|Oil Level|Target        Double
          2    Tagname  \\EVS-HydroPlant\OSIDemo_PG_HydroPlant\Flynn River Hydro\Flynn II\GU4\GU4 Generator|Oil Level|Tagname       String
          3    Minimum  \\EVS-HydroPlant\OSIDemo_PG_HydroPlant\Flynn River Hydro\Flynn II\GU4\GU4 Generator|Oil Level|Minimum       Double
          4    Maximum  \\EVS-HydroPlant\OSIDemo_PG_HydroPlant\Flynn River Hydro\Flynn II\GU4\GU4 Generator|Oil Level|Maximum       Double
          5     LoLo    \\EVS-HydroPlant\OSIDemo_PG_HydroPlant\Flynn River Hydro\Flynn II\GU4\GU4 Generator|Oil Level|LoLo          Double
          6      Lo     \\EVS-HydroPlant\OSIDemo_PG_HydroPlant\Flynn River Hydro\Flynn II\GU4\GU4 Generator|Oil Level|Lo            Double
          7     HiHi    \\EVS-HydroPlant\OSIDemo_PG_HydroPlant\Flynn River Hydro\Flynn II\GU4\GU4 Generator|Oil Level|HiHi          Double
          8      Hi     \\EVS-HydroPlant\OSIDemo_PG_HydroPlant\Flynn River Hydro\Flynn II\GU4\GU4 Generator|Oil Level|Hi            Double

    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

    AF attributes that are children of the input 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