Code Monkey home page Code Monkey logo

Comments (4)

bashwork avatar bashwork commented on August 17, 2024

Edke, thanks I have been meaning to rewrite the framer code for a while now and I have started on that front. Right now I changed to using a state machine that I hope I can make generic and much more performant that the standard code. Here is my initial commit if you would like to test and see if this solves your problem or if you have anything you can comment on (note it is on branch framer-fix):

1a160e8

from pymodbus.

roberthdevries avatar roberthdevries commented on August 17, 2024

There is a small typo on line 150 of transaction.py

After this fix, handling a server that went away gave an exception when trying to communicate.
(with the old version None is returned, not what I expect)

Here is the patch:

diff --git a/pymodbus/transaction.py b/pymodbus/transaction.py
index 4000f65..b2040c3 100644
--- a/pymodbus/transaction.py
+++ b/pymodbus/transaction.py
@@ -147,7 +147,7 @@ class ModbusTransactionManager(object):
             # the current frame and alert the application code
             # that there was an error.
             elif self.state == FramerState.ErrorInFrame:
-                _logger.debug("entering error state: %d:%s", len(self.framer._buffer, self.framer._header))
+                _logger.debug("entering error state: %d:%s", len(self.framer._buffer), self.framer._header)
                 self.framer.resetFrame()
                 return False

from pymodbus.

bashwork avatar bashwork commented on August 17, 2024

Ah, good find. I'll patch this asap.
On Feb 10, 2015 8:33 AM, "roberthdevries" [email protected] wrote:

There is a small typo on line 150 of transaction.py

Here is the patch:
diff --git a/pymodbus/transaction.py b/pymodbus/transaction.py
index 4000f65..b2040c3 100644
--- a/pymodbus/transaction.py
+++ b/pymodbus/transaction.py
@@ -147,7 +147,7 @@ class ModbusTransactionManager(object):

the current frame and alert the application code

that there was an error.

elif self.state == FramerState.ErrorInFrame:

  • _logger.debug("entering error state: %d:%s",
    len(self.framer._buffer, self.framer._header))
  • _logger.debug("entering error state: %d:%s",
    len(self.framer._buffer), self.framer._header) self.framer.resetFrame()
    return False


Reply to this email directly or view it on GitHub
#28 (comment).

from pymodbus.

dhoomakethu avatar dhoomakethu commented on August 17, 2024

This should be fixed with pymodbus v1.5.0 and above (sync client)

from pymodbus.

Related Issues (20)

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.