@flux-control/modbus-schema
    Preparing search index...

    Function makeScaledParam

    • Scaled parameter where wire = domain / factor.

      Decode validates through the optional domain schema so out-of-range values fail. Set readOnly to make encode fail with readOnlyEncodeFailure (monitor registers). Encoding rounds value / factor. Supply a finite, non-zero factor.

      Type Parameters

      Parameters

      • register: number

        Register address recorded in the schema description.

      • factor: number

        Multiplier applied during decode and inverted during encode.

      • meta: M

        Register description metadata.

      • Optionalopts: { readOnly?: boolean }

        Optional domain schema and read-only setting.

      Returns ParamEntry<decodeTo<Number, brand<Number, "UInt16">, never, never>, M>

      An entry whose decoded values pass through the selected domain schema.

    • Scaled parameter where wire = domain / factor.

      Decode validates through the optional domain schema so out-of-range values fail. Set readOnly to make encode fail with readOnlyEncodeFailure (monitor registers). Encoding rounds value / factor. Supply a finite, non-zero factor.

      Type Parameters

      Parameters

      • register: number

        Register address recorded in the schema description.

      • factor: number

        Multiplier applied during decode and inverted during encode.

      • meta: M

        Register description metadata.

      • opts: { domain: D; readOnly?: boolean }

        Optional domain schema and read-only setting.

      Returns ParamEntry<decodeTo<D, brand<Number, "UInt16">, never, never>, M>

      An entry whose decoded values pass through the selected domain schema.