Main Content

listDatabases

List available databases in connected AF server

Since R2026a

    Description

    afDatabases = listDatabases(afclientObj) lists the databases available on the PI AF server 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")
    afclientObj = 
    
      Client with properties:
    
            ServerName: "EVS-Hydroplant"
                Domain: "EVS"
        ServerTimeZone: "UTC+05:30:00"
              Database: "PI-Test"

    Find the databases available on the server.

    databases = listDatabases(afclientObj)
    databases = 
    
      1×3 string array
    
        "Configuration"    "OSIDemo_PG_HydroPlant"    "PI-Test"

    Input Arguments

    collapse all

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

    Output Arguments

    collapse all

    Names of an AF databases available on the connected AF server, returned as a string or array of strings.

    Data Types: string

    Version History

    Introduced in R2026a