05.11.2019, 12:57
I suggest using profiles instead of scripts as it provides automatic re-connection and other features. For example, if you create a resident script with your code it will stop working if connection is lost. The only way to make it work again would be to restart the script via disable/enable.
TCP connection is created like this:
TCP connection is created like this:
Code:
require('luamodbus')
mb = luamodbus.tcp()
mb:open('192.168.0.1', 502)
mb:connect()