14.09.2016, 08:40
You can use proxy which will be available in RC2 firmware. First, you have to enable RTU in modbus mapper, then you can use it in scripts like this:
In your code you will just have to replace luamodbus require/open/connect with proxy functions and you won't have any issues with simultaneous port access from several scripts
Code:
mbproxy = require('mbproxy')
mb = mbproxy.new()
mb:setslave(2)
r1, r2, r3 = mb:readregisters(0, 3)
log(r1, r2, r3)
In your code you will just have to replace luamodbus require/open/connect with proxy functions and you won't have any issues with simultaneous port access from several scripts