Creating & Using Function block (FB) - siemens.asia · Function Block ... TIA Siemens - Edit View...
Transcript of Creating & Using Function block (FB) - siemens.asia · Function Block ... TIA Siemens - Edit View...
Creating & Using Function block (FB)
Totally Integrated Automation Portal
ก ำหนดช่ือใหก้บั Function Block “Ctrl_Motor”
Click OK
เสร็จแลว้ให ้Compile Function block
3
7
2
4
Click Function Block
สร้ำง tag name, data type และ start value (ถำ้มี) ส ำหรับเป็นขำ Parameter
“Input”, “Output” ของ FB
Double Click Add new block
5
Function Block ท่ีถูกสร้ำงข้ึน
1
เขียน Program ส ำหรับ control motor 6
Drag & Drop Function blockไปยงั Main [OB] 8
9
Click OK
1. สร้าง Function Block (FB) 2. สร้าง Tags ใน FB 3. เขียน Program ส าหรับ FB 4. Compile FB
ตั้งช่ือ Instant DB
Creating & Using Function block (FB)
Totally Integrated Automation Portal
ตวัอยำ่งกำรใช ้Function block เดียวกนั ส ำหรับกำร control Motor หลำยๆ ตวั
ส ำหรับกำร control Motor ตวัท่ี 1
ส ำหรับกำร control Motor ตวัท่ี 2
Go online test
เม่ือ “Start_M1” เท่ำกบั true (เป็นกำรสัง่ให ้Motor 1 ท ำงำน)
เม่ือ “Run_M1” เท่ำกบั true ดว้ย
เม่ือ “Start_M2” เท่ำกบั true (เป็นกำรสัง่ให ้Motor 1 ท ำงำน)
เม่ือ “Run_M1” เท่ำกบั true ดว้ย
เม่ือ “Stop_M1” เท่ำกบั true (เป็นกำรสัง่หยดุกำรท ำงำนของ Motor 1)
เม่ือ “Run_M1” เท่ำกบั false ดว้ย (หยดุกำรท ำงำน)
Function Block ท่ีไดจ้ำกสร้ำงข้ึน
By…Suwichada