Page 1 of 1

Modbus over TCP and Net.FTcpSocket

Posted: Thursday 09 March 2017 18:46
by candrea77
I've currently migrated from Fibaro HC2 to Domoticz.

I wonder if there is a possibility to use that part of code in domoticz in any way :

Code: Select all

tcpSocket = Net.FTcpSocket("x.x.x.x", 502)
tcpSocket:setReadTimeout(250);
bytes, errorCode = tcpSocket:write(sendbuffer)
x.x.x.x is a single IP address
In Fibaro I use it for getting the data from my VMC (that use modbus Over TCP)


Regards

Re: Modbus over TCP and Net.FTcpSocket

Posted: Tuesday 14 March 2017 7:16
by candrea77
Hello,
no one can help me ?


I've found this part of code in the forum , maybe the Net.FTcpSocket("x.x.x.x", 502) is something like this ?

Code: Select all

conn=net.createConnection(net.TCP, 0)
 conn:on("receive", function(conn, payload) print(payload) end )

Re: Modbus over TCP and Net.FTcpSocket

Posted: Tuesday 14 March 2017 16:35
by bobdvb
I am currently testing using NodeRed and MQTT to communicate with a Modbus PLC, it is working but I have done refinement to do before I share my discoveries.

To do it I am using: https://flows.nodered.org/node/node-red-contrib-modbus

Re: Modbus over TCP and Net.FTcpSocket

Posted: Thursday 23 March 2017 13:45
by candrea77
Thank you .... I give it a look.