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 Profile Write Errors
#11
Hi,
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....
Reply


Messages In This Thread
Modbus Profile Write Errors - by jmir - 20.02.2024, 16:08
RE: Modbus Profile Write Errors - by admin - 21.02.2024, 14:42
RE: Modbus Profile Write Errors - by jmir - 21.02.2024, 14:56
RE: Modbus Profile Write Errors - by admin - 21.02.2024, 14:58
RE: Modbus Profile Write Errors - by jmir - 21.02.2024, 15:02
RE: Modbus Profile Write Errors - by jmir - 21.02.2024, 16:52
RE: Modbus Profile Write Errors - by jmir - 22.02.2024, 11:39
RE: Modbus Profile Write Errors - by Daniel - 22.02.2024, 11:55
RE: Modbus Profile Write Errors - by jmir - 22.02.2024, 13:48
RE: Modbus Profile Write Errors - by Daniel - 22.02.2024, 13:53
RE: Modbus Profile Write Errors - by jmir - 22.02.2024, 15:44
RE: Modbus Profile Write Errors - by Daniel - 22.02.2024, 16:09

Forum Jump: