Hello everybody!
Im 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 I
ve already tried lots of libraries and codes without success. I really cant get any solution to my problem, and it makes already about 5 months that I
m 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:
(arduino) (MAX485)
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)
Address: 0000
Quantity of registers to read: 1
I tried all these libraries:
RS485
ModbusMaster485
SoftwareSerial
ModbusMaster
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!
Best regards,
Eva
references:
http://www.simplymodbus.ca/FAQ.htm
https://aglasspool.wordpress.com/2010/03/23/arduino-heatmiser-via-rs485/
http://arduino-info.wikispaces.com/SoftwareSerialRS485Example
http://playground.arduino.cc/Code/ModbusMaster
SimpleModbusMasterV2rev2.zip (20.2 KB)
SimpleModbusMasterManual.pdf (275 KB)
ModbusMaster-master.zip (353 KB)
RS485_for_Arduino.zip (37.2 KB)