Modbus RTU questions...

Hi,

I have a metering device that has a RS485 communication interface using the MODBUS protocol. The datasheet for the meter is brief to say the least. Its Modbus RTU mode protocol, 9600 baud rate, 8 data bits, no parity, one stop bit, with CRC verify.

It gives an example frame as:

Reading Data?
The code of PC?
Function code Data
00 03 00 00 00 03 CRCL CRCH
Device Address Address Register 16 digits CRC verify

The code of meter?
Function code 1 2 3 4 5 6
00 03 06 00 12 00 34 00 56 CRCL CRCH
Device Address Data ?value of reading 123456??hex? 16 digits CRC verify

My question is how do I fire the 'code of PC' out of the Arduino and then read back the response?

Start with a RS485 board so you can communicate

Then just Serial.print the data to go out, and Serial.read it back in.

I don't know what algorithm you would use for CRCL & CRCH, you haven't provided enough data. Maybe its just an addition of all the preveding data, sent over as a low byte & a high byte of an int.

Hi
Take a look at http://www.biemmeitalia.net/blog/android-touchscreen-communicates-with-arduino-using-modbus-rs485
I hope it helps you

elle