This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Modbus write multiple registers
#1
Hello!

fw 20160927
  
Modbus
Code:
if not mb then
    mbproxy = require('mbproxy')
    mb = mbproxy.new()
end
mb:setslave(4)

res, err = mb:writemultipleregisters(46165, o1, o2, o3)
if err then log(err); end

Quote:Logs: *string: Illegal function



What not so?
Reply
#2
This is a reply from the slave telling that this function is not supported. Actually, writemultipleregisters only make sense when writing one register to a device which only supports function code 16. With multiple registers writemultipleregisters and writeregisters are identical. Try using writeregisters and write only one register at a time.
Reply
#3
In a manual on the device it is written what can be written in this address only through function 16.
I tried writeregisters - too an error: Illegal data!

p.s.
this device - http://bolid.ru/files/373/566/s2_pp_v124...only_e.pdf
Reply
#4
Hi,

Do you have jumper XP1 set to master mode?

Writing to multiple register starting at 46165 is only possible when device is master according to manual.

BR, 

Erwin
Reply


Forum Jump: