Code Monkey home page Code Monkey logo

mudbus's People

Contributors

deewykoff avatar

Watchers

 avatar

mudbus's Issues

corrupted responce for FC=05

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

"write multiple coils" interprets received packet wrong

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

mubbus.cpp bugfix

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

Client connections leaked

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

Arduino pro mini problem

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.