-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modbus RTU library #36
Comments
Hello, thank you for the note about the potentialy dangerous code. But we have just taken some existing Modbus RTU library and prepared an example how to use it. The main reason is just to demonstrate that the CONTROLLINO is ready for the Modbus RTU from the hardware point of view. For sure it is not a software solution to be directly used for some industrial application. |
Hi, I finally succeed in using a Controllino MEGA as SLAVE, i'm checking it with QModMaster with a USB-RS485 interface. After trying to implement the Controllino_RS485_pins on different libraries I ended up with this one. The changes I've made are all in the modbusSlave.cpp, modbusSlave.cpp.zip:
The working arduino code is the following: https://gist.github.com/paolocavagnolo/e3c50ca65e479a7f72b06fcc18a16e36 Tested in both read coil and write coil. **** FEW DAYS LATER *** After some tests I didn't like that library very much, so I returned back to "ArduinoMODBUS" and just edited the last line of RS485.cpp by substituting with:
As explained here Now I'm totally satisfied! (always testing it with QModMaster) |
Hi Paolo, well done! 👍 Thank you very much for sharing this! 👏 Lukas |
Hi Controllino Team, Would be great, if you can provide a working Modbus library for master and slave for Controllino. |
Hi @CONTROLLINO-Support @MosiMiso @paolocavagnolo , I will also like to use the controllino MEGA as a Master to communicate with a frequency inverter. |
Hi @CONTROLLINO-Support @MosiMiso @paolocavagnolo , What do you think of this libary? |
I would like to implement a control over several Modbus RTU modules in Controllino.
This repository gives some examples, but they are somewhat outdated and even dangerous. For example, the following code found in ModbusRtu.h
...doesn't stop on buffer overflow and may just spoil memory beyond 64-byte au8Buffer occasionally. I believe such mistakes should never occur in a code for an industrial-grade PLC.
I found a few other libraries, however they will not work directly because of the non-standard pins.
Can you recommend any Modbus RTU library that works well with Controllino?
If there is none, probably it is a good idea to write one and include for all Controllino users. I'm ready to contribute to the code.
The text was updated successfully, but these errors were encountered: