주요 콘텐츠

listSupportedUnits

List supported units for AF attribute

Since R2026a

    Description

    units = listSupportedUnits(attributeObj) lists the units supported for the AF attribute specified by attributeObj.

    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 specified path.

    path = "\\EVS-HydroPlant\OSIDemo_PG_HydroPlant\Flynn River Hydro\Flynn I\GU1\GU1 Generator|Lubricant Oil Pressure";
    guAttribute = findAttributeByPath(afclientObj,path)
    guAttribute = 
    
      Attribute with properties:
                     Name: "Lubricant Oil Pressure"
                     Path: "\\EVS-HydroPlant\OSIDemo_PG_HydroPlant\Flynn River Hydro\Flynn I\GU1\GU1 Generator|Lubricant Oil Pressure"
               Categories: "Mechanical Data;"
              Description: "Returns the actual Lubricant Oil Pressure. Data generated randomly."
              ElementName: "GU1 Generator"
           ServerDataType: "Double"
              DefaultUnit: "bar"
               ReadAccess: 1
              WriteAccess: 0
        HasTimeSeriesData: 1

    Find the supported units for the specified AF attribute.

    units = listSupportedUnits(guAttribute)
    units = 
    
      6×1 string array
    
        "pascal"    
        "atmosphere"    
        "bar"      
        "kilogram-force per square centimeter"
        "kilogram-force per square meter"   
        "torr"

    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

    Units of measure supported for the input AF attribute, returned as a string or array of strings.

    Version History

    Introduced in R2026a