주요 콘텐츠

findElementByTemplate

Find elements by template on AF server

Since R2026a

    Description

    afElements = findElementByTemplate(afclientObj,templateName) finds elements on the AF server that are constructed from the template specified in templateName.

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

    Change the connection to a database that includes the required elements.

    selectDatabase(afclientObj,"OSIDemo_PG_HydroPlant");

    Find elements in the AF server that are constructed using Generator template.

    guElements = findElementByTemplate(afclientObj,"Generator")
    guElements = 
    
      1×4 Element array:
        Index      Name                                            Path                                            NumChildren
        -----  -------------  -----------------------------------------------------------------------------------  -----------
          1    GU1 Generator  \\EVS-HydroPlant\OSIDemo_PG_HydroPlant\Flynn River Hydro\Flynn I\GU1\GU1 Generator        0
          2    GU2 Generator  \\EVS-HydroPlant\OSIDemo_PG_HydroPlant\Flynn River Hydro\Flynn I\GU2\GU2 Generator        0
          3    GU3 Generator  \\EVS-HydroPlant\OSIDemo_PG_HydroPlant\Flynn River Hydro\Flynn II\GU3\GU3 Generator       0
          4    GU4 Generator  \\EVS-HydroPlant\OSIDemo_PG_HydroPlant\Flynn River Hydro\Flynn II\GU4\GU4 Generator       0

    Input Arguments

    collapse all

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

    Name of an AF element template, specified as a string or character vector. An element template is a reusable blueprint that defines structure, attributes, and behavior for similar assets.

    Data Types: char | string

    Output Arguments

    collapse all

    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