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

    Class ModbusFrame

    A received frame whose CRC has been verified, which reads its own values.

    const reply = parseFrame(await port.read())
    if (reply.exception === null) console.log(reply.registers())
    Index
    • Wraps a parsed frame.

      Parameters

      • address: number

        The unit address.

      • functionCode: number

        The function code as it appeared on the wire.

      • exception: number | null

        The exception code, or null.

      • pdu: Buffer

        The protocol data unit.

      Returns modbus.ModbusFrame

    address: number

    The unit address the frame is addressed to or came from.

    exception: number | null

    The exception a device reported, or null when it served the request.

    functionCode: number

    The function code. An exception response carries the request's code with its high bit set, as it appeared on the wire.

    pdu: Buffer

    The protocol data unit: the function code and its data.

    • Reads the coils or discrete inputs out of a read-bits reply.

      Parameters

      • count: number

        How many bits to read, the quantity the request asked for.

      Returns boolean[]

      One state per coil, in order.

      If the reply does not carry that many bits.

    • Reads the 16-bit registers out of a read-registers reply.

      Returns number[]

      The registers, in order.

      If this is not a well-formed read-registers reply.