22.02.2024, 15:44
Hi,
I've done some tests using this code:
I don't know how to add a delay between them... It seems that both are queued and executed when polling cycle is finished (sometimes the second one is written on the next cycle...) and sometimes writemutipleregisters returns nil (is it when value has not been written?)
I need to manage some kind of writting queue, writing registers one by one (using function 16) with 1 second delay between them...
Don't know if it's possible in some way....
I've done some tests using this code:
Code:
mbproxy = require('mbproxy')
mb = mbproxy.new()
mb:setslave(1)
log('write')
local a=mb:writemultipleregisters(48094, 1)
log('a: '..a)
local b=mb:writemultipleregisters(48092, 480)
log('b: '..b)
I don't know how to add a delay between them... It seems that both are queued and executed when polling cycle is finished (sometimes the second one is written on the next cycle...) and sometimes writemutipleregisters returns nil (is it when value has not been written?)
I need to manage some kind of writting queue, writing registers one by one (using function 16) with 1 second delay between them...
Don't know if it's possible in some way....