pamoja for TypeScript - v0.2.0
    Preparing search index...

    A Modbus device: a unit address and the four tables it serves, coils, discrete inputs, holding registers, and input registers, each holding only the addresses it was given.

    answer takes one RTU frame and returns the frame the device sends back, or null when it stays silent: the frame failed its CRC, is for another unit, or is a broadcast, whose write the device still carries out. A request it cannot serve is answered with the exception the specification gives.

    Index
    • get served(): number

      How many requests the device has carried out, broadcasts included and refusals not.

      Returns number

    • Answers one RTU frame, as the device on the line does, or returns null when it stays silent.

      Parameters

      • frame: Buffer

      Returns Buffer<ArrayBufferLike> | null

    • A coil's state, or null when the device has no coil there.

      Parameters

      • address: number

      Returns boolean | null

    • A discrete input's state, or null when the device has no input there.

      Parameters

      • address: number

      Returns boolean | null

    • A holding register's value, or null when the device has no register there.

      Parameters

      • address: number

      Returns number | null

    • An input register's value, or null when the device has no register there.

      Parameters

      • address: number

      Returns number | null

    • Sets coils from an address on, adding any the device did not have.

      Parameters

      • start: number
      • values: boolean[]

      Returns void

    • Sets discrete inputs from an address on, adding any the device did not have.

      Parameters

      • start: number
      • values: boolean[]

      Returns void

    • Sets holding registers from an address on, adding any the device did not have.

      Parameters

      • start: number
      • values: number[]

      Returns void

    • Sets input registers from an address on, adding any the device did not have.

      Parameters

      • start: number
      • values: number[]

      Returns void