luizcantoni / mudbus

Automatically exported from code.google.com/p/mudbus
16 stars 17 forks source link

corrupted responce for FC=05 #1

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. Send "Write single coil" request (FC=03)

What is the expected output? What do you see instead?

The coil gets written, but the response packet is corrupted.
See p.17-18 of http://www.modbus.org/docs/Modbus_Application_Protocol_V1_1b.pdf 
Expected response:
Function code (1 Byte) 0x05
Output Address (2 Bytes) 0x0000 to 0xFFFF
Output Value (2 Bytes) 0x0000 or 0xFF00
Actual response:
Function code (1 Byte) 0x05
nothing else.

What version of the product are you using? On what operating system?
v1.0

Please provide any additional information below.

Fix (lines 136-137 of Mudbus.cpp):
    ByteArray[5] = 6; //Number of bytes after this one.
    MessageLength = 12;

Original issue reported on code.google.com by ant....@gmail.com on 21 Aug 2012 at 12:15

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. Send "Write single coil" request (FC=05)

Of course it's FC=05

Original comment by ant....@gmail.com on 21 Aug 2012 at 12:16

GoogleCodeExporter commented 9 years ago
I had to make the same fix in my code. When will this be fixed here?

Original comment by dunners...@gmail.com on 6 Apr 2015 at 4:37