Giter VIP home page Giter VIP logo

modbus's People

Contributors

mazurel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

modbus's Issues

Response Generation Quantity Issue

When parsing a request to generate a read coils response, the number of inputs is not parsed correctly. The bytes value should be a uint16_t instead of uint8_t. The standard requires 0x0000-0xFFFF. Currently, if you're value is 0x0000-0x00FF, you won't generate any value bytes.

uint8_t bytes;
switch (_functionCode) {
case utils::ReadDiscreteOutputCoils:
case utils::ReadDiscreteInputContacts:
bytes = inputData[2];

You'll also need to change the value to be read:

uint16_t bytes; 
  
switch (_functionCode) { 
    case utils::ReadDiscreteOutputCoils: 
    case utils::ReadDiscreteInputContacts: 
    bytes = inputData[2] << 8 + inputData[3]; 

Exception on creating dummy (empty) ModbusRequest

If I create an ModbusRequest without any values, it uses the ctor with default values. There is a switch statement and a valid function code value is required, so exception will be thrown

switch (functionRegisters()) { case utils::OutputCoils: ...

Baudrate Failure

Hi, Mazurel. I have been trying to use your modbus library for a RTU project. It seems like a nice implementation and it supports CMake which I appreciate. I have hocked the RTU Service up to a Osciloscope and your baudrates aren't working properly. It probably has something to do with the:
cfsetospeed(&_termios, speed);
cfsetispeed(&_termios, speed);
functions in setBaudRate. I would solve it myself, but I'm not proficient with the Linux Api calls. Thanks for providing anyhow.
Best regards

FATAL Error: poll.h: No such file or directory

When adding this library to my project like described in the Readme.md, i get the following error.

In file included from /home/bumblebee/dev/optimal-sensor/lib/Modbus/src/Serial/connection.cpp:5:
/home/bumblebee/dev/optimal-sensor/lib/Modbus/include/MB/Serial/connection.hpp:15:10: fatal error: poll.h: No such file or directory
15 | #include <poll.h>

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.