Skip to content

Fix BinaryPayloadBuilder/Decoder #283

@dhoomakethu

Description

@dhoomakethu

Versions

  • Python: 2.7-3
  • OS: NA
  • Pymodbus: 1.4.0
  • Modbus Hardware (if used): NA

Pymodbus Specific

  • Server: tcp/rtu/ascii - sync/async
  • Client: tcp/rtu/ascii - sync/async

Description

Modbus Payload Server with datablocks built using BinaryPayloadBuilder does not store data in correct register order

reported by @bosnj on gitter

Code and Logs

 # code and logs here.
builder = BinaryPayloadBuilder(byteorder=Endian.Little, wordorder=Endian.Little)
builder.add_32bit_uint(500046)
decoder = BinaryPayloadDecoder.fromRegisters(builder.to_registers(), wordorder=Endian.Little, byteorder=Endian.Little)
decoder.decode_32bit_uint()
>>> 117460641

simple_sim.py
simple_client.py

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions