davidLin7692 / pymodbus

Automatically exported from code.google.com/p/pymodbus
0 stars 0 forks source link

WriteMultipleCoilsRequest fails when decoding a message #27

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I am using the current version checked out from SVN.

The decode method of WriteMultipleCoilsRequest seems to be
broken - or at least radically different from the other
decode methods.

Here is the relevant part of this message:

  self.address, count = struct.pack('>HH', data[0:2])
  coils, self.byte_count = unpackBitsFromString(data[2:])

All other decode methods use the function struct.unpack.
Furthermore, unpacking two bytes will not work with the
format ">HH" - it expects four bytes.

Do I miss something here?

Best regards,

Albert

Original issue reported on code.google.com by albert.k...@gmail.com on 11 Jan 2011 at 2:56

GoogleCodeExporter commented 9 years ago
No, you are right, When I originally wrote that my company only needed a 
specific message sent. Give me a second and I will fix it and test it against 
the reference I have.

Original comment by Bashw...@gmail.com on 11 Jan 2011 at 8:13

GoogleCodeExporter commented 9 years ago

Original comment by Bashw...@gmail.com on 11 Jan 2011 at 8:16

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r81.

Original comment by Bashw...@gmail.com on 11 Jan 2011 at 8:51