cabat / mudbus Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/mudbus
Automatically exported from code.google.com/p/mudbus
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 [email protected]
on 21 Aug 2012 at 12:15
FC=0x0f
reads only multiples of 8bits from received packet. If you try to set
any other number of coils, rest will be set to 0.
What steps will reproduce the problem?
1. write 111 to 3 coils starting from address XY
library will set 8 coils starting from address XY to 1110 0000
2. write 1111 1111 1 to 9 coils starting from address XY
library will set 16 coils starting from address XY to 1111 1111 1000 0000
What version of the product are you using? On what operating system?
1.0
Original issue reported on code.google.com by [email protected]
on 21 Aug 2012 at 12:47
I noticed an error in your library. Line 137 should be MessageLength = 12;
I was getting an error when writing to coils as the response was incorrect.
Original issue reported on code.google.com by [email protected]
on 6 Apr 2015 at 4:34
It appears that the library is leaking connection objects, leading to the
eventual grind to a halt of the Arduino, which can only be fixed by a reboot.
I have a proposed solution, but I can't test it because I don't have modbus
here. The colleague I researched this for does, but it will be a while before
he returns to his home country to test it and tell me how it went. I wrote this
based on the Arduino documentation, which says this: "The connection persists
when the returned client object goes out of scope; you can close it by calling
client.stop()."
Proposed solution:
diff --git a/Mudbus/Mudbus.cpp b/Mudbus/Mudbus.cpp
index 5c5356c..9340b02 100755
--- a/Mudbus/Mudbus.cpp
+++ b/Mudbus/Mudbus.cpp
@@ -36,6 +36,11 @@ void Mudbus::Run()
// Client client = MbServer.available();
// For Arduino 1.0
EthernetClient client = MbServer.available();
+ if(!client.connected())
+ {
+ client.stop();
+ return;
+ }
if(client.available())
{
Reads = 1 + Reads * (Reads < 999);
Original issue reported on code.google.com by [email protected]
on 18 Sep 2014 at 4:02
What steps will reproduce the problem?
1. mudbus dont send or receive data in pro mini board / w5100
2. tcp/ip working perfectly
3. ping and web works too
What is the expected output? What do you see instead?
What version of the product are you using? On what operating system?
1.02
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 16 Jan 2015 at 11:22
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.