Modbus TCP Uno Wifi Rev. 2

Hello!

I'm trying to find a modbus tcp client library for my arduino uno wifi rev. 2 for several days. I tried a few but none really fits well.

This is an homeautomation project and i want to read/write Inputs and Outputs on my Siemens Logo 8 PLC. To do this I need a least functions 01 (read coils), 02 (read discrete input), 05 (write single coil).

Can anybody help me? Maybe with MsgModbus Lib? I started to play with arduinos 4 weeks ago. So i'm still at the beginning.

Thank you!

1 Like

this sketch has Modbus TCP client without a library

Juraj:
this sketch has Modbus TCP client without a library
IsgModbusTcpSG/IsgModbusTcpSG/IsgModbusTcpSG.ino at master · JAndrassy/IsgModbusTcpSG · GitHub

This sketch is only for functions 03, 04, 06. Am i right?

const byte FNC_H_READ_REGS = 0x03;
const byte FNC_I_READ_REGS = 0x04;
const byte FNC_WRITE_SINGLE = 0x06;

I need functions 01, 02 and 05.

You can refer to this Arduino-powered Modbus/TCP device project on Hackster

fhainz:
This sketch is only for functions 03, 04, 06. Am i right?

const byte FNC_H_READ_REGS = 0x03;

const byte FNC_I_READ_REGS = 0x04;
const byte FNC_WRITE_SINGLE = 0x06;




I need functions 01, 02 and 05.

there is not much difference. you can modify the two functions