📄 Connect: PLCs -> Ignition OPC-UA Server

🔧 Design Document: Siemens PLC Tag Acquisition via S7 Protocol

1. 🎯 Purpose & Scope

ฟังก์ชันนี้ทำหน้าที่อะไร?

เชื่อมต่อ PLC Siemens (S7-1200 / S7-300) เข้ากับระบบ SCADA (Ignition) เพื่ออ่านค่าจาก PLC แบบ Real-time และส่งต่อเข้าสู่ระบบ Visualization และ Historical Storage

ทำไมถึงต้องมีฟังก์ชันนี้ในระบบ?

เพื่อให้สามารถ Monitor และวิเคราะห์ข้อมูลจาก Production Line ได้แบบ Real-time รวมถึงเก็บข้อมูลเพื่อใช้งานในระบบ Traceability และ Reporting

ขอบเขตการทำงานของฟังก์ชันนี้คืออะไร?

  • เชื่อมต่อ PLC ทั้งหมด 5 ตัว

  • ใช้ Siemens S7 TCP Driver ของ Ignition

ใครเป็นผู้รับผิดชอบ/เกี่ยวข้องกับการพัฒนา?

  • Siwadon Klungdongkeng

2. 🎯 Goals and Non-goals

Goals:

  • ระบบต้องสามารถเชื่อมต่อกับ PLC ได้ทุกเครื่อง (SM1-8)

  • อ่านข้อมูลจาก Data Block, Memory, Input/Output ได้อย่างถูกต้อง

🚫 Non-goals:


3. 📥 Inputs and 📤 Outputs of Function

Inputs:

  • ข้อมูลจาก PLC

Outputs:

  • สามารถอ่านค่าจาก PLC บน Ignition ได้

4. 🧩 Architecture / System Design / Flow / Technical Detail / How to

🛠️ How to: ดึงข้อมูลจาก Siemens S7-300 และ S7-1200 เข้าสู่ Ignition

✅ สิ่งที่ต้องเตรียมก่อนเริ่ม

รายการรายละเอียด
✅ PLCSiemens S7-1200 / S7-300 เปิดใช้งาน Communication และมี IP แล้ว
✅ Networkทั้ง PLC และ Ignition อยู่ในเครือข่ายเดียวกัน (เช่น 192.168.0.x)
✅ Ignition SCADAติดตั้งเรียบร้อยแล้ว และเข้าถึง Gateway Web ได้
✅ Siemens Driverใช้งาน “Siemens TCP Driver” (มากับ Ignition โดย Default)
✅ Address Mappingทราบว่าอยากดึงค่าจาก Address ไหน (เช่น DB1.DBW0, M10.0)


🧩 Step-by-Step

🔹 Step 1: ตั้งค่า PLC ให้รับการสื่อสาร

S7-300 (Classic Step7 หรือ TIA Portal):

  • ตั้ง IP address ของ CPU

  • ตรวจสอบว่า Slot = 2 (ส่วนใหญ่ S7-300 อยู่ Slot 2)


S7-1200 (TIA Portal):

  • ตั้ง IP address และเปิดการใช้งาน “Full access”

  • ตั้งค่าความปลอดภัยให้ Allow all access (no protection)

  • เปิดใช้งาน PUT/GET CommunicationPUT/GET Communication (ถ้าใช้ S7-1200 หรือ S7-1500)

  • ตรวจสอบว่าใช้ Slot 1

💡 S7-300: Rack = 0, Slot = 2

💡 S7-1200: Rack = 0, Slot = 1

🔹 Step 2: เพิ่ม Device ใน Ignition

  1. เปิด Web Gateway ของ Ignition (เช่น http://192.168.0.98:8088)

  2. ไปที่เมนู Config > OPC UA > Device Connections

  3. กด “Create new Device”

  4. เลือกประเภท “Siemens S7-300/400 or S7-1200/1500”

ตั้งค่า Parameters:

Fieldค่า (S7-300 ตัวอย่าง)
NameSM5_S7_300
Hostname192.168.0.45
Rack0
Slot2
Timeout2000 ms (หรือ Default)

ทำแบบเดียวกันกับ S7-1200 แต่เปลี่ยน Slot เป็น 1

🔹 Step 3: สร้าง Tags ใน Ignition Designer

  1. เปิด Ignition Designer และ Connect Project

  2. ไปที่ OPC Browser → เลือก Device ที่สร้างไว้ (SM5_S7_300)

  3. Browse จนเจอ Data Block หรือ Memory ที่ต้องการ เช่น DB1, M10.0

  4. คลิกขวา → Create Tag > OPC Tag

  5. ตั้งชื่อ Tag, Data Type (Boolean, Int16, Float, etc.)


5. ⚠️ Risks / Limitations

  • ​เราจะไม่ไปแก้ข้อมูลบน PLC ลูกค้าเด็ดขาด

6. ❓ Open Questions / ToDo



7. 🧰 Tech Stack / Tools

หมวดหมู่รายละเอียด
RuntimeIgnition v8.1.x
CommunicationSiemens S7 Driver (OPC-UA TCP/ISO)

8. 🧠Key Design Decisions

  • เลือกใช้ Siemens S7 Driver ของ Ignition แทน OPC UA เนื่องจาก