budulinek / arduino-modbus-rtu-tcp-gateway

Arduino-based Modbus RTU to Modbus TCP/UDP gateway with web interface. Allows you to connect Modbus RTU slaves (such as sensors, energy meters, HVAC devices) to Modbus TCP/UDP masters (such as home automation systems). You can adjust settings through web interface.
GNU General Public License v3.0
172 stars 51 forks source link

Modbus RTU Slave ID in Modbus TCP/UDP not function #11

Closed lilisugeng closed 2 years ago

lilisugeng commented 2 years ago

When using Modbus TCP/UDP the scanned modbus RTU Slave ID may not be stored permanently, causing the master to fail to connect.

budulinek commented 2 years ago

This is a feature (of all Modbus Gateways), not a bug. It is up to the master to remember the correct slave ID. It is also up to the master to send correctly formated Modbus TCP message (which contains slave ID).

Does the "Scan" button find your RTU slave? It means that RTU slave sent a response to a test command sent by the gateway. It means that your RTU settings are correct. Does RTU slave disappear from the "Current Status" page once you connect your master to the gateway? It means that:

PLS check the Modbus TCP message sent by the master.

lilisugeng commented 2 years ago

The scan button finds the Slave RTU, in this case it finds 0x01 OK, that's also the Slave ID I set on the master. I'm using a kepware OPC server for this test and I'm using a Schneider PM800 Energy Meter. The gateway works fine when I use Modbus over TCP, with the same Slave ID setting, but not for Modbus TCP. Is there anything I should pay more attention to? Thanks

lilisugeng commented 2 years ago

Sory I think I did wrong in my kepware setup, I use modbus scanner it is working fine also when I use Modbus TCP. Sorry again for my foolness. Thanks so much, the program you have made is realy awsome. Thank you.

budulinek commented 2 years ago

Hi, I am glad to hear that everything works :-) Be careful, Modbus TCP and Modbus RTU over TCP are two different things. Have a nice day!