Link Search Menu Expand Document

Engineering Scaling

Jul 19 2024 at 12:00 AM

  1. Overview
  2. Installation
  3. Example Options File
  4. Property Details

Overview

This performs an engineering scaling on the value.

\[V_{current} = Eng_{min} + {V_{raw}} \cdot \frac {Abs(Eng_{max} - Eng_{min})}{Abs(Raw_{max} - Raw_{min})}\]

Installation

The required NuGet Package for this function is: IoTnxt.Raptor.TransformManager

    .AddRaptorTransformManager("TransformSets", (services, configuration, builder) =>
    {
        builder.AddDefaultTransformationFunctions(services);
    })

Example Options File

{
  "TransformSets": {
    "Scale": {
      "F1":  {
        "Enabled": true,
        "FunctionType": "EngineeringScaling",
        "EngMin": 0,
        "EngMax": 250,
        "RawMin": 0,
        "RawMax": 10,
        "RestrictToRange":  true 
      }
    }
  } 
}

Property Details

Property NameDescription
FunctionTypeThe value for this function is “EngineeringScaling”.
EnabledSets whether this Transform Function is enabled. Defaults to true.
EngMinThe minimum value of the scaled value.
EngMaxThe maximum value of the scaled value.
RawMinThe minimum value of the raw value.
RawMaxThe maximum value of the raw value.
RestrictToRangeIf set to true, the raw value is restricted (clamped) to the raw range.