Quick Guide Step 7 Basic & SIMATIC S7-1200 Energy Meter Module … · Quick Guide 1 Quick Guide...
Transcript of Quick Guide Step 7 Basic & SIMATIC S7-1200 Energy Meter Module … · Quick Guide 1 Quick Guide...
Quick Guide
1
Quick Guide
Step 7 Basic & SIMATIC S7-1200
Energy meter module SM1238
Read Energy by RDREC instruction
www.siemens.com/s7-1200 Unrestricted © Siemens AG 2017
Unrestricted © Siemens AG 2017
Page 2 SLT / DF FA
• Read energy data by “RDREC” instruction Concept 3
• Measured value data record :
Base measurements data record (DS 142) 5
• Parameter of “RDREC” Instruction 9
• Compile & Download Program 11
• Go Online test 12
Quick Guide
2
Unrestricted © Siemens AG 2017
Page 3 SLT / DF FA
Procedure : Read energy data by “RDREC” instruction Concept
ก ำหนด Parameter ต่ำง ๆ ของ RDREC instruction
Add UDT of Data record 142
ก ำหนด tag name และ data type ใหก้บั tag ท่ีใชส้ ำหรับ record data ท่ีอ่ำนค่ำได ้
1
2
3
สร้ำง DB ส ำหรับเก็บค่ำท่ีอ่ำนมำจำก Energy meter module SM1238
4
Insert “RDREC” instruction to Network in Main [OB1] 5
SIMATIC S7-1200
SIMATIC S7-1200 Energy meter module SM1238
Add PLC และ Energy meter module SM1238
6
Unrestricted © Siemens AG 2017
Page 4 SLT / DF FA
SM1238 : Energy meter module
Quick Guide
3
Unrestricted © Siemens AG 2017
Page 5 SLT / DF FA
1. Add PLC และ Energy meter module SM1238
Drag & Drop
Unrestricted © Siemens AG 2017
Page 6 SLT / DF FA
Measured value data record : Base measurements data record (DS 142)
Base measurements data record (DS 142) • data record number เท่ำกบั “142” • Maximum length เท่ำกบั “214” (byte)
data record number
มี data ทั้งหมด เท่ำกบั 214 byte
Quick Guide
4
Unrestricted © Siemens AG 2017
Page 7 SLT / DF FA
2. สร้าง DB ส าหรับเก็บค่าที่อ่านมาจาก Energy meter module SM1238
เลือก Data block
ก ำหนดช่ือให้กบั Data block
Double Click Add new block
Click OK
Unrestricted © Siemens AG 2017
Page 8 SLT / DF FA
3.Add UDT of Data record 142
Add UDT ของ Data record 142โดยกำร Drag & Drop
Quick Guide
5
Unrestricted © Siemens AG 2017
Page 9 SLT / DF FA
4.ก าหนด tag name และ data type ให้กับ tag ที่ใช้ส าหรับ record data ที่อ่านค่าได้
ก ำหนดช่ือ tag เป็น EnergySM1238_DS142
เลือก Data type เป็น typeSM1238DS142
Unrestricted © Siemens AG 2017
Page 10 SLT / DF FA
5.Insert “RDREC” instruction to Network in Main [OB]
Click OK
Double Click Main [OB] Drag & Drop “RDREC” instruction to Network
1 2
3
Quick Guide
6
Unrestricted © Siemens AG 2017
Page 11 SLT / DF FA
Parameter of “RDREC” Instruction
• REQ ส ำหรับ executed กำรท ำงำนของ block ให้มีกำรรับส่งขอ้มูล • ID Hardware identifier ของ hardware module • INDEX data record number ท่ีใช ้• MLEN Maximum length (byte) ของขอ้งมูลทั้งหมดท่ีจะอ่ำนค่ำ • RECORD Data block ท่ีสร้ำงข้ึนส ำหรับเก็บค่ำท่ีอ่ำนมำ
Input Parameter
• VALID แสดงสถำนะวำ่ไดรั้บ new data record เสร็จสมบูรณ์ • BUSY แสดงสถำนะวำ่กระบวนกำรท ำกำรอ่ำนยงัไม่เสร็จสมบูรณ์ • ERROR แสดงสถำนะวำ่มี error เกิดข้ึน • STATUS แสดง Block status หรือ ขอ้มูลเลขสถำนะของ error ท่ีเกิด
ข้ึนขณะนั้น • LEN Length ของขอ้มูล data record ท่ีอ่ำนค่ำ
Output Parameter
Unrestricted © Siemens AG 2017
Page 12 SLT / DF FA
6.ก าหนด Parameter ต่างๆ ของ RDREC instruction
Base measurements data record (DS 142) • data record number เท่ำกบั “142” • Maximum length เท่ำกบั “214” (byte)
Double Click Default tag table
Click System constants
Drag & Drop tag ของ Hardware identifier ของ Energy Meter ท่ีใช้
Drag & Drop Parameter ท่ีจะ record ค่ำท่ีอ่ำนได ้
Quick Guide
7
Unrestricted © Siemens AG 2017
Page 13 SLT / DF FA
Compile & Download Program
Compile Program Download Program
Unrestricted © Siemens AG 2017
Page 14 SLT / DF FA
Go online test
Click Monitoring All
Double Click DB: “EnergyData”
Quick Guide
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