Hi, would you mind implementing how the fc5 work? I can't make it working.
What do you need? A Modbus master or slave?
I need for slave. I've port to work with my MSP430 Launchpad (that I think I only change at serial port). You could see at the link below.https://www.dropbox.com/s/1d6s93ikvng7dl3/Modbus.rar?dl=0
Hi suby,first of all, thank you very much for this great piece of software. I hope I will get it to work. I spend the last two days trying. May I ask for help?I have an Arduino nano clone with an RS485 shield connected to a RS485-to-USB converter connected to my computer (mac or windows). I am using the simple_slave example sketch and have tried to access the information in the au16data-array with 5 or 6 modbus master test programs. I get CRC errors with all of them. I tried with several arduino nano boards with several RS485 shields. All the same result.In the thread http://forum.arduino.cc/index.php?topic=213432.0 platoxii and AMPS-N also encountered this error. platoxii showed this image of the error, which is identical when I use Qmodbus: http://i.imgur.com/f6W2L3p.pngIt seems at least platoxii got it solved, but did not tell how... Do you have an idea what can be done to fix the problem?Does the error message in the image mean that the CRC of the request was wrong or the CRC of the reply was wrong?I would appreciate any help you can give.cheers,frankOn a side note, one strange thing is, with the modbus test software "Modbus Probe" for OS X there are combinations of requests that lead to successful readouts every couple of attempts. For example, when I request start address 0, length 1 (holding regs) I get a successful readout every 3 attempts. When I request start address 0, length 10 (holding regs) I get successful readout every 6 attempts. This also depends on the data itself, though. If I change the data, there are other combinations of query parameters that lead to successful attempts. This program sadly does not report errors at all, so the unsuccessful attempts may be CRC errors also. Maybe with some combination of query parameters the CRC happens to be correct every couple of attempts? I don't know.
Hi,further analysis shows that the answer of the slave is always padded with zero bytes before and after. So the request:01 03 00 01 00 01 D5 CAyields the answer:00 01 03 02 05 87 FB 76 00where it should be:01 03 02 05 87 FB 76I suppose this is probably a hardware issue. I will report back with the solution (hopefully).
Hi Frank,RS485 is always a bit tricky. I recommend you to debug your sw with USB or RS232 and try RS485 afterwards. It's the only way to distinguish sw and hw issues. I look forward your further comments.
Hi,finally, I found out what the issue is. I am using this RS485 shield:https://arduino-info.wikispaces.com/RS485-Modulesbought from:http://www.ebay.de/itm/331359788902It does have a 120 Ohm termination resistor and two biasing resistors to pull the A line to 5V and the B line to Gnd when there is no transmission going on. It turns out that the biasing resistors are 10.000 Ohm which is well above the recommended 680 Ohm.The USB-RS485 Adapter I use ( http://www.digitus.info/mx/produkte/zubehoer/adapter-und-konverter/r-usb-seriell-adapter-usb-20-da-70157/ ) seems to have no (sufficient) biasing resistors, because:I now added some biasing resistors at the USB-RS485-adapter between A<->5V and B<->Gnd with about 580 Ohm. Actually I used two potentiometers I had lying around.With this modification the transmission works very nicely. I left the 10.000 Ohm biasing resistors on the RS485 shield as they are.cheersfrank