Modbus TCP slave and RTU slave simultaneously - is possible?

Hello all

I'm curious that is possible to run both Modbus RTU and TCP slave at one UNO using ArduinoModbus libraries... I've got Ethernet shield (DFRobot) and I've managed to run Modbus examples from that libraries but only one at time. All my attempts to combine both libraries ended up with me managing to compile the project and upload it, but the modbus communication is giving frame errors.
It would be good if registers could be common for both RTU and TCP.

I hope I have described it well enough and maybe someone will decide to help a little or guide me to a solution :slightly_smiling_face:

To be clear - I'm familiar with Modbus communication, all I want to know is that if and how to run it as I asked at start of my post :slight_smile:
(sorry for my english :grimacing:)

It's even a bad choice to run one of them on an UNO using the ArduinoModbus library. This library was developed for the MKR series of Arduinos which have way more RAM than an UNO. The library is based on libmodbus which was developed for PC operating systems which have enough memory to fulfill the high requirements.

If you use a platform with enough RAM you should be able to have both methods active at the same time but in separate objects of course. This means it's your job to have the two synchronized.

If you modify the library you should be able to have one register set on multiple instances of the class.

Thanks for your reply and explanation of topic

Regards

Hello @pylon , I hope you are well. Do you happen to know what I should edit from the library?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.