Hello Guys, I'm having problems with the SimpleModbusSlave V10 library and I'm not able to find out why. I am trying to carry out the communication of a mega arduino with the ScadaBR software, the arduino being the slave and ScadaBR the master. The code I'm using is the library's own example and I use an rs485 shield to make the communication interface. The problem is that the network master sends the request but the slave sends wrong messages, generating an error. I am using software that monitors the serial port and to visualize that the slave's response contains wrong bytes at the beginning. I already looked at the code and the library to find out the reason but I was not successful. I noticed that people here are right inside this library, could they help? I would love to use it for my projects.
I'm having problems with the SimpleModbusSlave V10 library
Where is the link to the library you're using? There are several versions of that library on the Internet and we don't want to waste our time checking the wrong library!
The initial bytes look like a hardware problem but you failed to provide links to the used hardware, wiring diagram and/or schematics of used boards. My guess is a floating RX pin, a missing termination or missing idling resistors but that's wild guessing.