Giter Site home page Giter Site logo

Comments (7)

why-you-trust-me avatar why-you-trust-me commented on August 11, 2024

How to solve this problem, 0x10 function can't work.

from modbuspp.

konsolenritter avatar konsolenritter commented on August 11, 2024

Sorry, i'm to shy or too stupid to get a commit or pull request inserted into this github thing. :-(

To be short you have to (at least, there are other pitfalls) patch line #134 in the modbus.cpp where something like "(5 + 2 * amount)" resembles. You should change it to "(7 + 2 * amount)" to correct for the right value going to the length coding field. So the receivers will read the (otherwise missed) last register (word=2 byte).

I hope that this will be clear enough, sorry for my bad english skills. There are other pitfalls regarding timeouts, exceptions and so on. I develop them further sometimes. Don't know why fanzhe doesn't open that project for others to participate or if it would be correct (in the terms of the license) to do just a spinoff in my own github account. Sorry, i'm totally newb to github. A little bit frustrating for a developer who is used to have the full control over a projects code...

from modbuspp.

konsolenritter avatar konsolenritter commented on August 11, 2024

How to solve this problem, 0x10 function can't work.

What exactly is your question? What do you mean with "can't work"? Do you meant "don't work in the moment" instead?

from modbuspp.

facundo2912 avatar facundo2912 commented on August 11, 2024

with the above said when replacing the 5 with the 7 can already be written in multiple registers, but the illegal data problem continues when writing in multiple coils

from modbuspp.

konsolenritter avatar konsolenritter commented on August 11, 2024

Regarding the "writing multiple coils" fc (0x0F) they could be fixed by commit konsolenritter@3318c0b as of my fork.

from modbuspp.

fz-lyu avatar fz-lyu commented on August 11, 2024

@konsolenritter 's fix should be correct, I referenced his solution and update my code

from modbuspp.

fz-lyu avatar fz-lyu commented on August 11, 2024

@konsolenritter Thank you for your solution. For opening the projects you mentioned, the way github works is that you make a fork, and create a pull request to my repo. Directly pushing code to other people's repo is usually a dangerous behavior.

Thank you again for the fix.

from modbuspp.

Related Issues (13)

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.