Skip to content

Deterministic usage not implemented #1

@rubimat

Description

@rubimat

I tried using the modbus_rtu library to communicate with some motors. I wanted to use it the way described in your README. However the functions holding_register_* seem only to be virtual functions yet. Maybe I have overlooked something.

I tried to use the provided service call API and the read seems to work or at least I am getting a response back. However the holding_register_write and the holding_register_write_multiple do not seem to work. Is it also because it is not implemented yet? At least I saw a comment on the last line of this README.

It would be nice to at least mention if it is implemented or not in the main README. Some more details on the API and on the code structure would also help to understand the code better. If the project is still running I would be interested in taking a look at it and contribute to it.

Thank you and keep up the good work!

Here is the stderr output when I tried to implement the deterministic way;

---- stderr: rl2_driver                              
/rl2_ws/src/rl2_driver/src/modbus_driver.cpp: In member function ‘bool ModbusDriver::initialize()’:
/rl2_ws/src/rl2_driver/src/modbus_driver.cpp:16:41: error: ‘virtual void remote_modbus::Implementation::holding_register_read(std::shared_ptr<remote_modbus::srv::HoldingRegisterRead_Request_<std::allocator<void> > >, std::shared_ptr<remote_modbus::srv::HoldingRegisterRead_Response_<std::allocator<void> > >)’ is private within this context
   16 |   modbus_rtu_impl->holding_register_read(req, res);
      |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
In file included from /rl2_ws/install/remote_modbus_rtu/include/remote_modbus_rtu/implementation.hpp:19,
                 from /rl2_ws/src/rl2_driver/include/rl2_driver/modbus_driver.hpp:8,
                 from /rl2_ws/src/rl2_driver/src/modbus_driver.cpp:1:
/rl2_ws/install/remote_modbus/include/remote_modbus/implementation.hpp:126:16: note: declared private here
  126 |   virtual void holding_register_read(
      |                ^~~~~~~~~~~~~~~~~~~~~
/rl2_ws/src/rl2_driver/src/modbus_driver.cpp:17:1: warning: no return statement in function returning non-void [-Wreturn-type]
   17 | }
      | ^
gmake[2]: *** [CMakeFiles/modbus_driver.dir/build.make:76: CMakeFiles/modbus_driver.dir/src/modbus_driver.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:165: CMakeFiles/modbus_driver.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2
---
Failed   <<< rl2_driver [6.50s, exited with code 2]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions