주요 콘텐츠

getChildren

Get all child elements of AF element

Since R2026a

    Description

    childElements = getChildren(elementObj) returns child elements of the AF element specified by elementObj.

    To get child attributes of a specific AF attribute, 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 element on the AF server using the AF element name.

    guElement = findElementByName(afclientObj,"GU2")
    guElement = 
    
      Element with properties:
                 Name: "GU2"
                 Path: "\\EVS-HydroPlant\OSIDemo_PG_HydroPlant\Flynn River Hydro\Flynn I\GU2"
             Database: "OSIDemo_PG_HydroPlant"
           Categories: ""
             Template: "GenerationUnit"
          Description: ""
          NumChildren: 2
        NumAttributes: 30

    Retrieve the child elements of the specified the AF element.

    childElements = getChildren(guElement)
    childElements = 
    
      1×2 Element array:
        Index      Name                                                 Path                                      NumChildren
        -----  -------------  ----------------------------------------------------------------------------------  -----------
          1    GU2 Generator  \\EVS-HydroPlant\OSIDemo_PG_HydroPlant\Flynn River Hydro\Flynn I\GU2\GU2 Generator       0
          2     GU2 Turbine    \\EVS-HydroPlant\OSIDemo_PG_HydroPlant\Flynn River Hydro\Flynn I\GU2\GU2 Turbine        0

    Input Arguments

    collapse all

    AF element, specified as an icomm.af.Element object. You can use findElementByName, findElementByPath, or findElementByTemplate to create an icomm.af.Element object or array of AF element objects.

    Output Arguments

    collapse all

    AF elements that are children of the input AF element, returned as an icomm.af.Element object or array of icomm.af.Element objects. For more information, see AF Element Properties.

    Version History

    Introduced in R2026a