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.
Thanks Roger. Does this mean i should have different attributes for each UOM that user can choose to key in?
1 of 1 people found this helpful
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.
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.