MODBUS TCP over ETHERTNET cable

Hi

I want to read some Modbus registers but not over the wifi, over a ethernet cable.
How can I do that? I have already a script for Modbus reading over wifi, do I need other settings?

[{"id":"c659bcf3dcb7a08e","type":"modbus-read","z":"4caaccd5cdb6bfdd","name":"Voltage","topic":"","showStatusActivities":false,"logIOActivities":false,"showErrors":false,"unitid":"61","dataType":"HoldingRegister","adr":"0","quantity":"46","rate":"10","rateUnit":"s","delayOnStart":false,"startDelayTime":"","server":"62a4b715be1f5c5b","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":false,"x":490,"y":340,"wires":[["18e6bae67ef1d126","c53f4232eb527410","a80bc70fb3ddbe19"],[]]},{"id":"18e6bae67ef1d126","type":"buffer-parser","z":"4caaccd5cdb6bfdd","name":"test","data":"payload","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"floatle","name":"item1","offset":0,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatle","name":"item2","offset":4,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatle","name":"item3","offset":8,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatle","name":"item4","offset":12,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatle","name":"item5","offset":16,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatle","name":"item6","offset":20,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatle","name":"item7","offset":24,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatle","name":"item8","offset":28,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatle","name":"item9","offset":32,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatle","name":"item10","offset":36,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatle","name":"item11","offset":40,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatle","name":"item12","offset":44,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatle","name":"item13","offset":48,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatle","name":"item14","offset":52,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatle","name":"item15","offset":56,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatle","name":"item16","offset":60,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatle","name":"item17","offset":64,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatle","name":"item18","offset":68,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatle","name":"item19","offset":72,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatle","name":"item20","offset":76,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatle","name":"item21","offset":80,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatle","name":"item22","offset":84,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatle","name":"item23","offset":88,"length":1,"offsetbit":0,"scale":"1","mask":""}],"swap1":"swap16","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"keyvalue","resultTypeType":"output","multipleResult":false,"fanOutMultipleResult":false,"setTopic":true,"outputs":1,"x":670,"y":340,"wires":[["d66ba90ac0c8d3bd"]]},{"id":"d66ba90ac0c8d3bd","type":"debug","z":"4caaccd5cdb6bfdd","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":870,"y":340,"wires":[]},{"id":"62a4b715be1f5c5b","type":"modbus-client","name":"","clienttype":"tcp","bufferCommands":true,"stateLogEnabled":false,"queueLogEnabled":false,"tcpHost":"smappee5130007388","tcpPort":"502","tcpType":"DEFAULT","serialPort":"/dev/ttyUSB","serialType":"RTU-BUFFERD","serialBaudrate":"9600","serialDatabits":"8","serialStopbits":"1","serialParity":"none","serialConnectionDelay":"100","serialAsciiResponseStartDelimiter":"0x3A","unit_id":"61","commandDelay":"1","clientTimeout":"1000","reconnectOnTimeout":true,"reconnectTimeout":"2000","parallelUnitIdsAllowed":true}]

If the cable is connected to the node-red device and you can Ping the ModBus device from the node-red device, just specify the IP address of the Device in the ModBus TCP node. Let the network take care of the details.

Otherwise, disconnect the WiFi from the node-red device.

EDIT

I assume the wired network and wireless network are either on the same subnet or both are routed and able to "see" the modbus device? Have you considered using different subnets or VLANs for WiFi and Wired?

Is the modbus device connected to your router? If so then it is up the OS on your node red device which connection it uses. Why do you care?

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