Siemens S7-1200 to Arduino Modbus TCP/IP Communications Part 3.

Siemens S7-1200 to Arduino Modbus TCP/IP Communications Part 3.

Mario Crispino

3 года назад

17,957 Просмотров

Welcome to a Siemens S7-1200 to Arduino Modbus TCP/IP Communications Tutorial Part 3.

In this video we have introduced an Arduino into the mix, which communicates with the Siemens S7-1200 PLC and Factory I/O using the Modbus TCP/IP Protocol.

This Siemens S7-1200 Modbus TCP/IP Video is 1 of 3 Modbus videos where we deal with the Arduino; programming it to function as a Modbus Server. The Arduino reads a potentiometers’ rotational position via an analogue input then stores that value in an input register.

In the following videos, the Siemens S7-1200 PLC, being on the same local area network is able to read the value stored in the Arduino Input register and use it as a setpoint to control the Water Level in the Tank.

******************************
Please note at 1 minute 8 seconds into the video (1.08) it says Part 5 on the top right hand side of the screen. This is an error on my part as it should actually say Part 3. Sorry for any confusion Hope you enjoy the video .
*****************************

As a prelude to this video you may want to watch the previous two videos on Water Tank Level Control as they will definitely help you understand what we are trying to achieve. The Links are below:

Siemens S7-1200 Water Tank Level Control Part 1.
https://youtu.be/-hEjh5SEbrc

Siemens S7-1200 Water Tank Level Control Part 2.
https://youtu.be/poi08Wtxkbo

To view the next video in the series, Siemens S7-1200 Modbus TCP/IP Communications with Arduino Part 3. select the link:
https://youtu.be/OuSlJl8EHz0

A free 30 day Licence of Factory I/O

If you would like to get a free 30 day licence of Factory I/O or even purchase a copy, you can use the link below. I will earn a small commission for this, however, it helps me produce videos like this one to help you program PLCs now and in the future and it shouldn't make a difference to the price you pay.
Many thanks.
https://factoryio.com/url-action?ref=...

Details about my patreon account will be added here shortly.

The Siemens S7-1200 System Manual
V4.4 11/2019, A5E02486680-AN

Тэги:

#Siemens_S7-1200_Modbus_TCP/IP #Siemens_S7-1200_PLC_to_Arduino
Ссылки и html тэги не поддерживаются


Комментарии:

arefr rafiee
arefr rafiee - 04.11.2023 07:17

Thanks for this great tutorial. Are you sure about the the terminology you explained in the beginning of the video? I think Modbus server and Modbus Master are almost the same thing. It is correct for Modbus client and Modbus slave. But you mentioned something different. Could you check that please?

Ответить
Rolando Espino
Rolando Espino - 27.09.2023 23:03

Have you ever used the library Settimino to make a conection Arduino - PLC?
Great tutorial btw

Ответить
Thuận Huỳnh Thành
Thuận Huỳnh Thành - 07.03.2023 08:09

can you show me how to code when i have two more potentiometer, please help me

Ответить
DeKempster
DeKempster - 02.10.2022 18:56

Wait whut, slave = server and master = client. Who thought that was a good naming scheme.

Ответить
Marek Latus
Marek Latus - 16.09.2022 23:41

Great tutorial

Ответить
KAMUGISHA JOSEPH
KAMUGISHA JOSEPH - 23.08.2022 18:09

thanks sir for the nice video.
how do i configure my Arduino as master in tia potal?
thanks

Ответить
Time4yes
Time4yes - 21.05.2022 23:15

Sir, can I connect arduino shield straight to my laptop,So that it acts as the real plc? I don't have enough money to buy s7-1200.

Ответить
Mark Lee
Mark Lee - 10.05.2022 21:20

I’m hoping this works over WiFi connection between S7 and Arduino?

I have an Arduino Braccio shield on top of a Uno WiFi R2, adding the Ethernet shield causes the Braccio (robot arm) to fail.

Ответить
q zorn
q zorn - 28.04.2022 01:33

do have one on esp32 serial2 modbus rtu rs485 19200n1 master read input-registers 30001 30002 from slave-1 digital panel-meter-modbus then display the values serial monitor?
great modbus video, thank you 🙂

Ответить
Mark Bartolome
Mark Bartolome - 05.04.2022 04:51

Hello sir, can you please help me on how to communicate the laptop and arduino using modbus protocol.

Ответить
Anis Hassen
Anis Hassen - 28.02.2022 12:26

hello please can you help me about communication between esp 32 arduino and interface HMI

Ответить
David M
David M - 24.01.2022 03:01

I have tried to port this code to the rp2040. The rp2040 uses ‘C’ code and I needed to modify the headers. Unfortunately I was not able to adapt the code.

I wonder if anyone else has tried to port the Modbus tcp code to stm32 or rp2040 (I feel I’ve that they are both arm cortex M0).

Ответить
Aakash Malhi
Aakash Malhi - 24.08.2021 11:43

would be really helpful if you would give us the link for the libraries you downloaded in Arduino IDE

Ответить
Wafatikhur Rosyad
Wafatikhur Rosyad - 11.08.2021 08:45

Thanks for the tutorial, im using ESP32 instead of arduino with ethernet shield. Thank you so much

Ответить
MoKa
MoKa - 02.06.2021 23:54

Hi, at home my code is working but when I do a ping test, I don't have any signal you have any idea?

Ответить
Mohamed Amine SADKI
Mohamed Amine SADKI - 19.05.2021 17:55

Hello sir, first i would like to thank you for all your videos.
If you don't mind i have a question for you: actually i'm working on a project where i need to use Tia Portal as an HMI (with an S7-1200 which is already done and works for me), but the problem is i that can't connect my PLC directly to my system, so i have to use an Arduino between the PLC and my system. For that, is there a way to make the connection you already made between Aduino and PLC but these time conversly? what i mean is i need to send data from PLC (specifically my HMI) to my Arduino.
And thank you again for your time.

Ответить
Tristan Moraine
Tristan Moraine - 20.04.2021 18:11

Hi! Today, I've done a prototype to measure high currents (80kA) through a shunt and an external ADC, then the Arduino send that to a PLC 1200. Thanks to your (great) tutorial, I've done that in few hours.
Thank you very much!

Ответить