Modbus slave problem
Willie from South Africa  [4 posts]
15 year
Hi Steven,
I have been testing the Modbus slave functionality and there seems to be a bug in the works. When I use a Modbus master to read variables (mapped to holding registers which by definition are read/write)  from RR everything works as it should. I have declared a dummy variable which I am trying to modify from the Modbus master. RR then states that a Input Register (by def.   Read only) has been written but the variable is left unchanged. I have tried different MB masters all with the same result although some display exception errors on receipt of the response to the write request (Modbus request 16). I normally use Modscan as a testing master. I have attached the .robo file.  If I write multiple coils all coils accept the change, except for the coil that are linked to the variable  mb_trig . (MBcoil.robo)
Anonymous 15 year

Thanks for such great information and debugging! It indeed looks like the FC_PRESET_MULTIPLE_REGISTERS function was incorrectly updating input registers as the log was indicating. As your variable is mapped to a holding register nothing was getting updated. We corrected this to now update the holding register instead of an input register. Note that this also affected the FC_PRESET_READ_MULTIPLE_REGISTERS function that was also pointing incorrectly to input registers.

Please download 2.5.5 for that fix and let us know if it does the job!

Wouter from Netherlands  [1 posts] 13 year

I'm currently working in RR v2.30.8. I have tested the program.robo file. I can read the holding register values with a modbus master -->screen1. But it is not possible to write(change) those values. I get no exception. When I write to a address that is not mapped to a value it creates non existing variables. (| 20380141 )--> screen2.


This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index