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.

setup modbus tcp slave
#23
Make sure that the client connections are closed properly. There's a limit on active connections to modbus TCP slave.

Mapping will always start from 0. You can specify mapping like this (+1 is need because Lua table start from 1, modbus addressing starts from 0):
Code:
registers = {}
registers[ 100 + 1 ] = '1/1/1' -- mb register 100
registers[ 101 + 1 ] = '1/1/2' -- mb register 101

Since mapping table will not be a continuous array, you will have to set mapping like this:
Code:
mb:setmapping(table.maxn(coils), 0, table.maxn(registers), 0)
Reply


Messages In This Thread
setup modbus tcp slave - by Patrik1985 - 12.02.2018, 07:24
RE: setup modbus tcp slave - by Daniel - 12.02.2018, 09:31
RE: setup modbus tcp slave - by Patrik1985 - 12.02.2018, 09:50
RE: setup modbus tcp slave - by Daniel - 12.02.2018, 10:13
RE: setup modbus tcp slave - by admin - 12.02.2018, 10:32
RE: setup modbus tcp slave - by Patrik1985 - 12.02.2018, 11:18
RE: setup modbus tcp slave - by admin - 12.02.2018, 12:17
RE: setup modbus tcp slave - by Patrik1985 - 12.02.2018, 12:59
RE: setup modbus tcp slave - by admin - 12.02.2018, 13:01
RE: setup modbus tcp slave - by Patrik1985 - 12.02.2018, 13:16
RE: setup modbus tcp slave - by Daniel - 12.02.2018, 13:28
RE: setup modbus tcp slave - by Patrik1985 - 13.02.2018, 09:29
RE: setup modbus tcp slave - by Patrik1985 - 13.02.2018, 11:25
RE: setup modbus tcp slave - by Daniel - 13.02.2018, 11:31
RE: setup modbus tcp slave - by Patrik1985 - 13.02.2018, 11:39
RE: setup modbus tcp slave - by Daniel - 13.02.2018, 11:42
RE: setup modbus tcp slave - by Patrik1985 - 13.02.2018, 13:36
RE: setup modbus tcp slave - by buuuudzik - 01.03.2018, 08:05
RE: setup modbus tcp slave - by admin - 01.03.2018, 08:20
RE: setup modbus tcp slave - by buuuudzik - 01.03.2018, 08:45
RE: setup modbus tcp slave - by admin - 01.03.2018, 11:11
RE: setup modbus tcp slave - by fabiorusco - 07.05.2018, 10:28
RE: setup modbus tcp slave - by admin - 07.05.2018, 11:30
RE: setup modbus tcp slave - by fabiorusco - 09.05.2018, 08:12
RE: setup modbus tcp slave - by admin - 09.05.2018, 08:30
RE: setup modbus tcp slave - by fabiorusco - 09.05.2018, 17:28

Forum Jump: