8 years, 9 months ago.

polling modbus slave

Hi,

I am trying to figure out how to implement a ModbusRTU slave on mbed. I found your nice example, but for some reason it doens't seem to do what I think it should do.

I connected the serial interface to my PC (using a serial-USB interface) On my PC I try to poll the modbus slave using modpoll.exe with this command: "modpoll -p none -r45 -c1 -1 -t4 -b9600 COM2"

The output I get is:

Protocol configuration: Modbus RTU Slave configuration...: address = 1, start reference = 45, count = 1 Communication.........: COM2, 9600, 8, 1, none, t/o 1.00 s, poll rate 1000 ms Data type.............: 16-bit register, output (holding) register table

'-'- Polling slave... Reply time-out!

Extra information: before I poll, LED1 is blinking every second, but after I polled once, the blinking stops.

Any idea's what I am doing wrong?

Thank you in advance! Christopher

Question relating to:

Example of how to handle the Modbus Slave RTU protocol using the mbed RTOS. This example can also be used as reference to implement other slow serial protocols. mbed rtos, Modbus, real time, serial protocol

1 Answer

8 years, 9 months ago.

Hi Chris,

Try with a smaller start reference, since in my example there are only 20 elements in the buses and you are stating to read with offset 45. Or add more elements to your registers.

Gabriel

Accepted Answer

Thanks Gabriel,

That did the trick indeed!

posted by Christopher Peirs 24 Feb 2016