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

    Function makeSignedScaledParam

    • Signed scaled parameter where wire = domain / factor, using UInt16 as the wire-side schema with two's-complement conversion (Modbus delivers unsigned 16-bit values). Decode validates through the optional domain. Encode fails when value / factor rounds to a word outside -32768..32767. Supply a finite, non-zero factor. The factory does not validate it.

      Type Parameters

      Parameters

      • register: number
      • factor: number
      • meta: M
      • Optionalopts: { readOnly?: boolean }

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

    • Signed scaled parameter where wire = domain / factor, using UInt16 as the wire-side schema with two's-complement conversion (Modbus delivers unsigned 16-bit values). Decode validates through the optional domain. Encode fails when value / factor rounds to a word outside -32768..32767. Supply a finite, non-zero factor. The factory does not validate it.

      Type Parameters

      Parameters

      • register: number
      • factor: number
      • meta: M
      • opts: { domain: D; readOnly?: boolean }

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