Hello,

I am working in PI System Explorer 2015r2. I am trying to find a way to pull the units from an attribute. I want to be able to use the units of one attribute in a formula of another attribute, such as, IF attribute1_units=kW, then attribute1*1000. Is there a function or operator that can accomplish this? I think it would be easier to accomplish in an analysis rather than a formula, but haven't been able to figure out a way. I appreciate any help or suggestions.

Thank you!

Hi Jade,

Not exactly possible with Analyses. Sure there is the TagEU function, but it returns the EngUnits of an attribute's underlying PI point, which doesn't have to match the attribute's DefaultUOM. The safer route would be to grab the UOM from the AFValue, but I am unaware of an Analyses function that does that.

It is possible with the Formula DR only if each respective parameter for each template belongs to the same UOMClass. Its okay if attribute1 on template1 uses kW and attribute1 on template2 uses W since they belong to the same UOMClass of Power. Still okay if attribute2 on template1 is kA and attribute2 on template2 is A since both belong to UOMClass Electrical Current. Just be sure that all incoming respective parameters are assigned the same respective UOM to be used in your formula conversion. Then assign the appropriate output UOM.

The other alternative is a Custom Data Reference where incoming AFValues all have a UOM property that you may inspect.