Тёмный

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

Mario Crispino
Подписаться 2,2 тыс.
Просмотров 11 тыс.
50% 1

Welcome to a Siemens S7-1200 to Arduino Modbus TCP/IP Communications Video Part 4.
At the end of the last tutorial video we had completed the Arduino code and checked that it worked. Now we are going to start configuring and coding the Modbus TCP/IP Client side on the Siemens S7-1200 PLC.
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.
• Siemens S7-1200 Water ...
Siemens S7-1200 Water Tank Level Control Part 2.
• Siemens S7-1200 Water ...
To watch the Part 3 Video on Siemens S7-1200 Modbus TCP/IP Communications with Arduino see the link:
• Siemens S7-1200 to Ard...
There will be a link here to the next tutorial video in the series Water Tank Level control.
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.
factoryio.com/....
Details about my patreon account will be added here shortly.
The Siemens S7-1200 System Manual
V4.4 11/2019, A5E02486680-AN

Опубликовано:

 

14 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 53   
@erencakannn
@erencakannn 5 дней назад
Hi Mario, thanks for this nice work. I'm working on my thesis. I'm getting 16#80B6 error in MB_CLINE_DB status. I can't solve it. I think it's router. Can we connect Arduino and PLC directly without router?
@MarioCrispino
@MarioCrispino 5 дней назад
I had problems with some connectors, I guess it all depends on the wiring of your connectors. I actually just linked up an old modem in the end which worked well.
@Time4yes
@Time4yes 2 года назад
This is the best tutorial, I am really enjoying. I just wanted to ask, if I want to add other sensors from my arduino, does It mean I will have to make different PTR data blocks FOR every sensor or I can use one for multiple functions?
@MarioCrispino
@MarioCrispino 2 года назад
Wow, you must be really going for it! I wouldn't have thought so but I guess it depends what you are trying to do.
@MarioCrispino
@MarioCrispino 2 года назад
Glad you are enjoying it too.
@lex-ig7qu
@lex-ig7qu 6 месяцев назад
Well I have the same problem. At this moment I just created another mb_client block with diffrent data adress (30109) and its working as long as I choose between then. In other words I can monitor only one value in real time.
@aakashmalhi2114
@aakashmalhi2114 3 года назад
Hello Mario, you work is great.
@MarioCrispino
@MarioCrispino 3 года назад
Thank you Aakash, gald you like it
@ngocquangngo7253
@ngocquangngo7253 2 года назад
hi Mario, I want to transfer data a string of numbers like a barcode, can it be transferred from arduino to plc s7 1200 in string type?
@MarioCrispino
@MarioCrispino 2 года назад
I've never tried it but I don't see why not.
@mohitsingh5665
@mohitsingh5665 Год назад
thanks
@patrykmarchlewski1093
@patrykmarchlewski1093 Год назад
I'm building heat pump for the Bachelor of Science degree in Mechatronics Engineering and to avoid buying analog module for s7-1200(not enough analog inputs) i'm using arduino as a temperature card with 5* ds18b20 digital temperature sensors. The diffference from movie is to send values from variables in registers to PLC... Anyway i found out ethernet module wizz W5500 lite usr-es1 is not compatible with modbus libraries or im doing something wrong. i bought shield (waiting for delivery) which is used on your video and simmilar videos which i found on yt. I think its important note because i already lost 30h and after that i went other direction and built 2 web serwers from PLC and from Arduino, but to communicate properly and share variables cross-domains it would need another device for server, because web serwer in PLC doesnt have enough resources same as arduino... Thinking it would be better to buy that analog module for pt100 or Shield W5100 at begining. Meh, educational value is nice but wasting so much time not so. Module will come at wednesday and i will start over again... Thank you for sharing your wisdom.
@MarioCrispino
@MarioCrispino Год назад
Glad you enjoyed it
@patrykmarchlewski1093
@patrykmarchlewski1093 Год назад
Ok, so i made something wrong in code, I wrote it wrong way and it was my fault, still im not sure if it will work with that module which i was writting about. Im sure it wasnt working even with shield till i wrote good code. Now it working and sending data registers thru modbus tcp but i used arduino mega 2560 and shield from movie also i used modbuss poll tool to check if frames are correct. Before i changed code it shown illegall data adress. I used different libraries: SPI.h, Ethernet.h, ArduinoRS485(ArduinoModbus depends on the ArduinoRS485 library) and ArduinoModbus.h. Coudnlt find even 1 working code about data registers (found article it is difficult with arduino uno), most of examples are querstions how to do it propperly, anyway i did it :) and will post it somewhere when i done my heat pump project. Thank you again.
@MarioCrispino
@MarioCrispino Год назад
Well done Patryk, sounds like you know a lot more about than I do about the subject. Good luck with your project. Looking forward to seeing it.
@patrykmarchlewski1093
@patrykmarchlewski1093 Год назад
@@MarioCrispino Naaaa. Without your movie i woudnl't even know how setup modbus client in PLC, but thank you :) Thats really nice to hear someone appreaciate my hardwork :)
@MarioCrispino
@MarioCrispino Год назад
Glad I could help Patryk
@plant_paradox5663
@plant_paradox5663 Месяц назад
how fast is modbus tcp/ip?
@MarioCrispino
@MarioCrispino Месяц назад
It's quite old now so I guess it isn't that speedy. However, I haven't looked into it lately
@plant_paradox5663
@plant_paradox5663 Месяц назад
​@@MarioCrispino ok thanks for response
@李欣朋-u9d
@李欣朋-u9d Год назад
Hi Mario, I follow your step to setup my s7-1200 PLC and Arduino. But now I got a problem that my plc cannot read Arduino's A0 Value. The MB_CLIENT's STATUS number sometimes show "16#7005", "16#7006" or "16#8383". It seems that 7005 and 7006 is send and receive status. But I don't know how to fix 16#8383 in STATUS number. Can you give me some advice to fix this problem? thanks!
@lex-ig7qu
@lex-ig7qu 6 месяцев назад
Have you checked if your data lenght is corred to the date base? I had the same issue I just modify the lenght of data in mb_client
@joseneyargonsula732
@joseneyargonsula732 2 года назад
Hi Mario, 1 would like to have the arduino to be a modbus client and get the data from the PLC, is it possible? also, is factory IO can also be use as a workstation or a SCADA? thanks in advance.
@MarioCrispino
@MarioCrispino 2 года назад
Hi Joseney. You can switch which is the client and server. As for Factory I/O, I only use a fraction of what it is capable of. If you need to know more in depth information about the product I would recommend going to their website.
@joseneyargonsula732
@joseneyargonsula732 2 года назад
@@MarioCrispino Thanks Mario, I would love to try once I get hold of "W5100".to be as a Client. Cheers!!!
@moka6682
@moka6682 3 года назад
Hi, I reproduced exactly the same manipulations when in the tutorial but it doesn't work. My MB_CLIENT displayed three alternating errors, 7001, 7002 and 80A4. I don't understand where it comes from because by pinging my arduino and my CPU I get feedback. You would have an idea because I'm going crazy .. Thank you
@MarioCrispino
@MarioCrispino 3 года назад
Hi Mo. Don't worry, take a break from it for a while. I had lots of problems getting this to work as there are so many components involved. If you look at other comments you are not alone but eventually everyone gets it working. It is quite easy to forget one step and that being the case it won't work.
@delgado9136
@delgado9136 3 года назад
Hey MoKa, have you entered the correct IP address of arduino to PLC?
@MarioCrispino
@MarioCrispino 3 года назад
Thanks for helping out Delgado, much appreciated.
@Trungkienelectronic
@Trungkienelectronic 2 года назад
PLC S7-1200 is TCP Client and Arduino is TCP Server. Is there any program Arduino is TCP Client?
@MarioCrispino
@MarioCrispino 2 года назад
Sorry Tràn, this is the only video I’ve done to explain which is client and server. All the best
@asifislam7376
@asifislam7376 11 месяцев назад
This is the best tutorial.. Can u help me please.. I have some question..
@MarioCrispino
@MarioCrispino 11 месяцев назад
You could ask but it was a long time ago now and I may not be able to help
@asifislam7376
@asifislam7376 11 месяцев назад
@@MarioCrispino i have some value in DB.. How to move this in holding register..so i can read the value
@fransvanenschot3286
@fransvanenschot3286 3 года назад
Hi Mario, i am a big fan from you, and i have follow all you tutorials with pleasure. i am impressed how relaxed you do that. i have follow this two modbus tutorials step by step several times, but every time i ended with the same error. my modebus send not correctly the data to my PLC. The MB_DATA_PTR stay on zero and the status give an 80A4 message. i think there is something wring with my IP address, but i don't know what. Because my route address is 192.168.178.1, i have used 192.168.178.120 for sent over the data from my arduino Mega 2560 to my PLC S71212. Also my serial data looks ok. What could be wrong? Best regards Frans
@MarioCrispino
@MarioCrispino 3 года назад
Hi Frans Sometimes I've noticed it can take a while for the PLC to read the information but it usually starts working a few seconds later. Before you get into the PLC part, are you able to ping the Arduino from your pc on the same network?
@MarioCrispino
@MarioCrispino 3 года назад
I have to say, the Modbus tutorials were quite difficult to actually get working correctly as there are many factors involved. My hub was a problem for a while and I had to change it to an old router I had. My original hub would communicate between Siemens equipment but not with the arduino. Then I had a faulty potentiometer and needed to order another.
@fransvanenschot3286
@fransvanenschot3286 3 года назад
@@MarioCrispino yes when i use on both sites ip 192.168.0.50 i see when i ping 4 times reply from 192.168.0.50: bytes=32 time
@MarioCrispino
@MarioCrispino 3 года назад
I see you have changed the network. If the ping works then that is promising. Does the Arduino print the values to the serial monitor ok?
@fransvanenschot3286
@fransvanenschot3286 3 года назад
@@MarioCrispino Yes the serial monitor is also working, when i change the potentiometer the value is also changing from 0 to 1024. I have also swapped from Arduino Mega 2560 to Arduino Uno with the same result what i expected.
@delgadojohan196
@delgadojohan196 3 года назад
Hello Mario, nice tutorial.. So i have follow your tutorial but my s7 1200 didn't receive any value from my arduino mega. My arduino IP : 192.168.0.3 My s7 1200 IP : 192.168.0.1 My PC IP : 192.168.0.109 Can you help me to solve this problem? Is there any solution?
@MarioCrispino
@MarioCrispino 3 года назад
Hi Delgado, I found it difficult to get working myself at first. I had problems with my potentiometer and the shield, I had to replace them before it would work. I also had a router problem in that my PC would talk to my PLC but not to the Arduino so I had to replace the router too. I'm not saying this is the problem with yours but you need to make sure each device is working before connecting all together. It took me a while and was very frustrating.
@delgadojohan196
@delgadojohan196 3 года назад
@@MarioCrispino I can ping my arduino, router, and my PLC. But in the MB_CLIENT_DB, the ERROR is always TRUE and the BUSY always false. There are no error code.. Edit : I found the error code. Its 16#80CE. The problem is I have already entered the same IP number in TCON_IP_v4 with my arduino's ping.
@MarioCrispino
@MarioCrispino 3 года назад
That doesn't sound good Delgado. Not sure I would know why this is but have you unticked Optimised Block Access?
@delgado9136
@delgado9136 3 года назад
@@MarioCrispino Sorry for late reply, I was busy with my thesis project. I finally solved the problem, the problem was I forgot to tick the "retain". Anyways thank you very much for the tutorial. Its very helpful for me to do my thesis project for monitoring using PLC.
@MarioCrispino
@MarioCrispino 3 года назад
Glad you found the problem
@thuanhuynhthanh9680
@thuanhuynhthanh9680 Год назад
please help me,how can i contact you to ask some questions
Далее
КАК УСТРОЕН TCP/IP?
31:32
Просмотров 171 тыс.
PLC S7-1200 Modbus TCP/IP Server full tutorial
39:38
Flawless PCB design: RF rules of thumb - Part 1
15:45
💢 S7 1200 As Modbus Tcp Client V4.1
22:42
Просмотров 140 тыс.