Arduino modbus tcp/ip how client

I am in a project to communicate arduino uno as master and a remote Murr ethernet network via modbus tcp / ip!
I am using the arduino modbus library but I am unable to compile it.
I used the example tcp that has in the library but it uses Wifi with the MKR1010 card, modified the code but is not compiling!
Could someone help me to develop this correct code?

library link: ArduinoModbus - Arduino Reference

my code attachment.

modbus_master.ino (2.01 KB)

am in a project to communicate arduino uno as master and a remote Murr ethernet network via modbus tcp / ip!
I am using the arduino modbus library but I am unable to compile it.

That library is designed for ARM based Arduinos (especially the MKR series). It's rather wasteful with memory so it won't run reliably on the UNO and probably no other AVR based Arduino.

BTW, what's a "Murr ethernet network"?

In Modbus TCP there's no master or slave. A Modbus RTU master is called a client in Modbus TCP and a Modbus RTU slave is called a server in Modbus TCP.

pylon:
That library is designed for ARM based Arduinos (especially the MKR series). It's rather wasteful with memory so it won't run reliably on the UNO and probably no other AVR based Arduino.

BTW, what's a "Murr ethernet network"?

In Modbus TCP there's no master or slave. A Modbus RTU master is called a client in Modbus TCP and a Modbus RTU slave is called a server in Modbus TCP.

BTW, what's a "Murr ethernet network"?

replay: is an industrial remote with modbus tcp / ip communication!

Thanks for the answer!
Is there a library can use on arduino uno as a modbus client?
Is there an example for me to try to modify and use?

Follow link from remote murr:

Is there a library can use on arduino uno as a modbus client?

How do you connect the UNO to a network? A UNO has no network hardware.

i find this library: GitHub - goddland16/Modbus-TCP: Modbus TCP client library to interact with Modbus servers such as PLCs.

but also did not compile in arduino

modbusTCPlib_w5100test.ino (3.07 KB)

If you fix the library:

ModbusTCP.h after initial comment:

#ifndef Modbus_TCPIP_h
#define Modbus_TCPIP_h

#ifndef WIZNET_W5100
#define WIZNET_W5100  1       /**< define 1 if  WIZNET W5100 IC is used, otherwise 0 */
#endif
#ifndef ENC28J60
#define ENC28J60      0       /**< define 1 if  ENC28J60 IC is used, otherwise 0     */
#endif
#ifndef ESP8266
#define ESP8266       0
#endif

and fix your code:

line 46:

  Ethernet.begin(mac, moduleIPAddress);

it at least compiles.

But you might choose another library if the github code contains errors that doesn't let it compile...

Using the ModbusIP library of this repository is told to have worked for several users of this forum. I use only Modbus RTU myself, so I don't use a Modbus TCP library actually.