How to Connect Siemens S7 1200 G2 Modbus RTU
Mehdi Sheikhy
0:00 / 0:00
How to Connect Siemens S7 1200 G2 Modbus RTU
812 просмотров · 3 месяца назад
Mehdi Sheikhy
30 подписчиков
812 просмотров · 3 месяца назад
⚠️ IMPORTANT: This video is specifically for the NEW Siemens [ S7-1200 G2 ] (Generation 2) PLC configured in [ TIA Portal V21 ], which has different Modbus behaviors compared to the older Gen 1!
📁 GitHub Source Code & Library:
(Copy and paste the line below into your browser)
github.com/mahdi-sheikhy/Siemens-S71200-ModbusRTU-MultiNode-Library
Struggling with Modbus RTU communication on the new Siemens [ S7-1200 G2 ] PLC? You are not alone! ⚙️ In this step-by-step tutorial, we go from scratch to establish a fully working bi-directional Modbus RTU connection: [ S7-1200 G2 ] ↔️ Siemens Sinamics V20 Inverter using [ TIA Portal V21 ].
The new [ GENERATION 2 ] S7-1200 has brought great features but also major headaches. Simple functions have changed, and security configurations can cause weeks of troubleshooting. I spent over a month figuring out the hidden bugs of this [ G2 ] setup so you don't have to!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔷 Key Topics Covered in This Video:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔸 [01] PLC Firmware Requirement ➡️ Emphasizing why the S7-1214 CPU MUST be on Version 4.1 for proper Modbus execution.
🔸 [02] Hardware RS485 Wiring ➡️ Correct connection of RA, RB, TA, TB (Why A & B fail!).
🔸 [03] TIA Portal V21 Configuration ➡️ Setting up the hardware identifier and network in V21.
🔸 [04] The "Hidden Bug" on [ G2 ] ➡️ Why you MUST manually change the MODE parameter to 4 in DB COMM_LOAD.
🔸 [05] Interpreting Status Codes ➡️ Understanding why 7000 and 7002 are NOT errors.
🔸 [06] Programming ➡️ Writing MB_COMM_LOAD & MB_MASTER from scratch.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
💎 مباحث مهم این ویدیو به زبان فارسی (ارتباط دوطرفه S7-1200 G2 ↔️ V20):
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔴 توجه: این ویدیو مخصوص پیالسیهای نسل جدید زیمنس [ S7-1200 G2 ] در [ TIA Portal V21 ] است و با نسل اول تفاوت دارد!
🔶 [۱] لزوم استفاده از فریمور نسخه ۴.۱ ➡️ تاکید بر اهمیت و علت اینکه چرا ورژن CPU حتماً باید ۴.۱ باشد.
🔶 [۲] سیمکشی سختافزاری ➡️ اتصال صحیح RA/TA و RB/TB برای سیگنال مثبت و منفی.
🔶 [۳] پیکربندی سختافزار در TIA Portal V21 ➡️ تنظیمات شبکه و کارت ارتباطی در نسخه ۲۱.
🔶 [۴] حل باگ نرمافزاری نسل [ G2 ] ➡️ تغییر دستی مقدار رجیستر MODE به عدد ۴ در بلاک COMM_LOAD.
🔶 [۵] بررسی کدهای وضعیت ➡️ توضیح کدهای ۷۰۰۰ و ۷۰۰۲ که خطا نیستند.
🔶 [۶] برنامهنویسی ➡️ نوشتن کامل برنامه چپگرد، راستگرد و فرکانس در TIA Portal V21.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⏱️ Video Chapters (زمانبندی ویدیو)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
00:00 ➡️ Introduction & Modbus Challenges in [ S7-1200 G2 ]
01:15 ➡️ Live Test: Speed Change, Run, Stop, and Reverse
03:13 ➡️ Hardware Configuration & TIA Portal V21 Setup for [ G2 ] CPU (Firmware v4.1 Requirement)
04:47 ➡️ TIA Portal Program Setup (MB_COMM_LOAD & MB_MASTER)
07:15 ➡️ The Load_Done Logic Explained
10:22 ➡️ Configuring Modbus Parameters on V20 Inverter
11:22 ➡️ Troubleshooting: Fixing the [ S7-1200 G2 ] DB Bug (Mode 4)
14:36 ➡️ Final Test & Verifying Port Status 7000
17:00 ➡️ RS485 Wiring Diagram (Correct RA/RB/TA/TB connections)
18:40 ➡️ Analyzing Done, Busy & Error signals in Trace
19:40 ➡️ About Mehdi Sheikhi (22 Years of Industrial Automation Experience)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
👨💻 About Me:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Hello, I am Mehdi Sheikhi. With over 22 years of hands-on experience in industrial automation, I have designed and executed countless projects using Siemens PLCs (from the classic S5 to S7-300, 400, and 1200/1500), Omron, Mitsubishi, Delta, Fatek, and more.
📧 If you have any questions or face troubleshooting issues in your projects, feel free to leave a comment!
🔔 Don't forget to LIKE, COMMENT, and SUBSCRIBE to support the channel for more deep-dive technical tutorials!
#S71200G2 #SiemensS71200G2 #S71200Generation2 #ModbusRTU #V20Inverter #TIAPortal #TIAPortalV21 #PLCProgramming #IndustrialAutomation #SiemensV20 #CM1241