Skip to content

Point Value Conversions

Conversions are reusable value transforms applied on the read path. Raw timeseries values are always preserved in storage; the conversion is applied when data is returned via GetData, GetPoints, GetDataSummary, and ObserveDataUpdates.

This is conceptually similar to the read-path conversions available in Niagara: the underlying device supplies a raw number, and a configurable transform produces the engineering-unit value that clients see.

Conversion Steps

A conversion is an ordered list of steps. Each step transforms the value and passes the result to the next step. Three step types are supported:

Type Effect
Linear result = raw * scale + offset. Use for unit conversions (e.g. scale=1.8, offset=32 for C → F).
Boolean Inversion Flips 0 ↔ 1 for digital points that report inverted logic.
JavaScript Runs a user-defined convert(value) function. Compiled once and pooled; each invocation is bounded to 20 ms.

If any step errors (including JS runtime errors, timeouts, or NaN/Inf results), the chain returns the raw value unchanged and logs a warning.

Applying a Conversion

Conversions are reusable: create the definition once and reference it by ID from any number of points. Set the conversion_id field on a Point to apply it.

From the admin console, use Set Conversion in the Object Explorer context menu to apply or clear a conversion on selected points. The standalone Conversions page under Admin manages the definitions themselves.

Via API:

curl -X POST $NFURL/api/v1/point/conversions \
  -H "Content-Type: application/json" \
  -d '{
    "conversion": {
      "id": "c-to-f",
      "name": "Celsius to Fahrenheit",
      "steps": [
        {"linear": {"scale": 1.8, "offset": 32}}
      ]
    }
  }'
curl -X PATCH $NFURL/api/v1/point \
  -H "Content-Type: application/json" \
  -d '{
    "point": {"uuid": "<point-uuid>", "conversion_id": "c-to-f"},
    "field_mask": "conversion_id"
  }'

JavaScript Conversions

A JS conversion must define a top-level convert(value) function that returns a number.

function convert(value) {
    // piecewise linearization of a thermistor
    if (value < 0.5) return value * 100;
    return value * 110 - 5;
}

The program is compiled once per conversion ID and reused across invocations from a pool of Goja VMs.

MCP

Claude and other MCP clients can manage conversions through the manage_conversions tool: list, get, create, update, delete, apply, and remove.

Notes

  • Updating a conversion definition affects all points that reference it; they will see the new transform on their next read.
  • Deleting a conversion clears conversion_id on any points that were using it.
  • Raw values are retained in the timeseries, so removing or changing a conversion never loses data.