m trying to stablish a Modbus RTU communication beetween an arduino (master) and a digital temperature reader (slave). It should be something easy (no so difficult) to do, but Ive already tried lots of libraries and codes without success. I really can
t get any solution to my problem, and it makes already about 5 months that Im in this issue!
Would you mind giving me any light? please…
If so, I would be extremely glad and thankful.
I have an arduino Mega connected to a MAX485 module according to the wiring below:
digital PIN 2 (enableTx)<---------> DE e RE
digital PIN 1 (TX) <---------------> DI
digital PIN 0 (RX) <---------------> RO
GND <-----------------------------> GND
The RS485 module is connected to the temperature reader. They have the same GND.
I need do the folowing request through Modbus RTU protocol:
Slave ID: 2.
Function: 03 (READ HOLDING RESGISTERS)
Quantity of registers to read: 1
I tried all these libraries:
SimpleModbusMaster (V2 rev2)
What can I do now? I also tried to write my own code at the IDE, but I failed…
Isn`t there any dummy-solution that I could just copy and paste and make everything work, like magic?? =/
Thank you once again for any help that you may give me!
SimpleModbusMasterV2rev2.zip (20.2 KB)
SimpleModbusMasterManual.pdf (275 KB)
ModbusMaster-master.zip (353 KB)
RS485_for_Arduino.zip (37.2 KB)