主要内容

getRootElements

Get root elements of AF database

Since R2026a

    Description

    rootElements = getRootElements(afclientObj) returns the root elements of the AF database connected to the AF client specified by afclientObj.

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

    Get root elements of the AF database.

    rootelements = getRootElements(afclientObj)
    rootelements = 
    
      1×2 Element array:
        Index        Name                             Path                                   NumChildren
        -----  -----------------  --------------------------------------------------------  -----------
          1    Flynn River Hydro  \\EVS-Hydroplant\OSIDemo_PG_HydroPlant\Flynn River Hydro        2
          2     PI Data Archive   \\EVS-Hydroplant\OSIDemo_PG_HydroPlant\PI Data Archive          0 
    

    Input Arguments

    collapse all

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

    Output Arguments

    collapse all

    AF elements in the root level of the AF database, returned as an array of icomm.af.Element objects. For more information, see AF Element Properties.

    Version History

    Introduced in R2026a