AltUomCachedParamDouble

You can use the AltUomCachedParamDouble function in the Optiva Alternate Unit of Measure (Alt UOM) equations to improve performance by caching Technical Parameter (TP) values during unit conversion processes.

This function increases performance by caching a TP value during the conversion process, allowing all UOM equations to have a common cached value instead of retrieving it multiple times. This is particularly useful when multiple UOM conversions need the same TP value.

When to use

You can use this function when the Alt UOM conversion equations need to access TP values like density, viscosity, or temperature.

When not to use

You cannot use this function for:

  • The non-numeric technical parameters, text or date. This function only works with numeric TPs.
  • The TPs not listed in the ALTUOMGLOBALTPVARS profile attribute.
Note:  An error "ParamCode/ValueType not configured" is displayed.

Syntax

double? AltUomCachedParamDouble(string ParamName);
double? AltUomCachedParamDouble(string ParamName, string ValueType);

Parameters

Parameter Type Required Description
ParamName string Optional The name or code of the TP to retrieve. Possible values: TP code (for example, "DENSITY", "VISCOSITY", "TEMP")
Note: The value must be numeric and configured in the ALTUOMGLOBALTPVARS profile attribute.
ValueType string Optional Specifies the value type to retrieve from the Possible Values:
  • "PVALUE"
  • "MINVAL",
  • "MAXVAL",
  • "TARGET"
Note: By default, the value is the "PVALUE" if not specified.

Return Value

The application returns the TP value as a .NET Nullable Double data type.

  • Allows handling of TPs that don't have a value.
  • Strongly typed as Double (no string-to-double conversion needed).
  • Returns null if the TP has no value.

Prerequisites

You must configure the ALTUOMGLOBALTPVARS profile attribute with the list of TP codes that can be cached and used with this function.

Examples

This retrieves the primary value (PVALUE) of the cached "DENSITY" technical parameter and stores it as a nullable double.

Note: The nullable type allows handling cases where the density parameter has no value set.
double? dDensity = AltUomCachedParamDouble("DENSITY", "PVALUE");