Hello, after a lot of searching, I'm here to ask for some help.
I have an Arduino Uno with an Ethernet shield. I have a data recorder that uses modbus TCP (no RS485), and I want the Arduino to poll and store 9 input registers from that data recorder (located in another room) via modbus tcp. That's it. However, there is only 1 modbus TCP master library (My Arduino Projects - Website dedicated to my arduino projects - A ModBus TCP library for the Arduino system), and it has zero documentation, and also doesn't work (does nothing at all, no serial feedback, no menu, using the provided example code). The only other modbus master library is for RS485, and the one working modbus TCP library (mudbus) is slave-only.
I don't even need a library, I just need to poll the first 9 16-bit input registers (modbus function 4) from a single modbus TCP slave (data recorder box). Modpoll works correctly in command prompt on windows, so I know I can do it, but I have no idea how to code it with the ethernet shield. I've tried using the ethernet library to send a client.println of the TCP modbus request string to port 502, but I get gibberish ascii in response after connecting.
I've successfully completed many other arduino projects, so I think that this is doable, but just needs a programmer more versed in tcp/modbus than I am.
Thanks in advance.
FYI, this is the modpoll response:
C:\>modpoll -1 -t 3 -c 9 -r 1 -m tcp 10.20.10.62
modpoll 3.4 - FieldTalk(tm) Modbus(R) Master Simulator
Copyright (c) 2002-2013 proconX Pty Ltd
Visit http://www.modbusdriver.com for Modbus libraries and tools.
Protocol configuration: MODBUS/TCP
Slave configuration...: address = 1, start reference = 1, count = 9
Communication.........: 10.20.10.62, port 502, t/o 1.00 s, poll rate 1000 ms
Data type.............: 16-bit register, input register table
-- Polling slave...
[1]: 22259
[2]: 25091
[3]: 21991
[4]: 24928
[5]: 23212
[6]: 22801
[7]: 23093
[8]: 23253
[9]: 20616
The modbus TCP protocol is here: