Modbus

10 Jun 2011

Hi everybody,

I would like to know if it's possible to communicate with MODBUS protocol between mbed and an other device ?

Replies

14 Jun 2011

Hi,

I found this program :

http://mbed.org/users/giryan/programs/Modbus/5z95e/docs/

Someone use it ?? I need feedback experience ..

Thank you.

14 Jun 2011

Hi,

I used the port of the FreeModbus Libary for mbed at http://mbed.org/users/cam/programs/Modbus/5zdqv and it gave a working MODBUS RTU slave implementation for me. I tested it using a free MODBUS polling utility called modpoll that I found at http://www.modbusdriver.com/modpoll.html.

I am still looking for a MODBUS TCP implementation. Has anyone done this yet?

Peter

14 Jun 2011

user Peter Ampt wrote:

Hi,

I used the port of the FreeModbus Libary for mbed at http://mbed.org/users/cam/programs/Modbus/5zdqv and it gave a working MODBUS RTU slave implementation for me. I tested it using a free MODBUS polling utility called modpoll that I found at http://www.modbusdriver.com/modpoll.html.

I am still looking for a MODBUS TCP implementation. Has anyone done this yet?

Peter

Hi,

Thank you very much for your reply.

There is no documentation, it will be difficult for me but i will try;

:)

15 Jun 2011

Hi,

You should not have too many problems getting the MODBUS RTU slave to work on mbed. Open the program at http://mbed.org/users/cam/programs/Modbus/5zdqv program in the mbed Compiler by clicking the "Import this program" link.

The main.cpp source file has the MODBUS settings in the "Defines" area and the following line 43 does the serial port settings.

eStatus = eMBInit( MB_RTU, SLAVE_ID, 0, 9600, MB_PAR_NONE );

The program should compile with just a couple of warnings.

Run modpoll with the following options: MODPOLL -m rtu -a 10 -r 1000 -c 4 -t 3:hex -b 9600 -d 8 -p none COM2. Of course select COM number to match the mbed com port. Use modpoll -h for help on the options.

I hope that is sufficient to get you going.

Peter

01 Jul 2011

Hi,

Sorry for this late response.

The program compile and work ! :)

I used this software http://qmodbus.sourceforge.net/.

Edit : In the for loop, if I add some functions , modbus protocol doesn't work anymore.

Please log in to post a reply.