Convert
- Last UpdatedJan 11, 2023
- 1 minute read
- PI System
- PI Server 2024 R2
- PI Server
Convert a value from its current unit of measure (UOM) to a specified UOM; for a value with no UOM, assign the specified UOM.
Syntax
Convert(x, toUnit)
Arguments
-
x
Any expression that resolves to a numeric value, including the name of a numeric attribute enclosed in single quotation marks, a variable name, or a constant value
-
toUnit
The output UOM enclosed in double quotation marks
Returns
The numeric value converted to the specified UOM
Exceptions
Returns an error if toUnit and the initial UOM for x are not in the same UOM class
Example
-
Convert('MetricWeight', "lb")
-
Convert('Ambient Temperature', "degC")
Note: PI AF substitutes with , if not otherwise found in the lookup.