Modbus-contrib tcp/ip fails

Hi everyone :slight_smile:

first of all sorry if my english is not going to be perfect, but I'm from Italy.

I'm having some troubles with modbus-contrib by @bianco-royal .
Basically, the connection to the server is ok, but I'm not able to read or write anything.

I've already tried a TCP-RESPONSE node injecting an hex buffer, and everything works good.
From the tcp/ip to rs485 device I can clearly see two connections from my client, just to be sure that it isn't a tcp-part problem.

I hope someone can help me..

Have a good day :smiley:

Here is my temporary flow:

[{"id":"dda328e3.b92f48","type":"tab","label":"Modbus -video Flow 1","disabled":false,"info":""},{"id":"d0aa07e1.8888e8","type":"modbus-read","z":"dda328e3.b92f48","name":"","topic":"","showStatusActivities":true,"logIOActivities":false,"showErrors":true,"unitid":"","dataType":"HoldingRegister","adr":"6","quantity":"1","rate":"3","rateUnit":"s","delayOnStart":false,"startDelayTime":"","server":"d0e85f54.82355","useIOFile":false,"ioFile":"","useIOForPayload":false,"x":210,"y":80,"wires":[["776f16c7.659548"],[]]},{"id":"776f16c7.659548","type":"debug","z":"dda328e3.b92f48","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":440,"y":80,"wires":[]},{"id":"11acc744.0ef1a9","type":"inject","z":"dda328e3.b92f48","name":"unit address","topic":"","payload":"00 03 00 06 00 01 65 DA","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":170,"y":180,"wires":[["eec4ff8b.d0f49"]]},{"id":"eec4ff8b.d0f49","type":"function","z":"dda328e3.b92f48","name":"","func":"bufferInput = msg.payload.replace(/\\s/g, '');\nmsg.payload = Buffer.from(bufferInput, \"hex\");\nreturn msg;","outputs":1,"noerr":0,"x":350,"y":180,"wires":[["bc01da87.1739a8"]]},{"id":"bc01da87.1739a8","type":"tcp request","z":"dda328e3.b92f48","server":"10.0.1.168","port":"8233","out":"sit","splitc":" ","name":"","x":540,"y":180,"wires":[["12ea9d53.4ed583"]]},{"id":"12ea9d53.4ed583","type":"debug","z":"dda328e3.b92f48","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":780,"y":180,"wires":[]},{"id":"d0e85f54.82355","type":"modbus-client","z":"","name":"","clienttype":"tcp","bufferCommands":true,"stateLogEnabled":false,"tcpHost":"10.0.1.168","tcpPort":"8233","tcpType":"TPC-RTU-BUFFERED","serialPort":"/dev/ttyUSB","serialType":"RTU-BUFFERD","serialBaudrate":"9600","serialDatabits":"8","serialStopbits":"1","serialParity":"none","serialConnectionDelay":"100","unit_id":"1","commandDelay":"1","clientTimeout":"3000","reconnectTimeout":"2000"}]

please, test these settings:

[{"id":"f2f57786.3439c8","type":"tab","label":"Modbus -video Flow 1","disabled":false,"info":""},{"id":"9c343fbe.0551b","type":"modbus-read","z":"f2f57786.3439c8","name":"","topic":"","showStatusActivities":true,"logIOActivities":false,"showErrors":true,"unitid":"","dataType":"HoldingRegister","adr":"6","quantity":"1","rate":"3","rateUnit":"s","delayOnStart":true,"startDelayTime":"","server":"4d99eaf7.d28854","useIOFile":false,"ioFile":"","useIOForPayload":false,"x":230,"y":80,"wires":[["c7fb49a0.bc5f68"],[]]},{"id":"c7fb49a0.bc5f68","type":"debug","z":"f2f57786.3439c8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":440,"y":80,"wires":[]},{"id":"cbb9c11f.959ed","type":"inject","z":"f2f57786.3439c8","name":"unit address","topic":"","payload":"00 03 00 06 00 01 65 DA","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":170,"y":180,"wires":[["95602a1e.efad18"]]},{"id":"95602a1e.efad18","type":"function","z":"f2f57786.3439c8","name":"","func":"bufferInput = msg.payload.replace(/\\s/g, '');\nmsg.payload = Buffer.from(bufferInput, \"hex\");\nreturn msg;","outputs":1,"noerr":0,"x":350,"y":180,"wires":[["75c850b5.a4ae48"]]},{"id":"75c850b5.a4ae48","type":"tcp request","z":"f2f57786.3439c8","server":"10.0.1.168","port":"8233","out":"sit","splitc":" ","name":"","x":540,"y":180,"wires":[["d113cdf3.10c938"]]},{"id":"d113cdf3.10c938","type":"debug","z":"f2f57786.3439c8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":780,"y":180,"wires":[]},{"id":"4d99eaf7.d28854","type":"modbus-client","z":"","name":"","clienttype":"tcp","bufferCommands":true,"stateLogEnabled":true,"tcpHost":"10.0.1.168","tcpPort":"8233","tcpType":"DEFAULT","serialPort":"/dev/ttyUSB","serialType":"RTU-BUFFERD","serialBaudrate":"9600","serialDatabits":"8","serialStopbits":"1","serialParity":"none","serialConnectionDelay":"100","unit_id":"1","commandDelay":"1","clientTimeout":"3000","reconnectOnTimeout":false,"reconnectTimeout":"2000","parallelUnitIdsAllowed":false}]

RTU-BUFFERED is not often supported on TCP it is more a Serial feature - mostly it should work with the default settings ...

to start playing with modbus local you can use Menu -> Import ...

Sorry, I was without internet.
Anyway I tried your flow, and it doesn't work anyway...
I'm really stuck with this.

Thank you so much for the reply.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.