3 Replies Latest reply on Nov 25, 2014 8:23 PM by Bhess

    PI Web API - PI Point or Attribute UOM

    jorgewong

      Hello,

       

      I'm trying to return the UOM for an attribute and also for a PI Point.  I would assume that the "Default UOM" value should be returned in the Units Abbreviation field for attributes and when you search for a PI point it would return the engUnits value.  I'm not able to see either one when I query against the Web API.  Are these two assumptions correct?

       

       

       

      Thanks,
      Jorge 

        • Re: PI Web API - PI Point or Attribute UOM
          awoodall

          Hi Jorge,

           

          I'll copy a portion of the Web API help from the streams/{webId}/value resource that seems to help clarify expected behavior:

           

          The name or abbreviation of the desired units of measure for the returned value, as found in the UOM database associated with the attribute. If not specified for an attribute, the attribute's default unit of measure is used. If the underlying stream is a point, this value may not be specified, as points are not associated with a unit of measure.

           

          So it seems like for points the engunits field can't be returned because its not an AF UOM. However I would expect the attribute default UOM should at least be returned. Does the attributes resource when queried for the attribute webId show the default UOM there? What happens if you specify a desired units in the querystring?

           

          Thanks,

           

          Arnold

            • Re: PI Web API - PI Point or Attribute UOM
              jorgewong

              Hi Arnold,

               

              Thanks for the information.  Looks like it works when I pull it from an AF attribute pull up.  Even without having the desired units in the query string.

               

              Any clues as to how I would be able to retrieve a type for a value?  String vs. integer, etc.

                • Re: PI Web API - PI Point or Attribute UOM
                  Bhess

                  Hi Jorge,

                   

                  Unfortunately those values aren't present in PI Web API 2014 R2.

                   

                  The data type of an AF Attribute will be exposed in PI Web API 2015.

                   

                  In addition, PI Point Attributes including point type and engineering units will be exposed in PI Web API 2015.

                   

                  A CTP of PI Web API 2015 will be available on vCampus shortly.

                   

                  Hope this helps,

                   

                  Brad