---
title: "2 Examples of Modbus TCP"
url: "https://maker.wiznet.io/WIZnet/resellers/2-examples-of-modbus-tcp/"
markdown_url: "https://maker.wiznet.io/WIZnet/resellers/2-examples-of-modbus-tcp/md"
type: "VAR: Value-Added Reseller Products"
author: "fleaplc"
author_url: "http://www.fleaplc.it/en/tutorials/33-arduino-as-raspberry-pi-s-remote-io-codesys."
editor: "WIZnet"
editor_url: "https://maker.wiznet.io/"
original_author: "fleaplc"
original_url: "http://www.fleaplc.it/en/tutorials/33-arduino-as-raspberry-pi-s-remote-io-codesys."
published: "2023-04-26"
language: "en"
hardware: ["WIZnet W5100"]
likes: 0
views: 187
comments: 0
source: "WIZnet Makers (https://maker.wiznet.io/)"
---

# 2 Examples of Modbus TCP

> 2 Examples of Modbus TCP

Original author: fleaplc (source: http://www.fleaplc.it/en/tutorials/33-arduino-as-raspberry-pi-s-remote-io-codesys.)

## Components

- **WIZnet W5100** x 1 ([docs](https://docs.wiznet.io/Product/Chip/Ethernet/W5100))

## Article

**DETAILS**

There are “Modbus TCP” examples.

**First,** it’s very simple example to control industrial devices.

original source is <http://www.fleaplc.it/en/tutorials/29-arduino-mega-2560-modbus-tcp-server-2-en>

[![](http://www.fleaplc.it/images/Articoli/ArduinoMBTcpSlave/Mega2560.jpg)](http://www.fleaplc.it/en/tutorials/29-arduino-mega-2560-modbus-tcp-server-2-en)

> ***Software used:***
>
> 1. *Arduino IDE 1.5.5 (free download from Arduino main *[*website*](http://www.arduino.cc/en/Main/Software)*)*
>
> 2. *Arduino Modbus (free download from *[*here*](https://code.google.com/p/mudbus/)*)*

**Second,** it’s more complex example for Modbus TCP with Multiple I/O used Arduino Uno, Mega & RaspberryPI.

The original source is <http://www.fleaplc.it/en/tutorials/33-arduino-as-raspberry-pi-s-remote-io-codesys>.

> *So I though to realize a cheap fully working distributed architecture where:*
>
> - *Raspberry PI= PLC Controller (Codesys 3.5 SP*
>
> - *Arduino Mega 2560= 1st remote I/O*
>
> - *Arduino Uno= 2nd remote I/O*
>
> - *Modbus TCP/IP: communication protocol*
>
> ***![CoDeSys](http://www.fleaplc.it/images/Articoli/RaspberryArduino2560_Codesys/Images/CoDeSys.jpg)+ ![Raspberry](http://www.fleaplc.it/images/Articoli/RaspberryArduino2560_Codesys/Images/Raspberry.jpg)+![ArduinoLogo](http://www.fleaplc.it/images/Articoli/RaspberryArduino2560_Codesys/Images/ArduinoLogo.jpg)+![Banner-Modbus](http://www.fleaplc.it/images/Articoli/RaspberryArduino2560_Codesys/Images/Banner-Modbus.jpg)= (PLC + remote I/O)***

and source code is available at there.

> *you can get source code*
>
> [*![Download this file (Mega2560.7z)](http://www.fleaplc.it/media/com_attachments/images/file_icons/generic.gif)*](http://www.fleaplc.it/en/component/attachments/download/16)[*Merga2560_src*](http://www.fleaplc.it/en/component/attachments/download/16)* 0.8 kB*
>
> [*![Download this file (Raspberry.7z)](http://www.fleaplc.it/media/com_attachments/images/file_icons/generic.gif)*](http://www.fleaplc.it/en/component/attachments/download/18)[*Raspberry_src*](http://www.fleaplc.it/en/component/attachments/download/18)* 54 kB*
>
> [*![Download this file (Uno.7z)](http://www.fleaplc.it/media/com_attachments/images/file_icons/generic.gif)*](http://www.fleaplc.it/en/component/attachments/download/17)[*Uno_Src*](http://www.fleaplc.it/en/component/attachments/download/17)* 0.5 kB*

---

Source: https://maker.wiznet.io/WIZnet/resellers/2-examples-of-modbus-tcp/
