Conversion Functions
Jump to navigation
Jump to search
Navigation: PGMs - Predefined Functions
Additional information:
- Declaring variables with conversion information
- Conversion List Table for a list of available conversion families
Conversion Functions
Cnv
Syntax:
variable = Cnv(variable1, unit)
- The Cnv function converts variable1 to the conversion units specified by unit and returns the result. Conversion information must have been specified for variable1. An expression cannot be used instead of supplying variable1.
- The unit must be a valid conversion unit belonging to the conversion family for variable1.
- The conversion units ARE case sensitive.
Example:
Real len("L","m")*, d{r, Cnv("Qm", "kg/s")}, r1@, r2@
d = ["P_11.Qm (kg/s)"]
r1 = Cnv(len, "ft")
r2 = Cnv(d, "t/h")
CnvVal
Syntax:
variable = CnvVal(variable1, family, unit, ReqdUnit)
- The CnvVal function converts variable1 from the conversion units specified by unit to the conversion units specified by ReqdUnit for the specified conversion family and returns the result.
- The unit and ReqdUnit must be a valid conversion unit belonging to the specified conversion family.
- The conversion family and conversion units ARE case sensitive.
Example:
Real len, d1, d2, r1@, r2@
d1 = ["P_011.Qm (kg/s)"]
d2 = ["P_012.Qm (kg/s)"]
r1 = CnvVal(len, "L", "m", "ft")
r2 = CnvVal(d1 + d2, "Qm", "kg/s", "t/h")