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 Script Multiple registers work in script, but not in profile
#1
Here is the script
Code:
require('luamodbus')
mb = luamodbus.tcp()
mb:open('192.168.0.100', 502)
mb:connect()
mb:setslave(1)


res, err = mb:writemultipleregisters(1003, 4)
log(res,err)

mb:close()

Here is the profile
Code:
{
    "manufacturer": "Nilan",
    "description": "Nilan CTS602",
    "mapping": [
    { "name": "Speed setting", "bus_datatype": "uint16", "type": "register", "address": 1003, "writable": 1, "write_multiple": 1}
]
}


The script can write and change the speed value

The profile can then read that the script has changed the value, verified by looking at the ventilation display.

The profile can not be used to write, and if i change the object value, it just jumps back to what it was and nothing happens on the display.

So the script clearly writes and the profile clearly reads.
I have to use multiple registers per the manual to get write permission.

What am i missing here?
Reply
#2
Your profile entry is missing "datatype": "uint16"
Reply
#3
Thank you, that solved it.

Is it because of the write_multiple that you need to define the datatype ?
Reply
#4
Yes, for write_multiple to work datatype must be either int16 or uint16.
Reply


Forum Jump: