Quick Guide - siemens.asia · Step 7 Basic & SIMATIC S7-1200 Modbus TCP/IP client Unrestricted ©...

8
Quick Guide Handout 1 Quick Guide Step 7 Basic & SIMATIC S7-1200 Modbus TCP/IP client www.siemens.com/s7-1200 Unrestricted © Siemens AG 2017 Unrestricted © Siemens AG 2017 Page 2 SLT / DF FA Procedure : Modbus TCP/IP client Concept 3 Input Parameter and Output Parameter ของ MB_CLIENT 9 Compile and Download Program 11 Go online 12

Transcript of Quick Guide - siemens.asia · Step 7 Basic & SIMATIC S7-1200 Modbus TCP/IP client Unrestricted ©...

Page 1: Quick Guide - siemens.asia · Step 7 Basic & SIMATIC S7-1200 Modbus TCP/IP client Unrestricted © Siemens AG 2017  Unrestricted © Siemens AG 2017 Page 2 SLT / DF FA

Quick Guide

Handout 1

Quick Guide

Step 7 Basic & SIMATIC S7-1200

Modbus TCP/IP client

www.siemens.com/s7-1200 Unrestricted © Siemens AG 2017

Unrestricted © Siemens AG 2017

Page 2 SLT / DF FA

• Procedure : Modbus TCP/IP client Concept 3

• Input Parameter and Output Parameter ของ MB_CLIENT 9

• Compile and Download Program 11

• Go online 12

Page 2: Quick Guide - siemens.asia · Step 7 Basic & SIMATIC S7-1200 Modbus TCP/IP client Unrestricted © Siemens AG 2017  Unrestricted © Siemens AG 2017 Page 2 SLT / DF FA

Quick Guide

Handout 2

Unrestricted © Siemens AG 2017

Page 3 SLT / DF FA

Procedure : Modbus TCP/IP client Concept

สราง DB ส าหรบอานขอมลทไดจาก Power meter : “Data_Read”

สราง DB ส าหรบการConnect ทขา CONNECT ของ DB (MB_CLIENT)

ก าหนด tag name และ data type ใหกบ DB ทใชส าหรบการconnect

1

2

3

ก าหนด tag name และ data type ใหกบ “Data_Read”

4

สราง Data block : MB_CLIENT

ก าหนด Parameter

5

6

SIMATIC S7-1200

Modbus TCP/IP client

Ethernet /Modbus TCP/IP

SENTRON PAC4200

Modbus TCP/IP server

S7-1200 สามารถอานคาจาก Power meter ซงเปน Modbus TCP/IP ไดสงสด 8 station

8

S7-1200 อานคาจาก Power meter

(SENTRON PAC4200)

SENTRON PAC4200

Modbus TCP/IP server

SENTRON PAC4200

Modbus TCP/IP server

SENTRON PAC4200

Modbus TCP/IP server

1 2 3

Unrestricted © Siemens AG 2017

Page 4 SLT / DF FA

1. สราง DB ส าหรบอานขอมลทไดจาก Power meter

1 Double click to

Add new block

ตงชอใหกบ Data block

Click เลอก Data block 2

3

กด OK 4

Page 3: Quick Guide - siemens.asia · Step 7 Basic & SIMATIC S7-1200 Modbus TCP/IP client Unrestricted © Siemens AG 2017  Unrestricted © Siemens AG 2017 Page 2 SLT / DF FA

Quick Guide

Handout 3

Unrestricted © Siemens AG 2017

Page 5 SLT / DF FA

2. ก าหนด tag name และ data type ส าหรบ Data_Read

ตงชอ tag name ใน Data block

ก าหนด Data type ให tag name

กด Compile

1

2 3

Unrestricted © Siemens AG 2017

Page 6 SLT / DF FA

3. สราง DB ส าหรบการConnect ทขา CONNECT ของ FB (MB_CLIENT)

1 Double click to

Add new block

ตงชอใหกบ Data block

Click เลอก Data block 2

3

กด OK 4

Page 4: Quick Guide - siemens.asia · Step 7 Basic & SIMATIC S7-1200 Modbus TCP/IP client Unrestricted © Siemens AG 2017  Unrestricted © Siemens AG 2017 Page 2 SLT / DF FA

Quick Guide

Handout 4

Unrestricted © Siemens AG 2017

Page 7 SLT / DF FA

4. ก าหนด tag name และ data type ใหกบ DB ทใชส าหรบการconnect

1 ตงชอ tag name ใน Data block

2

3

ก าหนด Data type ให tag name

Data type : TCON_IP_v4

กด Compile

ใส IP Address ของ Power meter

Unrestricted © Siemens AG 2017

Page 8 SLT / DF FA

5.สราง Data block : MB_CLIENT

Double click ท Main block

Double click หรอ Drag & Drop

ตงชอ data block

กด OK

1

2

3

4

