4 Replies Latest reply on Oct 12, 2016 8:42 AM by Roger Palmen

    PIputval with engineering unit

    MFuad

      I have been trying to write a macro in Excel for manual input data, by using Piputval with AF attributes as data reference.  So far all is working well, but im wondering, is there a way that I can pass another argument with Piputval, for the engineering unit?  I would like the user to have an option to enter data with engineering unit, and AF will handle the conversion on storing the data to PI back.

       

       

      Would it be possible to pass the engineering unit?

        • Re: PIputval with engineering unit
          Roger Palmen

          The PiPutVal does not support providing an UOM. Best option i can think of is creating the UOM-logic in the Excel-client. To prevent a requirement to maintain UOM conversions in Excel, you could create a number of sub-attributes for each UOM you need to support and select the appropriate attribute to write to in Excel based on the user selected UOM.

            • Re: PIputval with engineering unit
              MFuad

              Thanks Roger. Does this mean i should have different attributes for each UOM that user can choose to key in?

                • Re: PIputval with engineering unit
                  Roger Palmen

                  The approach i have used before where i needed multiple UOM's for the same value is something like this:

                  • Attribute temperature, UOM degree celcius, Pi Point.
                  • Child attribute temperature_F, UOM degree fahrenheit, PI point referring to attribute temperature
                  • Child attribute temperature_K, UOM degree kelvin, PI Point referring to attribute temperature

                  Now you have attributes for different UOMs and you only need to link the parent attribute to the PI Point, as the child attributes refer to the parent attribute.

                  If you need to write, set readonly to false for each of the attributes.

                  1 of 1 people found this helpful
                • Re: PIputval with engineering unit
                  wpribula

                  Hello Roger,

                  I was thinking about my new case with Fuad and found your response for the same issue here on PI Square. Thank you for this. This is very good solution.

                  I am just thinking how to put these values from sub-attributes to the parent attribute. Some analysis with UOM conversion (Convert() function) could be solution.