ModbusRTU protocol - RS485 - ReadHoldingRegister

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 Ive 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 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:

(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://forum.arduino.cc/index.php?topic=176142.105
http://forum.arduino.cc/index.php?topic=20947.0

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)

Welcome to the forum Eva, I hope that you will be able to egt some help here now to finally get communications working correctly between the Arduino and temperature module.

Eva wrote:

It should be something easy (no so difficult) to do, but I`ve already tried lots of libraries and codes without success

Yes, it should normally not be difficult. But when you say 'without success', can you detail exactly the problems you were experiencing with the libraries you tried already ?

Please give error messages you had.

Can you provide a link or details to the temperature unit you are trying communicate with?
Also, can you post the actual code you have, say using SimpleModbusMaster library ?

I can imagine after many months with no success it would become frustrating not to have made much progress.


Paul