Page 5: Quick Guide - siemens.asia · Step 7 Basic & SIMATIC S7-1200 Modbus TCP/IP client Unrestricted © Siemens AG 2017  Unrestricted © Siemens AG 2017 Page 2 SLT / DF FA

Quick Guide

Handout 5

Unrestricted © Siemens AG 2017

Page 9 SLT / DF FA

Input Parameter and Output Parameter ของ MB_CLIENT

- DONE : อยในสถานะของ Block เมอท างานเสรจสน - BUSY : อยในสถานะก าลงสงค าสง - ERROR : อยในสถานะ Error

- STATUS : แสดงสถานะการท างานของ Block

- REQ : เมอคาเปน 1 คอ Block ถงจะท างาน - DISCONNECT : ตดการท างานของ Block

- MB_MODE : เลอกโหมด โดยท 0 คอ อานขอมล ,1 คอ เขยนขอมล - MB_DATA_ADDR : เรมอานขอมล ท address …..

- MB_DATA_LEN : ขนาดของขอมล (Word)

- MB_DATA_PTR : Data Block ส าหรบแสดงคาขอมล

- CONNECT : Data Block ส าหรบการเชอมตอกบ Device

Input parameter

Output parameter (Monitor value)

** ผใชงานสามารถศกษาเพมเตม โดยคลกท Block แลวกด F1 **

Unrestricted © Siemens AG 2017

Page 10 SLT / DF FA

Example of MODBUS Address from Energy meter

Ref : Appendix A.3 MODBUS, SENTRON PAC4200, System Manual, 09/2010, A5E02316180B-03

Offset is 1, then MODBUS address will be 40002

Page 6: Quick Guide - siemens.asia · Step 7 Basic & SIMATIC S7-1200 Modbus TCP/IP client Unrestricted © Siemens AG 2017  Unrestricted © Siemens AG 2017 Page 2 SLT / DF FA

Quick Guide

Handout 6

Unrestricted © Siemens AG 2017

Page 11 SLT / DF FA

6. ก าหนด Parameter

- DONE : “MB_Client_DB_1”.DONE

- BUSY : “MB_Client_DB_1”.BUSY

- ERROR : “MB_Client_DB_1”.ERROR

- STATUS : “MB_Client_DB_1”.STATUS

- REQ : 1

- DISCONNECT : 0

- MB_MODE : 0

- MB_DATA_ADDR : 40002

- MB_DATA_LEN : 15

- MB_DATA_PTR : “Data_Read”.Read

- CONNECT : “Connect_ModbusTCP_IP”.Connect

Input parameter

Output parameter (Monitor value)

ใสคา Parameters ตางๆ ดงน

Unrestricted © Siemens AG 2017

Page 12 SLT / DF FA

Compile and Download Program

Compile Program Download Program

Page 7: Quick Guide - siemens.asia · Step 7 Basic & SIMATIC S7-1200 Modbus TCP/IP client Unrestricted © Siemens AG 2017  Unrestricted © Siemens AG 2017 Page 2 SLT / DF FA

Quick Guide

Handout 7

Unrestricted © Siemens AG 2017

Page 13 SLT / DF FA

Go online

ตวอยาง การอานคาจาก Power meter

ทเปน Modbus TCP/IP

กด Go online 1 กด Monitor all 2

Unrestricted © Siemens AG 2017

Page 14 SLT / DF FA

Reference

Application example

Data Communication between S7-1200 and

SENTRON PAC3200 via MODBUS TCP (Set 22)

Entry ID: 40614428, Entry date: 07/04/2017

Download link

Switching Loads with S7-1200 and SENTRON

PAC3200 via MODBUS TCP (Set 24)

Entry ID: 58856464, Entry date: 07/24/2013

Download link

Energy Data Acquisition with the

Energy Meter of the S7-1200

Entry ID: 109739414, Entry date: 11/02/2016

Download link A5E02316180B-03

Page 8: Quick Guide - siemens.asia · Step 7 Basic & SIMATIC S7-1200 Modbus TCP/IP client Unrestricted © Siemens AG 2017  Unrestricted © Siemens AG 2017 Page 2 SLT / DF FA

Quick Guide

Handout 8

Unrestricted © Siemens AG 2017

Page 15 SLT / DF FA

SIMATIC S7-1200 : Application example https://support.industry.siemens.com/cs/products?ps=100&dtp=ExampleOfUse&mfn=ps&pnid=13683&lc=en-WW

The TIA Portal Tutorial Center (videos) https://support.industry.siemens.com/cs/document/106656707/the-tia-portal-tutorial-center-(videos)?dti=0&pnid=13683&lc=en-WW

Industry Online Support https://support.industry.siemens.com/cs

Automation task in 10 minutes or less https://www.youtube.com/watch?v=0MhJfAtkcJI&list=PLC76AD9A5EF6E8212

SIMATIC S7-1200 : Manual https://support.industry.siemens.com/cs/products?dtp=Manual&mfn=ps&pnid=13683&lc=en-US

Reference

Unrestricted © Siemens AG 2017

Page 16 SLT / DF FA