SlideShare a Scribd company logo
1 of 62
Download to read offline
‫مدرس‬:‫اکبری‬ ‫صادق‬
Tel. 09123182734
SIMATIC PCS7 Training
CFC Language
‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬
‫نیرو‬ ‫آب‬-‫پاییز‬96
‌‫‌های‌پیکربندی‌یک‌چارت‬‫م‬‫گا‬CFC
‌‫چارت‬CFC
‌‫ایجاد‌چارت‬CFC
‌‫کار‌با‌ویرایشگر‬CFC
‫پنجره‌کاتالوگ‬
‫‌های‌از‌قبل‌آماده‌شده‬‫ک‬‫فانکشن‌بال‬
‫نوع‌فانکشن‌بالک‬
‌‫درج‌یک‌فانکشن‌بالک‌به‌یک‬CFC
‫مشخصات‌یک‌فانکشن‌بالک‬
‌‫‌های‌ورودی‬‫ه‬‫پای‬‌/‫خروجی‌بالک‬
‫اتصال‌ورودی‬/‫‌های‌بالک‬‫ی‬‫خروج‬
‫اتصال‌متنی‬
‫کتابخانه‌پروژه‬
‫‌های‌یک‌چارت‬‫ک‬‫‌بال‬‫ن‬‫‌آوری‌فانکش‬‫ز‬‫برو‬
‌‫‌های‌نوع‬‫ک‬‫فانکشن‌بال‬Multi Instance
‌‫‌های‬‫ک‬‫بال‬OB
‌‫‌ها‬‫ک‬‫‌بال‬‫ن‬‫اجرای‌فانکش‬RunSequence
‌‫گروه‌اجرایی‬RuntimeGroup
‫‌ها‬‫ک‬‫‌سازی‌اجرای‌بال‬‫ه‬‫بهین‬
‫کامپایل‌و‌دانلود‌چارت‬
‫مدرس‬:‫اکبری‬ ‫صادق‬
Tel. 09123182734
SIMATIC PCS7 Training
CFC Language
‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬
‫نیرو‬ ‫آب‬-‫پاییز‬96
‫چکیده‬CFC‌‫برگرفته‬‌‫از‌سه‬‫کلمه‬ContinuousFunction Chart‫‌باشد‬‫ی‬‫م‬‌.‌‫که‌مهمترین‌ابزار‌برنامه‬‫نویسی‬PCS7‌‫به‬
‌‫شمار‬‫‌رود‬‫ی‬‫م‬‌.‌‫این‌ابزار‬‌‫همان‌طور‬‌‫که‌از‌اسمش‌پیداست‌برای‬‫‌سازی‌الجیک‌کنترل‌پیوس‬‫ه‬‫پیاد‬‌‫ته‌به‬
‌‫کار‬‌‫‌رود‬‫ی‬‫م‬‌.‌‫ابزار‌دیگر‌برنامه‌نویسی‌در‬PCS7،‌‫‌های‬‫ت‬‫چار‬SFC‌‫نام‬‌‫دارد‌که‌برای‌کنترل‌ترتیبی‬
(Sequential‌)‫‌باشد‬‫ی‬‫م‬.
‌‫در‬‌‫این‌فصل‌با‌مواری‌مانند‌نحوه‌کار‌با‌ویرایشگر‬CFC،‫‌بالک‬‫ن‬‫مفاهیم‌پایه‌فانکش‬‌.‌‌‫نحوه‌درج‬
‌‫‌های‬‫ت‬‫‌ها‌در‌چار‬‫ک‬‫‌بال‬‫ن‬‫فانکش‬CFC‌‫و‬‌‫کامپایل‌و‌دانلود‌آنها‌به‬CPU‌‫آشنا‬‌‫شده‌و‌در‌نهایت‌با‌نحوه‬
‌‫‌ها‌در‬‫ک‬‫تست‌بال‬‫زمان‬Runtime‌‫کار‬‫خواهیم‌کرد‬.
‫مدرس‬:‫اکبری‬ ‫صادق‬
Tel. 09123182734
SIMATIC PCS7 Training
CFC Language
‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬
‫نیرو‬ ‫آب‬-‫پاییز‬96
‫مدرس‬:‫اکبری‬ ‫صادق‬
Tel. 09123182734
SIMATIC PCS7 Training
CFC Language
‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬
‫نیرو‬ ‫آب‬-‫پاییز‬96
‫کنترل‬‫فرآیند‬‫کنترل‬‫عملیات‬‫یک‬‫فرآیند‬‫به‬‫سه‬‫صورت‬‫کلی‬،‫پیوسه‬‫ترتیبی‬‫و‬‫ترکیبی‬‫از‬‫این‬‫دو‬‫‌تواند‬‫ی‬‫م‬‫انجام‬
‫شود‬.‫بیشتر‬‫عملیات‬‫یک‬‫پلنت‬‫فرآیندی‬‫توسط‬‫فرآیندهای‬‫پیوسته‬‫توصیف‬‫‌شو‬‫ی‬‫م‬‫د‬.‫این‬‫موضوع‬‫با‬
‫ایجاد‬‫‌های‬‫ت‬‫چار‬CFC‫در‬‫ویرایشگر‬CFC‫سیستم‬PCS7‫محقق‬‫‌شود‬‫ی‬‫م‬.
‫چارت‬CFC‫برنامه‬‫کنترل‬‫به‬‫زبان‬CFC‫برای‬‫کنترل‬‫عملیات‬،‫پیوسته‬‫که‬‫بایستی‬‫به‬‫طور‬‫مداوم‬‫توسط‬CPU‫اسکن‬‫و‬
‫پردازش‬،‫شود‬‫به‬‫کار‬‫‌رود‬‫ی‬‫م‬.
‫چارت‬CFC‫‌ترین‬‫م‬‫مه‬‫ابزار‬‫‌نویسی‬‫ه‬‫برنام‬PCS7‫‌باشد‬‫ی‬‫م‬.
‫چارت‬CFC‫یکی‬‫از‬‫اجزاء‬‫قابل‬‫درج‬‫در‬‫محیط‬SIMATIC Manager‫‌باشد‬‫ی‬‫م‬.
‫توسط‬‫ویزارد‬‫ایجاد‬‫پروژه‬‫به‬‫صورت‬‫خودکار‬‫در‬‫سطوح‬‫پلنت‬‫ایجاد‬‫‌گردد‬‫ی‬‫م‬.
‫بهتر‬‫است‬‫چارت‬CFC‫را‬‫در‬‫محیط‬Plant View‫ایجاد‬‫کرد‬.
‫توصیه‬‫‌شود‬‫ی‬‫م‬‫که‬‫نام‬‫هر‬‫چارت‬CFC‫پس‬‫ایجاد‬‫چارت‬‫تغییر‬‫یابد‬.
‫برای‬‫‌سازی‬‫ه‬‫پیاد‬‫برنامه‬‫کنترل‬‫یک‬‫پلنت‬‫با‬‫‌های‬‫ت‬‫چار‬CFC‫دو‬‫روش‬‫وجود‬‫دارد‬:
‫‌سازی‬‫ه‬‫پیاد‬‫کنترل‬‫تمام‬‫‌ها‬‫ش‬‫بخ‬‫و‬‫سطوح‬‫فرآیندی‬‫در‬‫یک‬CFC
‫نوشتن‬‫برنامه‬‫کنترل‬‫هر‬‫سطح‬‫از‬‫پلنت‬‫در‬‫یک‬CFC‫جداگانه‬
‫ایجاد‬‫چارت‬‫برای‬‫ایجاد‬‫و‬‫تکمیل‬‫‌های‬‫ت‬‫چار‬CFC،‫‌های‬‫ک‬‫بلو‬‫واقع‬‫در‬‫کتابخانه‬PCS7‫در‬‫‌های‬‫ت‬‫چار‬CFC‫درج‬
‫‌شوند‬‫ی‬‫م‬.‫که‬‫شامل‬‫بلوک‬‫کنترل‬‫فرایند‬‫و‬‫‌های‬‫ک‬‫بال‬‫مانیتورینگ‬‫مقادیر‬‫فرایندی‬‫‌باش‬‫ی‬‫م‬‫د‬.‫پس‬‫از‬‫درج‬
‫‌ها‬‫ک‬‫بال‬‫در‬‫محیط‬CFC،‫ورودی‬‫و‬‫‌های‬‫ی‬‫خروج‬‫این‬‫‌ها‬‫ک‬‫بلو‬‫به‬‫طور‬‫مستقیم‬‫در‬‫ویرایشگر‬CFC‫به‬‫هم‬
‫متصل‬‫و‬‫‌های‬‫ر‬‫پارامت‬‫‌ها‬‫ک‬‫بال‬‫مقداردهی‬‫‌شود‬‫ی‬‫م‬.
ProcessTag‫تجهیزات‬‫فرایندی‬‫مثل‬‫موتور‬‫و‬‫وولو‬(Motors and Valves)‫از‬‫دیدگاه‬PCS7،‫با‬‫عنوان‬Process Tag‫شناخته‬
‫‌شوند‬‫ی‬‫م‬.‫برای‬‫کنترل‬‫چنین‬،‫تجهیزاتی‬‫از‬‫قبل‬‫در‬‫کتابخانه‬PCS7،‫‌های‬‫ت‬‫چار‬CFC‌‫ت‬‫تح‬‫عنوان‬Process
TagType‫آماده‬‫شده‬‫است‬.‫که‬‫در‬‫‌های‬‫ه‬‫کتابخان‬‫استاندارد‬‫در‬‫شاخه‬Template‫‌اند‬‫ه‬‫‌شد‬‫ی‬‫‌بند‬‫ه‬‫دست‬.
‫برای‬‫حفظ‬‫روشن‬‫ساختار‬‫پروژه‬‫مطابق‬‫با‬‫سطوح‬‫فرایندی‬،‫پلنت‬‫‌های‬‫ت‬‫چار‬CFC‫همیشه‬‫در‬
‫‌های‬‫ه‬‫پوش‬‫سلسله‬‫مراتبی‬‫پلنت‬(PH)‫ایجاد‬‫و‬‫نگهداری‬‫‌شوند‬‫ی‬‫م‬.
‫مدرس‬:‫اکبری‬ ‫صادق‬
Tel. 09123182734
SIMATIC PCS7 Training
CFC Language
‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬
‫نیرو‬ ‫آب‬-‫پاییز‬96
CFC Charts
 Theblockinstancesyouneedtosolvea technologicaltaskdefinition can bedividedinto anynumberof charts.
 A CFC chartconsists ofsix pages(overview display)
 1pageconsistsof a workarea andtwomarginalbars.
 Automatic,chart-spanningmarginal barmanagement
 User-friendly signal monitoring
 AutoRoute
 Resourcesare completely managedfor theuser.
 1to1 documentationfor theentire information contents
In principle, there are three basic steps:
1. Creating empty CFC charts in the plant hierarchy
2. Copy Blocks from PCS7 Libraries to Master data Library
– Inserting individual blocks from MDL in an empty CFC chart
3. Interconnecting the inputs and outputs of blocks and assigning parameter values tothem
‫ویرایشگر‬CFC‫یک‬‫ابزار‬‫گرافیکی‬‫برای‬‫نوشتن‬‫‌های‬‫ه‬‫برنام‬PLC‫با‬‫زبان‬CFC‫‌باشد‬‫ی‬‫م‬.
‫ایجاد‬‫برنامه‬‫کنترل‬‫با‬‫درج‬(Insert)‫‌های‬‫ک‬‫بال‬‫از‬‫قبل‬‫آماده‬‫شده‬‫در‬‫یکی‬‫از‬‫‌ها‬‫ت‬‫شی‬‫و‬‫اتصال‬‫ورودی‬/‫خروجی‬‫آنها‬‫به‬‫هم‬‫صورت‬
‫‌گیرد‬‫ی‬‫م‬.‫اتصاالت‬‫ممکن‬‫شامل‬:
‫بین‬‫فیلدهای‬IO‫در‬‫یک‬‫شیت‬‫یک‬‫چارت‬
‫بین‬‫‌های‬‫ک‬‫بال‬‫تابع‬‫درون‬‫‌ها‬‫ت‬‫چار‬
‫استفاده‬‫از‬Margin bar‫برای‬‫مدیریت‬‫‌های‬‫ل‬‫سیگنا‬‫مبداء‬‫و‬‫مقصد‬
‫مزایا‬
‫زبان‬‫برنامه‬‫نویسی‬‫برای‬‫مهندسین‬‫طراح‬
‫سرعت‬‫بخشیدن‬‫به‬‫‌سازی‬‫ه‬‫پیاد‬‫برنامه‬،‫کنترل‬‫دیباگ‬‫کردن‬‫و‬‫‌اندازی‬‫ه‬‫را‬
‫مدرس‬:‫اکبری‬ ‫صادق‬
Tel. 09123182734
SIMATIC PCS7 Training
CFC Language
‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬
‫نیرو‬ ‫آب‬-‫پاییز‬96
‫ویرایشگر‬CFC‫با‬‫دابل‬‫کلیک‬‫روی‬‫یک‬‫چارت‬CFC‫باز‬‫‌شود‬‫ی‬‫م‬.
‫چارت‬‫باز‬‫شده‬‫شامل‬‫یک‬‫شیت‬‫خالی‬(A)‫با‬‫شش‬‫قسمت‬‫برای‬‫قرار‬‫دادن‬‫‌های‬‫ک‬‫بال‬‫برنامه‬‫است‬
‫افزودن‬‫شیت‬‫دیگر‬(B,C,…)‫در‬‫قبل‬‫و‬‫بعد‬‫از‬‫شیت‬A‫با‬‫راست‬‫کلیک‬‫بر‬‫روی‬‫تب‬‫‌ها‬‫ت‬‫شی‬‫در‬‫پایین‬‫پنجره‬‫صورت‬‫‌گیرد‬‫ی‬‫م‬.
‫‌نویسی‬‫ه‬‫برنام‬CFC‫با‬‫کشیدن‬‫‌ها‬‫ک‬‫بال‬‫از‬‫کاتالوگ‬‫سمت‬‫چپ‬‫به‬‫داخل‬‫محیط‬‫و‬‫اتصال‬‫ورودی‬‫و‬‫خروجی‬‫‌ها‬‫ک‬‫بال‬‫به‬‫هم‬‫به‬
‫صورت‬‫گرافیکی‬‫انجام‬‫‌گیرد‬‫ی‬‫م‬.
‫نمایش‬‫‌های‬‫س‬‫آدر‬‫وروردی‬‫‌ها‬‫ک‬‫بال‬‫در‬‫نوار‬‫خاکستری‬‫سمت‬‫چپ‬‫و‬‫‌های‬‫س‬‫آدر‬‫خروجی‬‫‌ها‬‫ک‬‫بال‬‫در‬‫نوار‬‫خاکستری‬‫سمت‬
‫راست‬‫شیت‬
‫ویرایشگر‬CFC‫گزینه‬Save‫و‬Undo‫ندارد‬.
IntroductiontotheCFC Editor
Theactualediting oftheCFC chartssuchas inserting blocksandassigningparametervalues tothemis donein the CFC Editor.
As soonas youopena CFC chart, theCFC Editor opens.Theeditoris always openedin theview in whichit wasclosed thelast time youworkedwith it.
With its normalsettings,theCFC Editor is divided upas follows:
 Ontheright-handside of theeditor yousee thechart displayed. If youhaveopenedanemptyCFC chart,here youwill
simply seean emptyspace.Thisis whereyouinsert blocksas required todescribe continuousprocesses.Thefinal job is to
assign parametervaluesandinterconnecttheblocks.
 Ontheleft-hand side of theeditor youwill see thecatalogwith blocks,libraries, andcharts.
All theworkthatyoudowith theCFC Editoris savedautomatically byPCS 7.
Changingfrom theOverview toaSingle Sheet
Youcanchangefrom theoverviewtothesingle sheetview bydouble-clicking onthe required sheet.
‫مدرس‬:‫اکبری‬ ‫صادق‬
Tel. 09123182734
SIMATIC PCS7 Training
CFC Language
‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬
‫نیرو‬ ‫آب‬-‫پاییز‬96
‫کاتالوک‬‫حاوی‬‫‌ها‬‫ک‬‫‌بال‬‫ن‬‫فانکش‬‫یا‬‫‌های‬‫ن‬‫الما‬‫برنامه‬‫نویسی‬‫‌باشد‬‫ی‬‫م‬.
‫از‬‫منوی‬View > Catalog‫یا‬‫از‬‫طریق‬‫منو‬‫ابزار‬‫قابل‬‫نمایش‬‫‌باشد‬‫ی‬‫م‬‫که‬‫دارای‬‫سه‬‫بخش‬‫‌باشد‬‫ی‬‫م‬.
Blocks–‫بخش‬‫پیش‬‫فرض‬‫کاتالوگ‬‫بوده‬‫و‬‫حاوی‬‫مجموعه‬‫‌های‬‫ن‬‫الما‬‫پایه‬‫‌نویسی‬‫ه‬‫برنام‬‫‌باشد‬‫ی‬‫م‬.
Charts-‫شامل‬‫لیست‬‫‌های‬‫ت‬‫چار‬CFC‫دیگر‬‫موجود‬‫در‬‫پروژه‬‫و‬‫امکان‬‫‌آنها‬‫ی‬‫فراخوان‬‫در‬‫چارت‬‫باز‬‫شده‬‫جاری‬
‫‌باشد‬‫ی‬‫م‬.
Libraries-‫حاوی‬‫لیست‬‫‌های‬‫ک‬‫بال‬‫‌ای‬‫ه‬‫کتابخان‬‫مختلف‬‫‌باشد‬‫ی‬‫م‬.
– Step7StandardLibrary
– PCS7 Libraries
– CFC Library
–‫شامل‬‫‌هاي‬‫ه‬‫كتابخان‬‫بوط‬‫ر‬‫م‬‫به‬‫نصب‬‫‌هاي‬‫ه‬‫بست‬Optional‫نظير‬F-System‫و‬CEMAT
‫تفاوت‬‫‌ها‬‫ک‬‫بال‬
‫‌های‬‫ک‬‫بال‬‫‌های‬‫ه‬‫کتابخان‬PCS7‫برای‬‫کارهای‬‫پیچیده‬‫کنترلی‬‫و‬‫استفاده‬‫از‬‫توابع‬‫از‬‫پیش‬‫تعریف‬‫شده‬‫‌ب‬‫ی‬‫م‬‫اشد‬.
‫پوشه‬Blocks‫حاوی‬‫‌های‬‫ک‬‫بال‬‫پایه‬‫المان‬‫اصلی‬‫یا‬Building Block(BOP)‫هستند‬‫ولی‬‫‌های‬‫ک‬‫بال‬‫‌های‬‫ه‬‫کتابخان‬‫از‬
‫نوع‬‫فانکشن‬‫و‬‫فانکشن‬‫بالک‬‫هستند‬.
‫برخی‬‫از‬‫‌های‬‫ک‬‫بال‬‫‌های‬‫ه‬‫کتابخان‬‫دارای‬‫یک‬‫شکل‬‫گرافیکی‬‫بنام‬‫بالک‬‫آیکون‬‫در‬‫سیستم‬‫مانیتورین‬‫گ‬(OCM)
‫هستند‬.
‫‌های‬‫ک‬‫بال‬‫پایه‬‫در‬‫هر‬OB‫قابل‬‫فراخوانی‬‫هستند‬.‫ولی‬‫‌های‬‫ک‬‫بال‬‫‌های‬‫ه‬‫کتابخان‬‫فقط‬‫در‬OB‫های‬‫خاص‬‫و‬
‫مشخص‬‫شده‬‫فراخوانی‬‫‌شوند‬‫ی‬‫م‬.
‫با‬‫هر‬‫بار‬‫فراخوانی‬‫‌های‬‫ک‬‫بال‬‫‌های‬‫ه‬‫کتابخان‬‫از‬‫جنس‬FB،‫یک‬DB‫جدیدی‬‫به‬‫آنها‬‫اختصاص‬‫داده‬‫‌شود‬‫ی‬‫م‬.
‫برای‬‫مشاهده‬‫اطالعات‬‫کامل‬‫در‬‫خصوص‬‫بالک‬‫مورد‬‫نظر،کلید‬F1‫را‬‫بر‬‫روی‬‫بالک‬‫کلیک‬‫نمایید‬.
‫مدرس‬:‫اکبری‬ ‫صادق‬
Tel. 09123182734
SIMATIC PCS7 Training
CFC Language
‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬
‫نیرو‬ ‫آب‬-‫پاییز‬96
Blocks
Betweentheoperatingsystemandtheuser programsthere are theso-calledOrganization Blocks (OBs).
“Block” is an importantconceptin PCS 7.Asummaryof theblocks used in thesystemis listed in Table above
When ablock is created,it mustbe "declared"as a function block (FB), a function call (FC), ora basic operation,(BOP).
A FB is a block with memory; in other words the data exist during processing from one cycle to another and can be
accessed.Tomakethe dataaccessible, a datablock(DB) is created for eachblockinstance.
In amulti-instance block,the calling FB contains subsidiary FBs butonly onecommonDB is created.
A FC is a block without memory; in other words the values generated by the block are processed immediately. No data
blockis required for aFC. A FC does nothavedefault values at theoutputs.
A BOPis also a blockwithout memory.Theyare usedfor simple functions suchasAND,OR, etc.
Basic operations are programcomponentsin CFC andare enteredas theSCL statementsduring compilation.
BOPs are locatedin the CFC Chart folder. Refer toPicture whereBOPs are indicated bythebookicons.
‫مدرس‬:‫اکبری‬ ‫صادق‬
Tel. 09123182734
SIMATIC PCS7 Training
CFC Language
‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬
‫نیرو‬ ‫آب‬-‫پاییز‬96
Integrating Libraries
‫تلفیق‬‫کتابخانه‬‫های‬‫از‬‫‌ساخته‬‫ش‬‫پی‬‫در‬‫برنامه‬‫کاربر‬-‫موقع‬‫نصب‬‫سیستم‬‫مهندسی‬(PCS7-ES)‫کتابخانه‬‫های‬PCS7‫که‬‫حاوی‬‫بالک‬‫ها‬
‫و‬‫چارت‬‫های‬‫از‬‫پیش‬‫ساخته‬،‫هستند‬‫به‬‫صورت‬‫اتوماتیک‬‫نصب‬‫می‬‫گردند‬.
‫بالک‬‫های‬‫مورد‬‫نیاز‬‫برای‬‫ایجاد‬‫برنامه‬‫کاربر‬‫بایستی‬‫در‬‫پروژه‬‫تلفیق‬(integrated)‫شوند‬.
‫برنامه‬‫کاربر‬‫به‬‫کمک‬‫ویرایشگر‬‫چارت‬‫های‬CFC‫و‬SFC‫ایجاد‬‫می‬‫گردد‬.‫بالک‬‫های‬‫ارایه‬‫شده‬‫در‬‫محیط‬CFCً‫ا‬‫اساس‬‫از‬‫کتابخانه‬‫های‬
‫واقع‬‫در‬S7Manager‫در‬‫آدرس‬File -> Open -> Libraries‫نشات‬‫‌گیرند‬‫ی‬‫م‬.
‫برای‬‫مشاهده‬‫کتابخانه‬‫ها‬‫می‬‫توان‬‫به‬‫مسیر‬File -> Open -> Libraries‫مراجعه‬‫کرد‬.
‫برای‬‫نمایش‬‫و‬‫مخفی‬‫کردن‬‫این‬‫کتابخانه‬‫ها‬‫نیز‬‫می‬‫توان‬‫از‬‫فرمان‬File -> Manage-> Hide / Display‫استفاده‬‫کرد‬.
Master Data Library : MDL
‫کتابخانه‬‫خاص‬‫پروژه‬‫‌باشد‬‫ی‬‫م‬.‫از‬‫نسحه‬PCS7 V7.0‫به‬‫باال‬‫عالوه‬‫بر‬‫پروژه‬‫ها‬‫می‬‫توان‬‫کتابخانه‬‫ها‬‫را‬‫نیز‬‫در‬‫یک‬Multiproject‫قرار‬
‫داد‬.
‫می‬‫توان‬‫یکی‬‫از‬‫این‬‫کتابخانه‬‫ها‬‫را‬‫به‬‫عنوان‬‫کتابخانه‬‫خاص‬‫‌های‬‫ه‬‫داد‬‫پروژه‬‫برای‬‫ذخیره‬‫سازی‬‫بالک‬‫ها‬‫و‬‫چارت‬‫ها‬‫استف‬‫اده‬‫کرد‬.‫تا‬
‫در‬‫تمام‬‫پروژه‬‫ها‬‫به‬‫صورت‬‫یک‬‫شکل‬‫از‬‫بالک‬‫ها‬‫و‬‫چارت‬‫ها‬‫استفاده‬‫کرد‬.
‫کتابخانه‬MDL‫تنها‬‫می‬‫تواند‬‫حاوی‬‫یک‬‫پوشه‬S7 Program‫باشد‬.
‫برای‬‫تعریف‬‫یک‬‫کتابخانه‬‫درج‬‫شده‬‫در‬‫یک‬Multiproject،‫به‬‫عنوان‬‫کتابخانه‬MD،‫در‬‫محیط‬Component View‫کتابخانه‬‫را‬‫انتخاب‬
‫کرده‬‫و‬‫از‬‫فرمان‬‫زیر‬‫استفاده‬‫کنید‬.
File  Multiproject  Defineas Master Data Library
‫مدرس‬:‫اکبری‬ ‫صادق‬
Tel. 09123182734
SIMATIC PCS7 Training
CFC Language
‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬
‫نیرو‬ ‫آب‬-‫پاییز‬96
Master data Library
It is recommendedthatthe blocksused in a project(user-definedor the system libraries) arecollected into the projectmaster library.
Block types used in a particular project,no matter they are PCS 7 library blocks or created by user, they have to be available in the master data
library.
After you are sure that all blocks required are in the master data library or located in a project library, it is recommended to hide all other
libraries including the PCS 7 standard libraries as they havebeenadapted into the project library.
To hide a library, use the Managefunction of the SIMATIC Manager,the menu path, File > Manage.SeePicture.
From time to time, you have to be sure that blocks used in a project are in the master data library. It is particularly important that there is no
conflict in block numbersand symbolic nameswithin the masterdata library.
‫مدرس‬:‫اکبری‬ ‫صادق‬
Tel. 09123182734
SIMATIC PCS7 Training
CFC Language
‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬
‫نیرو‬ ‫آب‬-‫پاییز‬96
‫‌های‬‫ک‬‫بال‬‫پایه‬(Elementary Blocks)
‫حاوی‬‫بالک‬‫هایی‬‫برای‬‫انجام‬‫عملیات‬‫پایه‬Step7(BOP)‫در‬‫‌های‬‫ت‬‫چار‬CFC‫می‬‫باشد‬.‫این‬‫بالک‬‫های‬‫پایه‬‫مانند‬CMP_R‫و‬SQRT‫در‬‫کتابخانه‬
CFC‫قرار‬‫دارند‬‫و‬‫به‬‫همراه‬‫ویرایشگر‬CFC‫نصب‬‫می‬‫شوند‬.
‫بالک‬‫های‬‫تکنولوژیکی‬(Technological Blocks)
‫دسته‬‫بالک‬‫های‬‫زیر‬‫توابع‬‫پایه‬‫برای‬‫انجام‬‫تسک‬‫های‬‫اتوماسیون‬‫را‬‫فراهم‬‫می‬‫کند‬:
‫فانکشن‬‫بالک‬‫ها‬(Functionblocks)‫مانند‬AVER_P،INT_P،LIMITS_P
‫بالک‬‫های‬‫کنترل‬‫اپراتوری‬(Operatorcontrolblocks)‫مانند‬OP_A_LIM،OPD‫به‬‫همراه‬Faceplate‫های‬‫مربوطه‬
‫بالک‬‫های‬‫پیام‬(Message)‫مانند‬MESSAGE, MSG_CSF
‫دسته‬‫بالک‬‫های‬‫زیر‬‫به‬‫همراه‬‫صفحات‬Faceplate‫مربوطه‬‫برای‬‫مانیتورینگ‬‫و‬‫بهره‬‫برداری‬‫در‬OS،‫تسک‬‫های‬‫پیچیده‬‫را‬‫پردازش‬‫می‬‫کنند‬.
 Controller block CTRL_PID,CTRL_S
 MotorblocksMOTOR,MOT_REV,MOT_SPED
 Valve blocksVALVE, VAL_MOT
 Interlock display INTERLOCK
 DosageDOSE
 Ratio controller RATIO_P
 MonitoringblocksMEAS_MON,DIG_MON
 MaintenanceblocksELAP_CNT,SWIT_CNT,OB1_TIME
‫‌های‬‫ک‬‫بال‬‫درایور‬‫کانال‬(Driver Blocks)
‫‌های‬‫ک‬‫بال‬‫درایو‬‫‌هایی‬‫ط‬‫واس‬‫به‬‫‌های‬‫ل‬‫ماژو‬I/O‫فراهم‬‫‌کنند‬‫ی‬‫م‬.
 CH_AI,CH_AO,CH_DI, CH_DOfor theindividual channel
–‌‫ر‬‫ایو‬‫ر‬‫د‬‫‌های‬‫ل‬‫کانا‬‫دیجیتال‬‫و‬‫آنالوگ‬‫در‬‫‌ها‬‫ت‬‫کار‬‫‌بشند‬‫ی‬‫م‬.
 MODxx,RACK,SUBNET,OB_xx,CPU_RTfor module,chainand CPUdiagnostics
–‫بالک‬‫های‬MODxx‫ای‬‫ر‬‫ب‬‌‫ر‬‫ایو‬‫ر‬‫د‬‫کارت‬‫‌ها‬‫ل‬‫ماژو‬‫و‬‫تشخیص‬‫و‬‫عیب‬‫یابی‬CPU‫هستند‬.
 PA_xx,PO_xxPROFIBUSPA drivers
–‫بالک‬‫های‬PA_xx‫ای‬‫ر‬‫ب‬‫ایورهای‬‫ر‬‫د‬‫کانال‬‫پروفی‬‫باس‬PA‫هستند‬.
‫مدرس‬:‫اکبری‬ ‫صادق‬
Tel. 09123182734
SIMATIC PCS7 Training
CFC Language
‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬
‫نیرو‬ ‫آب‬-‫پاییز‬96
‫‌های‬‫ک‬‫بال‬‫تبادل‬‫داده‬‫بین‬‫دو‬‫سیستم‬(Communication Blocks)
‫بالک‬‫های‬‫ارتباط‬‫شبکه‬‫در‬‫کتابخانه‬PCS7 Library V6.1‫قرار‬‫دارند‬‫این‬‫بالک‬‫ها‬‫عبارتند‬‫از‬SEND_B0‫و‬REC_B0‫برای‬128‫مقدار‬
‫باینری‬‫و‬SEN_R‫و‬REC_R‫برای‬‫انتقال‬32‫مقدار‬Boolean‫و‬32‫مقدار‬Real
‫هر‬‫دوی‬‫این‬‫جفت‬‫بالک‬‫ها‬‫برای‬‫تبادل‬‫داده‬‫و‬‫ارتباطات‬‫از‬‫طریق‬SystemBus‫مناسب‬‫هستند‬.
‫کتابخانه‬‫استاندارد‬Standard Library)
‫کتابخانه‬‫استاندارد‬‫از‬‫نسخه‬5‫بسته‬‫نرم‬‫افزار‬Step7‫به‬‫بعد‬‫بازسازی‬‫شده‬‫است‬‫و‬‫حاوی‬‫مجموعه‬‫‌های‬‫ک‬‫بال‬‫زیر‬‫می‬‫باشد‬.
‫فانکشن‬‫های‬‫سیستمی‬(System Functions):‫شامل‬‫فانکشن‬‫های‬‫سیستمی‬(SFC)‫و‬‫فانکشن‬‫‌های‬‫ک‬‫بال‬
‫سیستمی‬(SFB)‫‌باشند‬‫ی‬‫م‬.‫‌طوری‬‫ه‬‫ب‬‫که‬‫در‬‫سیستم‬‫مهندسی‬AS‫یکپارچه‬‫شده‬‫و‬‫بلوک‬‫های‬‫کاربر‬‫قادر‬‫به‬
‫فراخوانی‬‫آنها‬‫می‬‫باشند‬.
‫‌های‬‫ک‬‫بال‬S5-S7 Convert:‫بالک‬‫هایی‬‫برای‬‫تبدیل‬‫برنامه‬‫های‬Step5‫به‬Step7‫هستند‬.
‫دسته‬‫‌های‬‫ک‬‫بال‬IEC Functions:‫شامل‬‫بالک‬‫هایی‬‫مانند‬‫انجام‬‫عملیات‬‫رشته‬‫ای‬(I-STRING)‫و‬‫مقایسه‬(MAX)
‫‌باشند‬‫ی‬‫م‬.
‫دسته‬Communication Blocks:‫بالک‬‫های‬‫برای‬‫تبادل‬‫داده‬‫روی‬‫شبکه‬‫‌باشند‬‫ی‬‫م‬.‫که‬‫شامل‬‫توابع‬(FC)‫برای‬
‫ارتباطات‬Prsfibus DP‫می‬‫باشد‬
‫گروه‬PID Control:‫شامل‬‫‌بالک‬‫ن‬‫فانکش‬‫هایی‬(FB)‫برای‬‫کنترل‬PID‫هستند‬.
‫دسته‬TI-S7Convert:‫شامل‬‫بالک‬‫های‬‫برای‬‫تبدیل‬‫برنامه‬‫های‬TI‫به‬S7‫می‬‫باشند‬.
‫نکته‬
‫کتابخانه‬REDUNDUNT_IO (V1)‫تا‬‫نسخه‬6.1‫‌افزار‬‫م‬‫نر‬PCS7‫و‬‫کتابخانه‬REDUNDANT IO CGP‫در‬
‫نسخه‬7.0‫و‬‫باالتر‬‫برای‬‫‌های‬‫م‬‫سیست‬H‫‌پذیر‬‫ل‬‫تحم‬‫خطا‬‫به‬‫همراه‬I/O‫افزونه‬‫موجود‬‫‌باشد‬‫ی‬‫م‬.
‫مدرس‬:‫اکبری‬ ‫صادق‬
Tel. 09123182734
SIMATIC PCS7 Training
CFC Language
‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬
‫نیرو‬ ‫آب‬-‫پاییز‬96
When youplacea blockon a CFC chart, youplaceonly its instanceon the chart.
Instancemeansa usageof a blocktype.
When draggingthe Valve block,FB73, from the PCS 7 library anddroppingit on to a CFC, aninstance ofFB73 is placedonthe chart. The
blocktype is left in the Blocksfolder (Prog1)andin the CFC Chart folder.See Picture Above.
Further Instanceblocks canbe draggedfroma type in the CFC Chart folder ratherthan fromlibraries or from the Blocksfolder. The formeris
faster as nochecksfor discrepancybetweena blocktype in the CFC Chartfolder andBlocks folderare
performed.
Note
 In areal project, themasterdatalibrary is usedthroughoutaproject engineeringcycle. Block typesare createdin or copied
intothe masterdatalibrary. Themasterdatalibrary is theonlysourcefor a particular project.
 Youcancreate anynumberofblock instancesfrom a blocktype.Youcan assignnamestotheseblockinstances,
interconnectthem,andassignparameterstothem withoutchangingthefunctionality ofthe type.
‫مدرس‬:‫اکبری‬ ‫صادق‬
Tel. 09123182734
SIMATIC PCS7 Training
CFC Language
‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬
‫نیرو‬ ‫آب‬-‫پاییز‬96
Block typesare ready-madeprogramsections that canbe insertedin a CFC chart.
When ablock typeis inserted, a blockinstanceis created.You cancreateany numberof blockinstancesfroma block type.
For the SIMATIC S7 CPUs, the blocktypes arecreated,edited, andcompiledin the LadderLogic editor (LAD), Statement List (STL) editor
or StructuredControl Language(SCL) editor.
For PCS 7 projects, functionblocksare createdin the SCL or by compilingcharts as blocks.
Block typesof a project arelocatedin theBlocks folderas shown in Picture.
Blocks folderalso containsother blocks,e.g. systemfunction blocks(SFB), datablocks (DB), andorganization‫ی‬ blocks(OB)
The blocktypes of Blocksfolder arealso shown in the CFC library catalogueso that theycan beaccessedin theCFC editor. In Picture
Above,block typeof the S7 program,Prog1,are shown.
Block typesare obtainedfromthreesources, whichare fromthe systemlibraries, fromuser-designedlibraries, or createdin theproject. The
threesourcesof block typesare shownin Picture.
Block typesare also storedin theCFC Chart folder.The CFC Chartfolder containsblocksindicated bythe blue boxesas shownin Picture.
‫مدرس‬:‫اکبری‬ ‫صادق‬
Tel. 09123182734
SIMATIC PCS7 Training
CFC Language
‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬
‫نیرو‬ ‫آب‬-‫پاییز‬96
Block typesare identified bytheir numbersandsymbolicnameswhile symbolic namesare optional.
When thesystem blocksare used,their symbolicnamesareautomaticallyenteredin the Symbols table.
The nameof theblock is usuallyenteredin the Symbols table or Symbolseditor. In Picture, a blocktype, FB73, has asymbolic name
VALVE, which is definedin the Symbolstable .
Block types
 Theblocktypedeterminesthecharacteristics (algorithm) for all implementationsof this type.
 A blocktyperepresents atemplatefor anynumberof instancesanddescribes howtheseinstancesare structuredinternally.
 All instancesof a blocktypeobeythesamebasic definition as regardstheir characteristics andtheir data structure.
Block Instances
 A blockinstanceis aconcreteobject generatedaccordingtoits type(blocks) description.
 Thetypedescribesthe characteristics andinformation structurefor theinstance while thecurrent stateof eachinstance
dependsonits actually executedoperationsandis reflected in theinformation contents.
 Eachinstancehas auniqueidentifier thatenablesinstances tobedistinguishedfrom oneanother.
‫مدرس‬:‫اکبری‬ ‫صادق‬
Tel. 09123182734
SIMATIC PCS7 Training
CFC Language
‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬
‫نیرو‬ ‫آب‬-‫پاییز‬96
‫تلفیق‬‫بالک‬‫ها‬‫در‬‫برنامه‬(Integrating Blocks)
‫وقتی‬‫چارت‬CFC‫باز‬‫می‬‫شود‬.‫پنجره‬Catalog‫را‬‫در‬‫صورتیکه‬‫فعال‬‫نباشد‬.‫از‬‫مسیر‬‫زیر‬‫فعال‬‫کنید‬.
– View  Catalog
‫برای‬‫استفاده‬‫از‬‫یک‬‫بالک‬‫در‬،‫برنامه‬‫بالک‬‫مورد‬‫نظر‬‫را‬‫در‬‫بین‬‫کتابخانه‬‫های‬‫موجود‬‫جستجو‬‫و‬‫از‬‫تکنیک‬Drag‫روی‬‫بالک‬‫و‬
Drop‫بالک‬‫بر‬‫روی‬‫چارت‬‫استفاده‬‫کرده‬‫و‬‫بالک‬‫را‬‫روی‬‫چارت‬‫قرار‬‫دهید‬.
‫وقتی‬‫یک‬‫تایپ‬‫بالک‬(Block Type)‫را‬‫برای‬‫اولین‬‫بار‬‫در‬‫چارت‬‫قرار‬‫می‬‫دهید‬.‫‌های‬‫ه‬‫داد‬‫این‬‫بالک‬‫در‬‫پوشه‬Blocks،‫پوشه‬Chart‫و‬
‫جدول‬‫‌ها‬‫ل‬‫سیمب‬‫وارد‬‫‌شود‬‫ی‬‫م‬.‫درج‬‫‌ها‬‫ه‬‫داد‬‫در‬‫این‬‫‌ها‬‫ه‬‫پوش‬‫به‬‫صورت‬‫مخفی‬‫صورت‬‫‌گیرد‬‫ی‬‫م‬
(Import).
‫بالک‬‫قرار‬‫داده‬‫شده‬،‫درچارت‬‫به‬‫منظور‬‫فراخوانی‬‫و‬‫اجرا‬‫توسط‬CPU،‫در‬‫داخل‬‫یک‬OB‫ادغام‬‫می‬‫شود‬.‫به‬‫این‬‫معنی‬‫که‬‫این‬
‫بالک‬‫در‬‫زمان‬‫اجرا‬‫در‬‫آن‬OB‫فراخوانی‬‫می‬‫شود‬.
‫از‬‫قبل‬‫در‬‫زمان‬‫طراحی‬،‫کتابخانه‬‫هر‬‫یک‬‫از‬‫بالک‬‫های‬‫کتابخانه‬‫های‬PCS7‫برای‬‫نصب‬‫در‬‫یک‬OB،‫خاص‬‫تنظیم‬‫شده‬‫است‬.‫به‬
‫این‬‫معنی‬‫که‬‫برای‬‫هر‬،‫بالک‬‫یک‬OB‫تنظیم‬‫شده‬‫است‬.‫که‬‫موقع‬‫قرار‬‫دادن‬‫در‬،‫چارت‬‫در‬‫ابتدا‬‫در‬
‫داخل‬‫همان‬OB،‫ادغام‬‫می‬‫شود‬.‫به‬‫طوریکه‬‫از‬‫پنجره‬Run Sequence‫‌توان‬‫ی‬‫م‬OB‫پیش‬‫تنظیم‬‫را‬‫عوض‬
‫کرد‬.
‫مدرس‬:‫اکبری‬ ‫صادق‬
Tel. 09123182734
SIMATIC PCS7 Training
CFC Language
‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬
‫نیرو‬ ‫آب‬-‫پاییز‬96
Blocks
‫یک‬‫اصل‬‫پایه‬‫در‬‫مهندسی‬‫‌گوید‬‫ی‬‫م‬‫که‬‫چرخ‬‫را‬‫نباید‬‫دوباره‬‫اختراع‬‫کرد‬.‫کتابخانه‬‫های‬‫‌های‬‫ک‬‫بال‬‫از‬‫‌ساخته‬‫ش‬‫پی‬‫حاوی‬‫راه‬‫حل‬‫هایی‬‫هستند‬‫ک‬‫ه‬‫می‬‫توان‬
‫استفاده‬‫مجدد‬‫کرد‬.‫مستندات‬‫بالک‬(‫که‬‫به‬‫صورت‬‫آنالین‬‫با‬‫فشردن‬‫کلید‬F1‫روی‬‫بالک‬‫باز‬‫می‬‫شود‬)‫داده‬‫هایی‬‫که‬‫در‬
‫بخش‬‫ورودی‬‫بالک‬‫به‬‫منظور‬‫حصول‬‫نتایج‬‫در‬‫بخش‬‫خروجی‬،‫بالک‬‫بایستی‬‫فراهم‬‫شوند‬‫را‬‫توصیف‬‫می‬‫کن‬‫ند‬.
Charts (Templates)
‫‌های‬‫ل‬‫‌ح‬‫ه‬‫را‬‫کنترلی‬‫از‬‫پیبش‬‫تعریف‬‫شده‬‫هستند‬‫که‬‫تنها‬‫الزم‬‫است‬‫با‬‫مشخصات‬‫فرآیند‬‫تطبیق‬‫داده‬‫شوند‬.
‫به‬‫این‬‫معنی‬‫که‬‫برای‬‫اجزای‬‫فرآیند‬‫مانند‬‫موتور‬‫یک‬‫چارت‬‫کنترل‬‫به‬‫صورت‬general‫ایجادشده‬‫که‬‫فقط‬‫بایستی‬‫پارامترهای‬
‫‌ها‬‫ک‬‫بال‬‫را‬‫با‬‫‌های‬‫ر‬‫پارامت‬‫فرآیند‬‫تطبیق‬‫داد‬.
Import
‫عمل‬Import:‫از‬‫‌جایی‬‫ن‬‫آ‬‫که‬‫‌های‬‫ک‬‫بال‬‫موجود‬‫در‬‫‌ها‬‫ه‬‫کتابخان‬‫به‬‫صورت‬Type،‫هستند‬‫قبل‬‫از‬‫استفاده‬‫از‬‫آنها‬‫بایستی‬‫به‬‫پوشه‬Blocks،Import‫شده‬‫و‬‫سپس‬
‫برای‬‫‌سازی‬‫ه‬‫پیاد‬‫برنامه‬‫در‬‫‌های‬‫ت‬‫چار‬CFC،‫ورودی‬‫و‬‫‌های‬‫ی‬‫خروج‬‫آنها‬‫به‬‫‌های‬‫ک‬‫بال‬‫دیگر‬‫متصل‬‫شوند‬.
Inserting in Chart
‫قرار‬‫دادن‬‫در‬‫چارت‬(Inserting In Chart‌)‫‌ها‬‫ک‬‫بال‬‫را‬‫‌توان‬‫ی‬‫م‬‫از‬‫طریق‬Drag & Drop،‫در‬‫چارت‬‫قرار‬‫داد‬.‫برای‬‫این‬‫کار‬‫بالک‬‫را‬‫در‬‫لیست‬‫‌های‬‫ک‬‫بال‬‫کتابخانه‬
‫مربوطه‬،‫انتخاب‬‫و‬‫آن‬‫را‬‫در‬‫پنجره‬‫کدنویسی‬‫چارت‬‫قرار‬‫‌دهیم‬‫ی‬‫م‬(‫در‬‫یکی‬‫از‬‫شیت‬1‫تا‬6)
Block Header
‫هدر‬‫بالک‬‫حاوی‬‫اطالعاتی‬‫است‬‫که‬‫‌توان‬‫ی‬‫م‬‫بالک‬‫را‬‫شناخت‬.
Set Parameters
‫برای‬‫تغییر‬‫‌های‬‫ر‬‫پارامت‬،‫بالک‬‫بالک‬‫را‬‫انتخاب‬‫و‬‫با‬‫دابل‬‫کلیک‬‫یا‬‫راست‬،‫کلیک‬‫پنجره‬Object Properties‫را‬‫باز‬‫‌کنیم‬‫ی‬‫م‬
Connect
‫اگر‬‫قرار‬‫است‬‫نتایج‬‫حاصل‬‫از‬‫یک‬‫بالک‬‫توسط‬‫بالک‬‫دیگر‬‫پردازش‬‫بیشتری‬‫شود‬.‫خروجی‬‫این‬‫بالک‬‫به‬‫ورودی‬‫بالکی‬‫که‬‫این‬‫مقدار‬‫ر‬‫ا‬‫پردازش‬‫می‬‫کند‬
‫متصل‬‫می‬‫گردد‬(‫برای‬‫این‬‫کار‬‫ابتدا‬‫در‬‫خروجی‬‫بالک‬‫کلیک‬‫و‬‫سپس‬‫در‬‫ورودی‬‫بالک‬‫دوم‬‫کلیک‬‫نمایید‬‫و‬‫یا‬‫ب‬‫ه‬‫روش‬
Drag& Drop‫این‬‫کار‬‫را‬‫انجام‬‫دهید‬‫یعنی‬‫پایه‬‫خروجی‬‫بالک‬‫را‬‫انتخاب‬(Drag)‫و‬‫بر‬‫روی‬‫ورودی‬‫بالک‬Drop‫کنید‬.
SheetBars
‫همچنین‬‫می‬‫توان‬‫بین‬‫بالک‬‫هایی‬‫که‬‫در‬‫یک‬Sheet‫قرار‬،‫ندارند‬‫از‬‫طریق‬‫باز‬‫کردن‬‫یک‬‫پنجره‬‫جدید‬‫در‬CFC‫اتصاالت‬‫برقرار‬‫کرد‬.‫به‬‫طوری‬‫که‬‫دو‬‫تا‬‫شیت‬
‫در‬‫دو‬‫پنجره‬‫مختلف‬‫نمایش‬‫داده‬‫می‬‫شوند‬‫و‬‫اتصاالت‬‫بین‬‫‌های‬‫ه‬‫پای‬‫بالک‬‫به‬‫همان‬‫صورت‬‫معمول‬‫صورت‬‫می‬‫گیر‬‫د‬.
‫مدرس‬:‫اکبری‬ ‫صادق‬
Tel. 09123182734
SIMATIC PCS7 Training
CFC Language
‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬
‫نیرو‬ ‫آب‬-‫پاییز‬96
‫با‬‫قرار‬‫دادن‬‫بالک‬‫در‬‫محیط‬CFC‫یک‬‫شماره‬‫برای‬‫نام‬‫آن‬‫تخصیص‬‫داده‬‫‌شود‬‫ی‬‫م‬.‫که‬‫در‬‫گوشه‬‫سمت‬‫چپ‬‫بالک‬‫قرار‬‫‌گیر‬‫ی‬‫م‬‫د‬.
‫با‬‫دابل‬‫کلیک‬‫بر‬‫روی‬‫بالک‬‫پنجره‬Properties‫آن‬‫نمایان‬‫‌شود‬‫ی‬‫م‬‫که‬‫بهتر‬‫است‬‫یک‬‫اسم‬‫با‬‫معنی‬‫مرتبط‬‫با‬‫فرآیند‬‫برای‬‫بال‬‫ک‬‫در‬
‫قسمت‬Name‫وارد‬‫شود‬.
CFC Objects :The most important CFC terms areoutlined here.
In CFC, the identifier for a blockinstanceis madeupof :
 thechart name,whichis uniquein theCPU,
 theseparator‘.’,
 andtheblockname,whichis uniquewithin thechart (maximumof 24characters for theblock name).
Blocks :
 In theSTEP7languageusage,blocksare separateparts oftheuser program definedbytheir function,their structure,or
their application purpose.
 Thereare logic blocks(FB, FC,...), datablocks,anduser-defined datatypes.
 Basic instructions:Functionssuchas AND,SUM,etc.containedin theS7 machinemodel
 Globaladdresses:I/O signals, bit memories,counters,timers, andglobaldatablocks
‫مدرس‬:‫اکبری‬ ‫صادق‬
Tel. 09123182734
SIMATIC PCS7 Training
CFC Language
‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬
‫نیرو‬ ‫آب‬-‫پاییز‬96
Block IO
 Eachblockhasa numberof different I/Os thatare displayed in a tableof theproperties dialog.
 Tofind theI/Os quicklyin this dialog, youcanclick in thecolumnheadof thetable andsortthecolumnin ascendingor
descendingorder.
 TheI/Os ofa blockcan bebothvisible or invisible: Youcanonlysee visible parametersin thepropertiesof theblockbut
notin therepresentationin theCFC chart.
 Youcanspecify whichI/Os in theCFC chartwill bevisible andwhich will beinvisible. Youspecify this in theproperties
of theblockin the“Invisible“ columnbyuncheckingthe checkboxofthe relevantI/O tomaketheI/O visible in theCFC
chart.This functionhelpsto makea CFC chart easier toread.
‫مدرس‬:‫اکبری‬ ‫صادق‬
Tel. 09123182734
SIMATIC PCS7 Training
CFC Language
‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬
‫نیرو‬ ‫آب‬-‫پاییز‬96
‫مدرس‬:‫اکبری‬ ‫صادق‬
Tel. 09123182734
SIMATIC PCS7 Training
CFC Language
‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬
‫نیرو‬ ‫آب‬-‫پاییز‬96
makethe requiredinterconnectionsin the chartsbetweenoutputs andinputs.
You cancreatethe interconnectionsof blocksconvenientlyby :
 clicking onthegraphicuser interface oftheCFC editorwith themouse.
 Click first theoutputof ablock andthentheinputyouwantto connecttoit. After clicking ontheinput,theinterconnection
is displayedas aline.
 TheCFC Editor automatically drawslines in thebestposition.
 Thepositionof thelines hasnoeffect onthefunctionof theinterconnection.
Note
 If youmakeanincorrect interconnection:
 Right-click ontheline of theincorrectly interconnectionandselect themenucommandEdit > Delete.
‫مدرس‬:‫اکبری‬ ‫صادق‬
Tel. 09123182734
SIMATIC PCS7 Training
CFC Language
‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬
‫نیرو‬ ‫آب‬-‫پاییز‬96
Textual interconnection is a virtual connection arising when a partner chart is moved to another S7 program or when it is created deliberately.
Textual interconnectionis indicated by a yellowtriangle as shown in Picture 2.25.
‫ایجاد‬‫اتصال‬‫متنی‬:‫دو‬‫روش‬‫وجود‬‫دارد‬.
‫روش‬‫اول‬:‫روی‬‫پایه‬‫ورودی‬‫یا‬‫خروجی‬‫بالک‬‫مورد‬‫نظر‬‫با‬‫ماوس‬‫کلیک‬‫کرده‬‫و‬‫سپس‬‫روی‬‫پایه‬‫ورودی‬‫یا‬
‫خروجی‬‫بالک‬‫دیگر‬‫که‬‫در‬‫صفحه‬‫نمایش‬‫آورده‬‫شده‬‫با‬‫ماوس‬‫کلیک‬‫‌کنیم‬‫ی‬‫م‬.
–‫امکان‬‫اتصال‬‫ورودی‬‫به‬‫ورودی‬‫یا‬‫خروجی‬‫به‬‫خروجی‬‫وجود‬‫ندارد‬.
‫روش‬‫دوم‬:‫راست‬‫کلیک‬‫بر‬‫روی‬‫ورودی‬‫مورد‬‫نظر‬‫و‬‫انتخاب‬‫گزینه‬Textualinterconnection
–‫پنجره‬‌‫ر‬‫مذکو‬‫فقط‬‫ای‬‫ر‬‫ب‬‫‌های‬‫ه‬‫پای‬‫ورودی‬‫بالک‬‫ظاهر‬‫‌شود‬‫ی‬‫م‬‫و‬‫آدرس‬‫پایه‬‫خروجی‬‫وارد‬‫‌شود‬‫ی‬‫م‬.
–‫در‬‫صورت‬‫یکسان‬‫بودن‬‫سطح‬Hierarchy‫آدرس‬‫مبدا‬‫و‬،‫مقصد‬‌‫ی‬‫نیاز‬‫به‬‫ذکر‬‫نام‬‫سطح‬‫نیست‬‫و‬‌‫ر‬‫دستو‬‫با‬
‫عالمت‬‫شروع‬‫‌شود‬‫ی‬‫م‬.
–‫نام‬‫بالک‬‫در‬‫یک‬CFC‫که‬‫شامل‬‫چندین‬‫شیت‬‫می‬،‫باشد‬‫بفرد‬‫ر‬‫منحص‬‫است‬.
–‫پرچم‬‫نگ‬‫ر‬‫زرد‬‫نشان‬‫دهنده‬‫اشکال‬‫در‬‫‌دهی‬‫س‬‫آدر‬‫یا‬‫عدم‬‫شناسایی‬‫مقصد‬‫می‬‫باشد‬.
‫مدرس‬:‫اکبری‬ ‫صادق‬
Tel. 09123182734
SIMATIC PCS7 Training
CFC Language
‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬
‫نیرو‬ ‫آب‬-‫پاییز‬96
If the connectedpartneris movedbackor a purposely-createdtextualinterconnectionis fulfilled, the textual interconnection will beclosed by
using the Close or“MakeTextual Interconnection”functionandthe yellow triangle disappeared.See Picture
The “MakeTextual Interconnections”functioncanalso be performedwhencompilingprogram.
Note:
Copyingor movingchartsin the Plant view within a CPU will retainall the interconnectionsbetweenchartswhile adaptthe interconnections
automaticallyto new paths.
When copyingor movinga plant hierarchicalfolder containingchart(s)and picture(s),interconnectionsbetweenthe charts andbetween
blocksand their graphicobjects(icons) areretainedand adapted.
Therefore,textual interconnectionswill not occurin the two casesabove.
‫مدرس‬:‫اکبری‬ ‫صادق‬
Tel. 09123182734
SIMATIC PCS7 Training
CFC Language
‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬
‫نیرو‬ ‫آب‬-‫پاییز‬96
Exercise
‫تمرین‬:‫در‬Plant View‫یک‬‫چارت‬‫بنام‬test‫ایجاد‬‫و‬‫در‬‫داخل‬‫آن‬‫بالک‬‫های‬‫باال‬‫را‬‫درج‬‫کنید‬.‫برای‬
‫این‬‫کار‬‫پوشه‬Reactorsi/Testi‫را‬‫به‬‫عنوان‬‫سطوح‬‫فرآیندی‬‫ایجاد‬‫کنید‬.‫هر‬‫دو‬‫بالک‬‫در‬OB32‫اجرا‬‫می‬-
‫شود‬.‫اولین‬‫بالک‬‫تایپ‬PT1_P‫و‬‫دومین‬‫بالک‬‫یک‬‫جمع‬‫کننده‬‫چهارتایی‬ADD4_P‫‌باشد‬‫ی‬‫م‬.
------------------------------------------------------------------------------------------------
Steps 1. Call the projectin plant view. Createfolder.
2. Insert new CFC chart in the correspondinghierarchycontainer.
3. Define predecessorfor installation.
4. Enter blocksfromthe library into thechart andnamethem.
5. Set parametersfor blockson the sheetand interconnectthem.
6. Compile, downloadandtest program.
------------------------------------------------------------------------------------------------
Procedure In the blocknames,"i" stands for yourgroupnumber.
Add PH 1.Select the plant hierarchyview in the SIMATIC Managervia menucommand
View  Plant View
Select the "REACTORSi" folder in the project PRO_ASi. Then
right-click andselect New Object...  HierarchyFolder
to insert a newfolder. Renamethe folder "TESTi"
Createa chart 2.Select the "TESTi" folder,
right-click andselect New Object...  CFC
to insert a chart. Nameyourchart "ATTEMPTi"
OpenChart Select the "ATTEMPTi" chart. To openthe chart,
right-click andselect Open Object(or double-click)
‫مدرس‬:‫اکبری‬ ‫صادق‬
Tel. 09123182734
SIMATIC PCS7 Training
CFC Language
‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬
‫نیرو‬ ‫آب‬-‫پاییز‬96
Settings for
compile 5. Charts must be convertedfromthe graphicformto machinelanguageanddownloadedto theAS.
To initiate the conversionfrom a CFC chart, select
Chart  Compile Charts asProgram
(or click the circledC Compile icon).
The entire softwareis compiledfor theCPU whichis associatedwith this CFC chart.
A dialog boxis displayedfor the compilationsettings (see slide).
Only"Entire Program"is possible under"Scope"thefirst timeyoucompile.Youcanselect "Changesonly" for anysubsequent compilations (after
changes/additions).
ImportantOption
"Generatemoduledrivers" (only meaningfulif thereis a minimumof onechanneldriver in the chart). This
results in the CFC creatingadditional chartswith the requireddriversfor data transferwith the I/O modules
anddiagnostics capability.
A chart "@CPU_RT" is createdin addition. The "CPU_RT" block insertedthere monitorsthe CPU
performancein order to avoida CPU stop (fordetails onthe block functions,pleaserefer to its online help)
Downloading:
The compiledchartsmust now bedownloadedto theCPU. Activate the following menucommandto start this
process:
PLC  Download
or click on theDownloadicon (circledon the slide).
The first time the chart is downloaded,it is only possible to downloadthe entireprogram(in combinationwith
CPU Stop andautomaticdeletion of the programstill residingin the CPU).
‫مدرس‬:‫اکبری‬ ‫صادق‬
Tel. 09123182734
SIMATIC PCS7 Training
CFC Language
‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬
‫نیرو‬ ‫آب‬-‫پاییز‬96
Testing in CFC
To test yourprogram,follow the menupath: Debug> Test Mode.You canmonitor I/O valuesby addingthem into Watch List. Then,the
valuesare highlightedin yellow.
Right click on anI/O andthen “addI/O to Watch List.
To changea value online, doubleclick an input, e.g. AUTO_OC. The I/O Propertiesdialog will openandyou canset a new valuefor the
variable.See Picture.
Note
To operatethe valvein the CFC Test Mode youset andreset AUTO_OC.
To be ableto operatethe valve,youneedto enablethe use of AUTO_OC by setting LIOP_SEL and AUT_L both to be “True”.
The library functionVALVE is explainedin details in Next Chapter
‫مدرس‬:‫اکبری‬ ‫صادق‬
Tel. 09123182734
SIMATIC PCS7 Training
CFC Language
‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬
‫نیرو‬ ‫آب‬-‫پاییز‬96
Thereare two Test Modesnamely:
 ProcessModeandLaboratoryMode.
 Youcanchooseoneof thembefore testing.Toswitchbetweenthetwomodes,follow themenupath:
– Debug> ProcessMode(or LaboratoryMode).
In processmode,communicationfor the online dynamicupdateof blocksis restricted andthus causesmoderateload on the CP and bus.
When thetest modeis activated,all blocksare assignedthe "watch off" attribute.
The laboratorymodeallows convenientandefficient testing and commissioning.In contrast to processmode,the laboratorymodedoesnot
restrict communicationfor online dynamicupdateof blocks. So, use the laboratorymodewith caution.
When thetest modeis activated,all blocksare assignedthe "watch on" attribute.
‫مدرس‬:‫اکبری‬ ‫صادق‬
Tel. 09123182734
SIMATIC PCS7 Training
CFC Language
‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬
‫نیرو‬ ‫آب‬-‫پاییز‬96
‫برای‬‫پیکربندی‬‫یک‬‫چارت‬CFC‫مراحل‬‫زیر‬‫صورت‬‫می‬‫گیرد‬:
‫ایجاد‬‫یک‬‫چارت‬CFC‫در‬‫یک‬‫سطح‬‫فرآیندی‬‫در‬‫محیط‬Plant View
‫باز‬‫کردن‬‫چارت‬CFC
‫کپی‬‫فانکشن‬‫‌های‬‫ک‬‫بال‬‫موردنظر‬‫به‬‫کتابخانه‬MDL‫پروژه‬(‫اختیاری‬)
‫درج‬‫یا‬‫قرار‬‫دادن‬‫فانکشن‬‫‌های‬‫ک‬‫بال‬‫موردنظر‬‫در‬‫محیط‬‫ویرایشگر‬CFC(Insert blocks)
‫تنظیم‬‫پارامترهای‬‫بالک‬
–‫تغيرنام‬‫پیش‬‫فرض‬‫به‬‫نام‬‫های‬‫مناسب‬
–‫تنظیم‬‫مقادیر‬‫ورودی‬/‫خروجی‬
‫ترسیم‬‫اتصال‬‫بین‬‫‌های‬‫ک‬‫بال‬‫داخل‬‫‌های‬‫ت‬‫شی‬‫چارت‬‫و‬‫یا‬‫بین‬‫‌های‬‫ت‬‫چار‬CFC
‫دانلود‬‫برنامه‬‫کامپایل‬‫شده‬‫به‬CPU
‫تست‬‫و‬‫دیباگ‬‫نمودن‬‫برنامه‬‫دانلود‬‫شده‬
‫نکته‬
‫در‌صورت‌نیاز‌به‌به‌اطالعات‌بیشتر‌در‌مورد‌بالک‌ها،‌به‌عنوان‌مثال‌این‌که‌بالک‌تابع‌موردنظر‌چه‬
‫ورودی‬/‌‫خروجی‌هایی‌دارد،‌بالک‌مربوطه‌در‌کتابخانه‌را‌انتخاب‌کنید‌و‌سپس‌کلید‬F1‫را‌فشار‌دهید‬‌.‌‫این‌کار‬
‫راهنمای‌کاربری‌را‌برای‌این‌بالک‌باز‌خواهد‌کرد‬.
‫مدرس‬:‫اکبری‬ ‫صادق‬
Tel. 09123182734
SIMATIC PCS7 Training
CFC Language
‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬
‫نیرو‬ ‫آب‬-‫پاییز‬96
With Memory Reset
Object‫ها‬‫و‬Tag‫ها‬‫دز‬WINCC‫پاک‬‫شده‬‫و‬‫از‬‫نو‬‫ساخته‬‫می‬‫شود‬.
‫با‬‫کامپایل‬OS‫دیتا‬‫از‬‫سیستم‬AS‫در‬ES‫به‬OS‫منتقل‬‫می‬‫گردد‬.
‫در‬‫صورت‬‫ظاهر‬‫شدن‬‫پیام‬‫خطا‬‫در‬‫شروع‬‫کامپایل‬‫به‬‫معنی‬‫کامپایل‬‫نشدن‬‫یک‬‫یا‬‫چند‬CFC‫می‬‫باشد‬.
‫مدرس‬:‫اکبری‬ ‫صادق‬
Tel. 09123182734
SIMATIC PCS7 Training
CFC Language
‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬
‫نیرو‬ ‫آب‬-‫پاییز‬96
With Memory Reset
Object‫ها‬‫و‬Tag‫ها‬‫دز‬WINCC‫پاک‬‫شده‬‫و‬‫از‬‫نو‬‫ساخته‬‫می‬‫شود‬.
‫با‬‫کامپایل‬OS‫دیتا‬‫از‬‫سیستم‬AS‫در‬ES‫به‬OS‫منتقل‬‫می‬‫گردد‬.
‫در‬‫صورت‬‫ظاهر‬‫شدن‬‫پیام‬‫خطا‬‫در‬‫شروع‬‫کامپایل‬‫به‬‫معنی‬‫کامپایل‬‫نشدن‬‫یک‬‫یا‬‫چند‬CFC‫می‬‫باشد‬.
‫مدرس‬:‫اکبری‬ ‫صادق‬
Tel. 09123182734
SIMATIC PCS7 Training
CFC Language
‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬
‫نیرو‬ ‫آب‬-‫پاییز‬96
‫در‬‫صورتی‬‫که‬‫تایپ‬‫فانکشن‬‫‌های‬‫ک‬‫‌بال‬‫استفاده‬‫شده‬‫در‬‫چارت‬‫تغییر‬،‫یابد‬‫‌توان‬‫ی‬‫م‬‫‌های‬‫ک‬‫بال‬‫استفاده‬‫شده‬‫را‬‫ب‬‫روزآوری‬‫کرده‬‫و‬
‫با‬‫تایپ‬‫جدید‬‫جایگزین‬‫نمود‬.
‫این‬‫کار‬‫با‬import‫کردن‬‫تایپ‬‫جدید‬‫به‬‫پوشه‬CFC Chart‫انجام‬‫‌گیرد‬‫ی‬‫م‬.
‫بین‬‫‌های‬‫ک‬‫بال‬‫موجود‬‫در‬‫پوشه‬Blocks‫که‬‫تایپ‬‫جدید‬‫وجود‬‫دارد‬‫و‬‫پوشه‬Charts‫مقایسه‬‫صورت‬‫‌گیرد‬‫ی‬‫م‬.
Central typechangesmeanthat all instancesof a block typealreadyincludedin CFC charts areautomaticallyupdatedif the blocktype is
changed.For example,a userblock is modified later afterits instanceshavebeenused in CFC charts. You can
updateall the instancesbyimporting the newtype to the CFC Chart Folder.
The function, “Importingblock type”,canbe foundfollowing the menupath: Options > BlockTypes. See Picture
Alternatively, you canusethe New Version functionto updateblocktypes usedin a project. SeePicture.
The BlockTypes dialog is whereblock typesare comparedbetweenthe Blocks folderandthe CFC Chartfolder. Block typesin thesetwo
folders haveto bethe same.
The functionof the central typechangeis useful andpowerful.If the PCS 7 library blockshavebeenchangedbySiemens dueto a newer
releaseof the system. Youhaveto decideif the newerversionof the blocks is to beusedin yourproject.
‫مدرس‬:‫اکبری‬ ‫صادق‬
Tel. 09123182734
SIMATIC PCS7 Training
CFC Language
‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬
‫نیرو‬ ‫آب‬-‫پاییز‬96
If block instancesaredeletedfrom a chartor deletedbecauseof deleting charts, their types will not be deletedeither fromthe CFC Chart
folder orfrom the Blocksfolder thoughthe blocktypes arenot used in the project.
Block typesthat are not usedin a projectcanbe removedfromthe project byusing the Clean up functionas shown in Picture
Using the function, youwill be askedif block typeis to be removedfromthe CFC Chartfolder (Steps 2 and 3 in Picture) andBlocksfolder
(Steps 3 and 4 in Picture 6.10)respectively.
Note
The library blocks,e.g. SFB36 as in Picture, could beremovedas they arecontainedin the firmwareof AS.
‫مدرس‬:‫اکبری‬ ‫صادق‬
Tel. 09123182734
SIMATIC PCS7 Training
CFC Language
‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬
‫نیرو‬ ‫آب‬-‫پاییز‬96
Locate Change To detect possible changes between e.g.
 already instantiated blocks in the project and
 the associated library substitute
before any further use, you can compare blocks - as shown above:
Right-click on selected blocks or blocks to be checked (here FBs from the
library --> Compare blocks... --> Specify comparison path/objects (here
select block container for the project).
Result A: No deviations identified in compared objects
Result B: List of objects with deviation + specific description
Note This is only a "fast comparison" without additional options (where are any
differences?).
From the PCS 7 viewpoint, the VXM option (Version Cross Manager) offers
more efficient information (also for non-programmers). This application will be
discussed later. However, the VXM does not evaluate the consequences for the
S7 program if the change were carried out.
A further possibility is shown on the next pages.
This indicates the consequences of a possible synchronization with the option
for aborting the commenced synchronization if the change does not appear to
be appropriate (e.g. downloading only possible with CPU stop).
‫مدرس‬:‫اکبری‬ ‫صادق‬
Tel. 09123182734
SIMATIC PCS7 Training
CFC Language
‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬
‫نیرو‬ ‫آب‬-‫پاییز‬96
Functions couldcall other functions.
The calledfunctions aresub-functionsandareblock typesthem. For example,a closedloop controlblock calls a signaling blockanda
controlling block.
When copyinga multi-instanceblock to a project (to the Blocksfolder) all sub-blockshaveto be copiedinto the blockfolder as well.
Note
Called SFBs and SFCs, suchas SFC6 (RD_SINFO) or SFB0 (CTU) arelocated firstly in the PCS 7 libraries andcopiedinto your S7 program
whenyou compilethe calling block.
Called FBs are copiedto the blockfolder whenyouinsert thecalling block in a CFC chart if they are locatedin the samelibrary as the calling
block. Otherwise, the calledblocks haveto becopiedinto the S7 programBlocks foldermanually.
‫مدرس‬:‫اکبری‬ ‫صادق‬
Tel. 09123182734
SIMATIC PCS7 Training
CFC Language
‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬
‫نیرو‬ ‫آب‬-‫پاییز‬96
Multiple Instance The FB602 is structured so that another, already existing FB40 can be called
within it. This FB is detected as static variable with the data type FB and allows
to achieve nesting of variables and concentration of all instance data in one
instance data block (multiple instance).
Structure If you want to look at the structure of your new block, proceed as follows:
- In the block folder of your library, select FB40 (INT_P), then
right-click and select Open Object.
LAD/STL/FBD is opened.
- Close the block only via
File -> Close (Do not save, if you are prompted to save!)
- In this editor open your block FB602 (V_SIM_FB) via
right-click and select Object -> Open
Now you can see the above structure on your screen.
Attributes - Position the mouse pointer in a line (with green marking), then
right-click and select Object properties -> Attributes
to display the table with attributes (properties) of the parameter.
Changes If you change/supplement attributes here, and then save the block, it will be
given an STL identification. The changes must be made known to the CFC (if
the block has already been used). Further consequences arise from the type of
modified attributes.
‫مدرس‬:‫اکبری‬ ‫صادق‬
Tel. 09123182734
SIMATIC PCS7 Training
CFC Language
‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬
‫نیرو‬ ‫آب‬-‫پاییز‬96
The interface between the operating system of a CPU and the user program are the tasks known in S7 as organization blocks (OB).Using these
OBs, specific programsections canbe executedat certain times and in certain situations.
There areOBs for CPU startup, for processinterrupts, and for cyclic interrupts(with different time bases)etc.
For example,OB32has cyclicinterrupts every 1 second.Function blocksinserted in OB32are called every second.
When ablock is inserted in a chart, by defaultit is automatically installed in OB35. The cycletime of OB35 is 0.1 seconds.
OBs cannotbe inserted nor edited in CFC. In CFC, the OBs are displayed in the Runtimeeditor.
OBs with differenttime cycles areset in the HW Config as illustrated in Picture.
Note
The defaultcycles areset as in Picture. It is recommended notto changethe default settings.
‫مدرس‬:‫اکبری‬ ‫صادق‬
Tel. 09123182734
SIMATIC PCS7 Training
CFC Language
‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬
‫نیرو‬ ‫آب‬-‫پاییز‬96
‫‌هایی‬‫ه‬‫مشخص‬‫چون‬Run Sequence‫و‬Runtime group،‫برای‬‫پاسخ‬CPU‫برحسب‬‫زمان‬،‫واکنش‬‫زمان‬،‫مرده‬‫یا‬‫ثبات‬‫ساختارهای‬
‫وابسته‬‫به‬،‫زمان‬‫به‬‫عنوان‬‫مثال‬‫کنترل‬‫حلقه‬‫بسته‬.‫تعیین‬‫کننده‬‫‌باشد‬‫ی‬‫م‬.
‫برای‬‫باز‬‫کردن‬‫پنجره‬Runtime Sequence‫به‬‫دور‬‫روش‬‫‌توان‬‫ی‬‫م‬‫عمل‬‫کرد‬:
‫از‬‫طریق‬‫دگمه‬RuntimeSequence‫در‬Toolbar
‫راست‬‫کلیک‬‫بر‬‫روی‬‫بالک‬‫و‬‫اتخاب‬‫گزینه‬Goto Insert Point
‫‌های‬‫ت‬‫قابلی‬‫پنجره‬Runtime Sequence
‫تغییر‬OB‫اختصاص‬‫داده‬‫شده‬‫به‬‫بالک‬
‫انتقال‬‫یک‬‫مجموعه‬RuntimeGroup‫یا‬‫یک‬‫بالک‬‫خاص‬‫از‬‫زیر‬‫مجموعه‬‫یک‬OB‫به‬‫زیرمجموعه‬OB‫دیگر‬.
‫امکان‬drag‫کل‬‫یک‬‫چارت‬‫و‬drop‫آن‬‫به‬‫درون‬‫یک‬OB‫دیگر‬
‫نکته‬:‫در‬‫پنجره‬RuntimeSequence‫فهرست‬‫تمامی‬OB‫ها‬‫حتی‬‫در‬‫صورت‬‫عدم‬‫وجود‬OB‫موردنظر‬‫در‬CPU‫مشاهده‬‫‌شود‬‫ی‬‫م‬.
‫مدرس‬:‫اکبری‬ ‫صادق‬
Tel. 09123182734
SIMATIC PCS7 Training
CFC Language
‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬
‫نیرو‬ ‫آب‬-‫پاییز‬96
When ablock insertedinto a CFC chart, a blockis installed in a runtime groupin default OB.
It is important to re-locatethe runtime groupinto an appropriateOB.
A runtime groupis createdwhenyou insert a CFC chart.
When ablock is placedon anempty CFC chart, the blockis installed inside the group.Subsequentlydragged-and-droppedblockson the chart
arearrangedin the groupandthe orderin which they areplaced.
‫پردازش‌بالک‬
‫‌های‬‫ک‬‫محل‌پردازش‌پیش‌فرض‌بال‬PCS7‫در‬OB35(Cyclic InterruptOBs-100ms)‫است‬.
‌‫‌های‌کتابخانه‬‫ک‬‫بیشتر‌بال‬PCS7‌‫فقط‌در‬Cyclic InterruptOBs‫قابل‌اجرا‌هست‬.
‌‫در‌صورتی‌که‌حجم‌اجرای‌برنامه‌به‌صورتی‌باشد‌که‌اجرای‌آن‌بیش‌از‌زمان‌تنظیم‌شده‌در‬HWConfig‌‫برای‬OB‌‫مورد‌نظر‬
‫باشد‬‌.CPU‌‫با‌مشکل‌مواجه‌خواهد‌شد‌که‌این‌مشکل‌در‬OB1‫وجود‌ندارد‬.
‌‫شماره‬Runtime Group‌‫شماره‌مربوط‌به‌چارت‬CFC‌‫در‌زیرمجموعه‬OB‌‌‫و‌شماره‬RuntimeSequence‌‫شماره‌یا‌ترتیب‌اختصاص‬
‫‌باشد‬‫ی‬‫داده‌شده‌برای‌پردازش‌بالک‌در‌درون‌چارت‌م‬.
‌‫در‌فهرست‬RuntimeGroup‌‫تمام‬OB‌‫های‌تعریف‌شده‌در‬S7‫‌اند‬‫ه‬‫لیست‌شد‬‌.‌‫ممکن‌است‬CPU‌‫انتخاب‌شده‌تمام‌این‬OB‌‫ها‌را‬
‫پشتیبانی‌نکند‬‌‌.
‌‫در‌صورت‌عدم‌وجود‬OB‌‫در‬CPU‫‌گردد‬‫ی‬‫برنامه‌دچار‌فالت‌م‬.
‌‫اگر‌بالکی‌به‌صورت‌مستقیم‌و‌بدون‬Group‌‫در‌زیر‬OB35‌‫قرار‌گیرد‌در‌این‌صورت‌شماره‬1/-‫خواهد‌گرفت‬‌‌.
‫مدرس‬:‫اکبری‬ ‫صادق‬
Tel. 09123182734
SIMATIC PCS7 Training
CFC Language
‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬
‫نیرو‬ ‫آب‬-‫پاییز‬96
Run Sequence
‫بر‬‫روی‬‫آیکون‬Run Sequence‫در‬‫میله‬‫ابزار‬(‫که‬‫به‬‫صورت‬‫دایره‬‫قرمز‬‫رنگ‬‫نشان‬‫داده‬‫شده‬)‫کلیک‬‫کنید‬.‫یک‬‫پنجره‬‫باز‬‫م‬‫ی‬‫شود‬
‫که‬‫در‬‫آن‬‫تمام‬‫بالک‬‫های‬OB‫مربوط‬‫به‬CPU‫فهرست‬‫شده‬‫است‬.
‫وقتی‬‫یک‬‫پروژه‬‫ایجاد‬‫می‬‫شود‬‫پیش‬‫فرض‬(Predecessor)‫نصب‬‫بالک‬‫ها‬‫در‬OB‫ها‬‫بر‬‫روی‬OB35‫تنظیم‬‫شده‬‫است‬.‫به‬‫این‬‫معنی‬‫که‬
‫وقتی‬‫یک‬‫چارت‬‫ایجاد‬‫می‬‫شود‬.‫یک‬runtime group‫به‬‫صورت‬‫اتوماتیک‬‫در‬OB35‫به‬‫اسم‬‫همان‬
‫چارت‬‫ایجاد‬‫‌شود‬‫ی‬‫م‬.‫وقتی‬‫بالک‬‫ها‬‫به‬‫چارت‬‫اضافه‬‫می‬‫شوند‬‫به‬‫صورت‬‫اتوماتیک‬‫در‬‫این‬Runtime
Group‫گروه‬‫بندی‬‫می‬‫شوند‬.
Moving the RuntimeGroup
‫برای‬‫تغییر‬OB‫مربوط‬‫به‬‫یک‬Run Time Group(‫چارت‬CFC)‫سیمبل‬‫پوشه‬Run Time Group‫ایجاد‬‫شده‬‫برای‬‫چارت‬‫جدید‬(َ‫ال‬‫مث‬
‫پوشه‬Test‫در‬‫شکل‬‫باال‬)‫را‬‫با‬‫ماوس‬‫گرفته‬‫و‬‫به‬‫داخل‬‫یک‬OB‫دیگر‬(OB32)‫بکشید‬‫که‬‫در‬‫داخل‬
CPU‫این‬OB‫با‬‫سیکل‬‫زمانی‬‫متفاوت‬‫اجرا‬‫می‬‫شود‬.
‫برای‬‫اینکه‬‫در‬‫زمان‬‫ایجاد‬‫چارت‬‫های‬،‫جدید‬‫‌ها‬‫ت‬‫چار‬‫در‬‫یک‬OB‫دیگری‬‫غیر‬‫از‬OB35‫نصب‬‫شوند‬‫بایستی‬‫یک‬‫پیش‬‫فرض‬
‫نصب‬‫دیگری‬(Predecessorfor installation)‫تعریف‬‫کرد‬.
Predecessorfor Installation
‫برای‬‫تغییر‬OB،‫‌فرض‬‫ش‬‫پی‬OB‫مورد‬‫نظر‬(‫مثال‬OB32)‫را‬‫اتخاب‬‫کرده‬‫و‬‫سپس‬‫با‬‫راست‬‫کلیک‬‫روی‬‫آن‬‫گزینه‬Predecessor for
installation position‫را‬‫اجرا‬‫کنید‬.‫با‬‫این‬‫کار‬‫مکان‬‫جدید‬‫پس‬‫از‬‫تایید‬‫پنجره‬‫عملیاتی‬‫تعیین‬‫م‬‫ی‬‫شود‬.
‫لذا‬‫بالک‬‫های‬‫بعدی‬‫در‬Run Time Group‫انتخاب‬‫شده‬‫قرار‬‫خواهند‬‫گرفت‬.
Run Time Group‫به‬‫صورت‬‫رنگ‬‫سبز‬‫روشن‬‫خواهد‬‫شد‬‫و‬‫پیش‬‫فرض‬‫جدید‬OB32/test‫در‬‫قسمت‬‫پایین‬‫و‬‫سمت‬‫راست‬‫پنجره‬
CFC‫نشان‬‫داده‬‫خواهد‬‫شد‬.(‫شکل‬‫را‬‫ببینید‬).
‫مدرس‬:‫اکبری‬ ‫صادق‬
Tel. 09123182734
SIMATIC PCS7 Training
CFC Language
‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬
‫نیرو‬ ‫آب‬-‫پاییز‬96
The defaultsequenceof blocksin anOB by no meansrepresentsthe signal flow betweenthe blocks. Generally,blocks shouldbe executedin
a logic sequencewhichdependson signal flows. For example,blocksin Picture should bearrangedin the
following order:
 (1) Block FB_OPENor FB_CLOSE
 (2) Block VALVE
 (3) Block OUT
To arrangeblocksin a logic order, the function“OptimizeRun Sequence”is used.
The menupathto call up the functionandsettings of the function is illustrated in Picture.
If “Optimize runsequence”is performed,the blocks of the groupwill bearrangedaccordingto the signal flow sequencebetween theblocks.
In debuggingandtesting, youcanactivate or de-activatethe Optimize run sequencefunction byselect or de-selectthe Active box(Step 3 of
Picture).
‫مدرس‬:‫اکبری‬ ‫صادق‬
Tel. 09123182734
SIMATIC PCS7 Training
CFC Language
‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬
‫نیرو‬ ‫آب‬-‫پاییز‬96
Reductionratio
The reductionratio determineswhethertheCFCblocks/SFCchartsofa runtime groupare processedeachtime oronlyevery nth time thetaskis
executed."n"is an integer(n = 2t,where 0 <= t <= 15).
The cycle times are a multiple ofthebasic reductionratio ofthetask.
Example:
Basic cycle ofa cyclic interrupt(OB 33): 500ms
Possibleclock cycles with reductionratio: 1 s, 2s, 4 s, 8 s,16 s, etc.
The default settingis 1 sotheblock/SFCchart is executedin every cycle (in OB 33every500ms).
Phaseoffsetallows a uniformdistributionofload within theCPU.It mustbe consideredin conjunctionwith "n", thereductionratio. The blocks or
SFCchartsofthe runtimegroupare executedas oftenas specified by"n", offset by"m"unitsofthe taskcycle. "m" is an integer, where0<= m<=
(n-1).
Example:
Basic cycle ofa cyclic interrupt: 500ms
Reductionratio: 16(i.e., theblock/SFCchart is processedatintervals of 8 s)
Phaseoffset:3. The block/SFCchart is processedat intervals of 1.5s, 9.5 s, 17.5s,etc.
The default is 0; in otherwords,the block/SFCchart is executedwithouta phaseoffset.
"Optimizerunsequence"option
Youcan select/deselectthecheckboxin orderto include orexcludea runtime groupfrom run sequenceoptimization.If theruntime groupscontains
F objects,the optionis notenabled.
Youwill find moredetailed information in: Optimizing therun sequence
"Active"option
Youcan select/deselectthecheckboxin orderto enable/disablethe runtimegroupfor processing,if it is notinterconnected.Aninterconnection
alwayshas priority.
In the detailwindowof theruntimeeditorin thecolumn"Inactive", the modeofthe runtimegroupis displayed.The namecorrespondswiththatof
theruntime propertiesfield ofa block. This character"!" meansthatthe relevant runtimegroupis inactive; this character "?" meansthatthe runtime
groupEN is interconnectedorSFCaccessexistsandtherefore is notin static processmode(may beactive or inactive).
Usingthe shortcutmenucommandsSwitchonRuntimeGroupandSwitchoff RuntimeGroup,youcan select ordeselectthe optionfortheselected
runtimegroup,withoutinitiating the objectproperties.
‫مدرس‬:‫اکبری‬ ‫صادق‬
Tel. 09123182734
SIMATIC PCS7 Training
CFC Language
‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬
‫نیرو‬ ‫آب‬-‫پاییز‬96
The Optimize runsequenceoption hasto beset oneby onefor eachruntime group.However,the option is set by default.
The Optimize runsequencefunctionis executedby the menupath as illustrated in Picture.
The Optimizing runsequencefunctionis relevantto all runtime groupsratherthan the blocksin an AS that havebeenactivated forthe
function. Therefore,the function couldchangea largenumberof blockscontainedin differentCFC chartsand
has a globalimpact onthe behaviorof runtimeperformanceof a S7 program.
After optimizing run sequence, the blocks on the
chart, val, are re-arranged.
‫مدرس‬:‫اکبری‬ ‫صادق‬
Tel. 09123182734
SIMATIC PCS7 Training
CFC Language
‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬
‫نیرو‬ ‫آب‬-‫پاییز‬96
.
‫مدرس‬:‫اکبری‬ ‫صادق‬
Tel. 09123182734
SIMATIC PCS7 Training
CFC Language
‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬
‫نیرو‬ ‫آب‬-‫پاییز‬96
Runtime groups can be activated or deactivated individually (for example by a block output of the "BOOL"data type).
If a runtime group is deactivated, the blocks it contains will not be executed when the program is executed.
You can also de-activate an OB in runtime.
‌‫کنترل‌یک‬CFC‌‫از‌یک‬CFC‫دیگر‬
‌‫روی‌خروجی‌بالک‌در‌یک‬CFC‌‫کلیک‌و‌گزینه‬Interconnection to Runtime Group‫‌کنیم‬‫ی‬‫را‌انتخاب‌م‬
‌‫سپس‌از‌لیست‌نمایش‌داده‌شده‬OB‌‫و‬CFC‌‫مورد‌نظر‌بکار‌رفته‌در‌آن‬OB‫‌کنیم‬‫ی‬‫را‌انتخاب‌م‬.
‌‫با‌این‌کار‌پرچم‌قرمز‌رنگ‌در‌بخش‌اتصاالت‌خروجی‬CFC‫‌شود‬‫ی‬‫اول‌ظاهر‌م‬.
‌‫با‌این‌کار‬Enable‌‫مربوط‌به‬CFC‌‫دوم‌به‌یک‌شدن‌خروجی‌موردنظر‌در‬CFC‫اول‌بستگی‌خواهد‌داشت‬.
‌‫‌ها‌در‬‫ک‬‫بر‌روی‌بال‬CFC‫‌شود‬‫ی‬‫دوم‌عالمت‌سوال‌؟‌ظاهر‌م‬.
‫مدرس‬:‫اکبری‬ ‫صادق‬
Tel. 09123182734
SIMATIC PCS7 Training
CFC Language
‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬
‫نیرو‬ ‫آب‬-‫پاییز‬96
Interconnecting Runtime GroupStatically
If youselect a runtimegroupin theruntimesequenceandopenits properties,theActive optionis set.This meansthatallblocks
from this groupare takeninto accountfor eachOB pass.
If youdeactivatethis option,noneoftheblocks in thegroupare takenintoaccount/processed.
In theassociatedCFC chart all blocksdisplay a red exclamationmarkin therectangle showingtheexecutiondata.This indicates to
theconfiguringengineer that theblockis notactive!
Alternative Select the runtimegroupin theruntimesequenceandexecutetheprocessusingthe contextmenuby
right-clickingandselectingSwitchon(activate)RuntimeGroup or
right-clickingandselectingSwitch off(Deactivate)runtimegroup
‫مدرس‬:‫اکبری‬ ‫صادق‬
Tel. 09123182734
SIMATIC PCS7 Training
CFC Language
‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬
‫نیرو‬ ‫آب‬-‫پاییز‬96
‫‌‌بالک‬‫ن‬‫یک‌فانکش‬‫به‌دو‌صورت‌در‬S7‫‌شود‬‫ی‬‫‌سازی‌م‬‫ه‬‫پیاد‬:
‫نوشتن‬‫یک‬‌‫ن‬‫فانکش‬‫بالک‬‫به‬‫زبان‬‫های‬‫پایه‬FBD-LAD-STL‫در‬‫قالب‬FB‫یا‬FC‫و‬‫فراخوانی‬‫آن‬‫در‬‫محیط‬CFC
‌‫نوشتن‌یک‌برنامه‌به‌زبان‬SCL‫و‌کامپایل‌آن‌در‌قالب‬FB‌‫و‌فراخوانی‌آن‌در‌محیط‬CFC
FC‌‫یا‬FB‌‫موردنظر‌در‌محیط‬ComponentView‫‌شود‬‫ی‬‫ساخته‌م‬.
‌‫شماره‌اختصاص‌داده‌شده‌به‬FC‫فقط‌در‌رنج‌مجاز‌امکان‌پذیر‌است‬.
‌‫‌های‌مجاز‌برای‌تولید‬‫ه‬‫شمار‬FC‌‫توسط‌کاربراز‌منوی‬Options‫تنظیم‌می‌شود‬.
‌‫شماره‌مجاز‌از‬60‌‫تا‬700‌‫برای‌کاربر‌یا‌سایر‌برنامه‌ها‌یا‌ماژول‌های‌قابل‌نصب‌در‬PCS7‫‌باشد‬‫ی‬‫م‬.
‫مدرس‬:‫اکبری‬ ‫صادق‬
Tel. 09123182734
SIMATIC PCS7 Training
CFC Language
‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬
‫نیرو‬ ‫آب‬-‫پاییز‬96
‫در‬‫داخل‬‫چارت‬CFC‫‌توان‬‫ی‬‫م‬‫ورودی‬/‫خروجی‬‫بالک‬‫ها‬‫را‬‫به‬I/O‫‌های‬‫تعریف‬‫شده‬‫برای‬‫چارت‬‫متصل‬‫کرد‬.
‫امکان‬‫اتصال‬‫‌های‬‫ه‬‫پای‬‫‌ها‬‫ک‬‫بال‬‫برای‬‫برخی‬‫از‬‫‌ها‬‫ک‬‫بال‬‫مانند‬‫‌های‬‫ک‬‫بال‬Driver‫که‬‫بایستی‬‫به‬‫کانال‬‫فیزیکی‬‫متصل‬،‫گردد‬‫به‬Chart IO
‫وجود‬‫ندارد‬.
‫مراحل‬‫فراخوانی‬‫یک‬‫چارت‬CFC‫از‬‫چارت‬CFC‫دیگر‬(ChartIn Chart)‫‌انداز‬‫ت‬‫عبار‬:
‫فعال‬‫کردن‬‫پنجره‬Chart Input/output‫از‬‫منوی‬View‫ویرایشگر‬CFC
‫تعریف‬‫پارامترهای‬‫ورودی‬‫و‬‫خروجی‬‫برای‬‫یک‬‫چارت‬CFC
‫اتصال‬‫متغییرهای‬‫تعریف‬‫شده‬‫به‬‫ورودی‬‫خروجی‬‫های‬‫‌ها‬‫ک‬‫بال‬‫در‬‫درون‬‫چارت‬
–‫است‬‫ر‬‫کلیک‬‫بر‬‫روی‬‫پایه‬‫موردنظر‬‫و‬‫انتخاب‬‫ینه‬‫ز‬‫گ‬Interconnect ToChart I/O
–‫ظاهر‬‫شدن‬‫پرچم‬‫سفید‬‫نگ‬‫ر‬‫در‬‫بخش‬‌‫ی‬‫خاکستر‬‫نگ‬‫ر‬
‫مدرس‬:‫اکبری‬ ‫صادق‬
Tel. 09123182734
SIMATIC PCS7 Training
CFC Language
‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬
‫نیرو‬ ‫آب‬-‫پاییز‬96
Chart inChart Purposeofthis technique: Todesignclear,well-structured charts.
Chart sectionsthat are repeatedlyusedwith thesamestructurecanbe combinedtolooklike onechart with a predefinedsheetbar -
andthuslike a blockwith I/O.
Procedure 1.Thelower-levelchart is created andgiveninterconnections(this canalso becarried outin a (masterdata) library).
2.Thepreviouslycreated chartis inserted in the higher-levelchart.Thereit its displayed like ablock;its sheetbar(I/O) was
defined in step1.
3.If thelower-level chart wascreated in a library andwasdraggedintothetopchart,it will notbeshownin theproject's chartfolder
(as youcan onlysee thetopchart there).Theassociated blocksare inserted in theruntimesequence.Youcanchangetheir sequence
in there if required.
Alternative: If youobtainthe"New chart" from theCatalog tab"Blocks" andplace it as anemptychart in theCFC chart,thenyoucan implement
a top-downapproach- i.e. reverse thesequencein points 1and2in theabovedescribedprocedure:
1.In thehigher-level chart,first place "only" emptycharts aswildcards for specific functions; thefunctionis documentedfirst
"only" as nameof therespective empty"black box".Theresult is a functionoverviewchart consistingof thevariousindividual
charts.
In thesecondstep,thedetails are addedtotheseindividual chartsas lower-levelcharts,i.e. "filled" with blockfunctionality and
providedwithchart interconnections.
3.Nowyoucan interconnecttheindividual charts in thehigher-level chart.
‫مدرس‬:‫اکبری‬ ‫صادق‬
Tel. 09123182734
SIMATIC PCS7 Training
CFC Language
‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬
‫نیرو‬ ‫آب‬-‫پاییز‬96
the chart-in-charttechniqueis a functionfor efficient engineering.
This involvesinserting oneCFC chartinto another.The insertedchart thenbecomesthe hierarchicalchartandthe other the basechart.
This enablesyouto createa chart onceand thenuse it as the basis for numerousothercharts. This means,for example,you cancreatea
simulation chartfor a valveand theninsert this simulation chart as a hierarchicalchart into the basechart for
the "valve"processtag.
Of course,you canopenandedit the hierarchicalchartfrom the basechartat anytime.
Example:
As mentionedandshown in Picture, You couldplacea chart ontoanotherchart. the chart, CFC_val, is placedonto CFC_2.
The chartnesting structure is displayedin the Blocks/chartscatalogueas shown in Picture whereChart CFC_2containsCFC_val.
Picture also shows howto openthe original chart(Step 3).
‫مدرس‬:‫اکبری‬ ‫صادق‬
Tel. 09123182734
SIMATIC PCS7 Training
CFC Language
‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬
‫نیرو‬ ‫آب‬-‫پاییز‬96
‫مدرس‬:‫اکبری‬ ‫صادق‬
Tel. 09123182734
SIMATIC PCS7 Training
CFC Language
‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬
‫نیرو‬ ‫آب‬-‫پاییز‬96
‫مدرس‬:‫اکبری‬ ‫صادق‬
Tel. 09123182734
SIMATIC PCS7 Training
CFC Language
‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬
‫نیرو‬ ‫آب‬-‫پاییز‬96
Compiling CFC chartas block type(Chart-in-Block)
You cancompilea chartas a block. Blockinstancesin the chartbecomesubsectionsof the chart block.A chartblockis then a blocktype.
Note
To makea chartout of a block, the blocksin the chartmust not be installed in a runtime groupandtheyshould not haveinterconnectionsto
other charts.
‫مدرس‬:‫اکبری‬ ‫صادق‬
Tel. 09123182734
SIMATIC PCS7 Training
CFC Language
‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬
‫نیرو‬ ‫آب‬-‫پاییز‬96
‫پس‬‫از‬‫تعریف‬I/O‫برای‬‫یک‬،‫چارت‬‫‌توان‬‫ی‬‫م‬‫چارت‬‫را‬‫به‬‫عنوان‬‫یک‬‫بلوک‬‫کامپایل‬‫کرد‬.
‫لذا‬‫برای‬‫استفاده‬‫از‬‫بالک‬‫در‬‫‌ها‬‫ت‬‫چار‬‫نیاز‬‫است‬‫که‬‫برای‬IO‫های‬‫چارت‬‫که‬‫‌های‬‫ر‬‫پارامت‬‫بالک‬‫حاصل‬‫از‬‫کامپایل‬‫خواهد‬،‫بود‬
‫همانند‬SCL‫‌هایی‬‌‫ی‬‫ویژگ‬(attributes)‫تعریف‬‫کنیم‬.
‫تصویر‬‫نشان‬‫میدهد‬‫که‬‫چگونه‬‫برای‬‫باز‬‫کردن‬‫خواص‬‫متغیر‬‫محاوره‬‫ارائه‬‫شده‬‫است‬‫که‬‫یک‬‫ن‬‫مودار‬
I / O‫تعریف‬‫را‬‫مشخص‬‫ویژگی‬‫های‬‫سیستم‬‫برای‬‫یک‬‫متغیر‬‫وجود‬‫دارد‬.
‫پنجره‬‫تعریف‬‌‫ی‬‫ویژگ‬‫برای‬‫پارامترهای‬‫انتخاب‬،‫شده‬‫در‬‫تصویر‬‫باال‬‫نشان‬‫داده‬‫شده‬‫است‬.
‫مدرس‬:‫اکبری‬ ‫صادق‬
Tel. 09123182734
SIMATIC PCS7 Training
CFC Language
‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬
‫نیرو‬ ‫آب‬-‫پاییز‬96
For analogvariables, engineeringunits areprovidedat block instances.See Picture.
You canedit andadd units in the file andthey becomeavailablesystem-wide.When upgradingthe PCS 7 systeminstallation, you should
rememberto backup the files.
Storing of the engineering
units
‫مدرس‬:‫اکبری‬ ‫صادق‬
Tel. 09123182734
SIMATIC PCS7 Training
CFC Language
‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬
‫نیرو‬ ‫آب‬-‫پاییز‬96
In the Test Modeof the CFC, you cantest anddebugyourprogram.
The CFC test modeis convenientfortesting oneCFC sheet.
To monitor andmanipulatevariablesfromdifferent chartsand/orfrom differentCPUs, youcould usethe DynamicDisplay function.
‫مدرس‬:‫اکبری‬ ‫صادق‬
Tel. 09123182734
SIMATIC PCS7 Training
CFC Language
‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬
‫نیرو‬ ‫آب‬-‫پاییز‬96
TestMode Youmustactivate "test mode"totest thefunctiondownloadedtotheAS.
 First activate
Debug ProcessMode Or
Debug LaboratoryMode
toselect/checktheappropriate testenvironment.
 Usethe following commandtoactivate/deactivatetest mode:
Debug TestMode
With laboratoryoperation,monitoringis automatically activatedfor theparametersspecified "for test".Duringprocess operation,
youmust select therequired blockeach timeandidentify it for monitoringby
right-clickandselectingWatchOn
Test 1 If thetest modeis active andtheparameters tobetestedhaveayellow background(default settingfor updatedvalues),youcanset
parametersfor theinput parameter.Thenewvalue is written tothe ASandtotheproject.
Changethevalueonthe"First" block,"U" input.Monitortheresult onthe"Second" block,"V" output.
Test 2 DynamicDisplay offers an additionaltest procedure.Youcanopena displaywindowin CFC:
View DynamicDisplay
Use"drag anddrop"in this windowtodragtheblock parametersyouwant tomonitor(from anyoftheprojects- evenfrom different
CPUs). Oneline in thetable is reservedfor eachparameter.
Uponactivation oftest mode,youcanmonitoror edit (if permissible) theseselected parameters.
Youcandelete severalparametersyounolongerneedbyselecting therelevant line,right-clickingandselectingDelete.
YoucanusetheNew ,Renameor Delete buttonsin the tablewindowtocreate, renameor delete newdynamicdisplays.
‫مدرس‬:‫اکبری‬ ‫صادق‬
Tel. 09123182734
SIMATIC PCS7 Training
CFC Language
‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬
‫نیرو‬ ‫آب‬-‫پاییز‬96
Additionalexercise(option)
Trytorecognize theconsequencesof anOB32overload.Use theLOADblock from theKURSBS60library for thispurpose(see
slide). SupplementtheCFC "Attempti"chartas suggestedabove.
-----------------------------------------------------------------------------------------------------
Procedure 1.LOADblock:Switch theloadonusing"ON"=1. Increase theOB32loadbyincreasing theparameter "CYCL".
2.INT block:With theparameters"TI"=1 and"U"=1,theblockwill incrementthe output"ACTUAL" eachtime OB32is called. If
Test  Testsettings Monitoringcycle = 1second
is set in theCFC, thevalue of theoutputwill be incrementedby1 everysecondin test mode.This applies tonormaloperation.
Increase theCYCL input ofthe LOADblock,andobservetheoutput"V" of theINTblock.
Also checkthediagnosticsbuffer of yourCPU usingthe CFC menu
PLC Moduleinformation  "Diagnostics buffer" tab
andthe(OB1) cycle time in thetabwith this name.
3.Connectthe output"V" oftheINT blocktotheinput"U" of theMEAS_MONblock.
In thelatter, select "Long-term archiving" in theproperties of theinput"U" under"Archive".
4.Compile anddownloadtheAS
5.Compile theOS. Theparameter"U" of theMEAS_MOSis created therein TagLogging,in the"System archives" archive.
6.Activate theOS,andcreate anonline trendfor this variable. Carry outthesameincrease totheload in theAS, andcheck the
reaction ontheOS.
‫مدرس‬:‫اکبری‬ ‫صادق‬
Tel. 09123182734
SIMATIC PCS7 Training
CFC Language
‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬
‫نیرو‬ ‫آب‬-‫پاییز‬96
‫مدرس‬:‫اکبری‬ ‫صادق‬
Tel. 09123182734
SIMATIC PCS7 Training
CFC Language
‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬
‫نیرو‬ ‫آب‬-‫پاییز‬96
With Memory Reset
Object‫ها‬‫و‬Tag‫ها‬‫در‬WINCC‫پاک‬‫شده‬‫و‬‫از‬‫نو‬‫ساخته‬‫‌شود‬‫ی‬‫م‬.
‫با‬‫کامپایل‬OS‫‌ها‬‫ر‬‫متغیی‬‫از‬‫سیستم‬AS‫در‬ES‫به‬OS‫منتقل‬‫می‬‫گردد‬.
‫در‬‫صورت‬‫ظاهر‬‫شدن‬‫پیام‬‫خطا‬‫در‬‫شروع‬‫کامپایل‬‫به‬‫معنی‬‫کامپایل‬‫نشدن‬‫یک‬‫یا‬‫چند‬CFC‫می‬‫باشد‬.
‫مدرس‬:‫اکبری‬ ‫صادق‬
Tel. 09123182734
SIMATIC PCS7 Training
CFC Language
‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬
‫نیرو‬ ‫آب‬-‫پاییز‬96
‫مدرس‬:‫اکبری‬ ‫صادق‬
Tel. 09123182734
SIMATIC PCS7 Training
CFC Language
‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬
‫نیرو‬ ‫آب‬-‫پاییز‬96
‫مدرس‬:‫اکبری‬ ‫صادق‬
Tel. 09123182734
SIMATIC PCS7 Training
CFC Language
‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬
‫نیرو‬ ‫آب‬-‫پاییز‬96

More Related Content

What's hot

17 demonstration server client system-v1.00_en
17 demonstration server client system-v1.00_en17 demonstration server client system-v1.00_en
17 demonstration server client system-v1.00_enconfidencial
 
03 requirements and functional process description v1.00_en
03 requirements and functional process description v1.00_en03 requirements and functional process description v1.00_en
03 requirements and functional process description v1.00_enconfidencial
 
08 basics control functions v1.00_en
08 basics control functions v1.00_en08 basics control functions v1.00_en
08 basics control functions v1.00_enconfidencial
 
07 connection to the process v1.00_en
07 connection to the process v1.00_en07 connection to the process v1.00_en
07 connection to the process v1.00_enconfidencial
 
19 exercises v1.00_en
19 exercises v1.00_en19 exercises v1.00_en
19 exercises v1.00_enconfidencial
 
Easily enrich capella models with your own domain extensions
Easily enrich capella models with your own domain extensionsEasily enrich capella models with your own domain extensions
Easily enrich capella models with your own domain extensionsObeo
 
Ch4 v70 system_configuration_en
Ch4 v70 system_configuration_enCh4 v70 system_configuration_en
Ch4 v70 system_configuration_enconfidencial
 
06 blocos de_programação
06 blocos de_programação06 blocos de_programação
06 blocos de_programaçãoconfidencial
 
13 locking functions and operating modes v1.00_en
13 locking functions and operating modes v1.00_en13 locking functions and operating modes v1.00_en
13 locking functions and operating modes v1.00_enconfidencial
 
10 basics automatic mode control v1.00_en
10 basics automatic mode control v1.00_en10 basics automatic mode control v1.00_en
10 basics automatic mode control v1.00_enconfidencial
 
System of systems modeling with Capella
System of systems modeling with CapellaSystem of systems modeling with Capella
System of systems modeling with CapellaObeo
 
00 st pcs7-sys_v8.0_register 20 en
00 st pcs7-sys_v8.0_register 20 en00 st pcs7-sys_v8.0_register 20 en
00 st pcs7-sys_v8.0_register 20 enconfidencial
 
Unleash the power of functional chains with Capella 1.3.1
Unleash the power of functional chains with Capella 1.3.1Unleash the power of functional chains with Capella 1.3.1
Unleash the power of functional chains with Capella 1.3.1Obeo
 
Siemens win cc manual pcs 7 runtime
Siemens win cc manual pcs 7 runtimeSiemens win cc manual pcs 7 runtime
Siemens win cc manual pcs 7 runtimeDien Ha The
 
06 station and network configuration v1.00_en
06 station and network configuration v1.00_en06 station and network configuration v1.00_en
06 station and network configuration v1.00_enconfidencial
 
14 mass data engineering v1.00_en
14 mass data engineering v1.00_en14 mass data engineering v1.00_en
14 mass data engineering v1.00_enconfidencial
 
Ch3 v70 project_structure_en
Ch3 v70 project_structure_enCh3 v70 project_structure_en
Ch3 v70 project_structure_enconfidencial
 
Delta v advanced control overview_en
Delta v advanced control overview_enDelta v advanced control overview_en
Delta v advanced control overview_enLuis Atencio
 

What's hot (20)

17 demonstration server client system-v1.00_en
17 demonstration server client system-v1.00_en17 demonstration server client system-v1.00_en
17 demonstration server client system-v1.00_en
 
03 requirements and functional process description v1.00_en
03 requirements and functional process description v1.00_en03 requirements and functional process description v1.00_en
03 requirements and functional process description v1.00_en
 
08 basics control functions v1.00_en
08 basics control functions v1.00_en08 basics control functions v1.00_en
08 basics control functions v1.00_en
 
07 connection to the process v1.00_en
07 connection to the process v1.00_en07 connection to the process v1.00_en
07 connection to the process v1.00_en
 
plc introduction
plc introductionplc introduction
plc introduction
 
19 exercises v1.00_en
19 exercises v1.00_en19 exercises v1.00_en
19 exercises v1.00_en
 
Easily enrich capella models with your own domain extensions
Easily enrich capella models with your own domain extensionsEasily enrich capella models with your own domain extensions
Easily enrich capella models with your own domain extensions
 
Ch4 v70 system_configuration_en
Ch4 v70 system_configuration_enCh4 v70 system_configuration_en
Ch4 v70 system_configuration_en
 
06 blocos de_programação
06 blocos de_programação06 blocos de_programação
06 blocos de_programação
 
13 locking functions and operating modes v1.00_en
13 locking functions and operating modes v1.00_en13 locking functions and operating modes v1.00_en
13 locking functions and operating modes v1.00_en
 
10 basics automatic mode control v1.00_en
10 basics automatic mode control v1.00_en10 basics automatic mode control v1.00_en
10 basics automatic mode control v1.00_en
 
System of systems modeling with Capella
System of systems modeling with CapellaSystem of systems modeling with Capella
System of systems modeling with Capella
 
00 st pcs7-sys_v8.0_register 20 en
00 st pcs7-sys_v8.0_register 20 en00 st pcs7-sys_v8.0_register 20 en
00 st pcs7-sys_v8.0_register 20 en
 
Unleash the power of functional chains with Capella 1.3.1
Unleash the power of functional chains with Capella 1.3.1Unleash the power of functional chains with Capella 1.3.1
Unleash the power of functional chains with Capella 1.3.1
 
Siemens win cc manual pcs 7 runtime
Siemens win cc manual pcs 7 runtimeSiemens win cc manual pcs 7 runtime
Siemens win cc manual pcs 7 runtime
 
06 station and network configuration v1.00_en
06 station and network configuration v1.00_en06 station and network configuration v1.00_en
06 station and network configuration v1.00_en
 
14 mass data engineering v1.00_en
14 mass data engineering v1.00_en14 mass data engineering v1.00_en
14 mass data engineering v1.00_en
 
CLP S7 300 E S7 400
CLP S7 300 E S7 400CLP S7 300 E S7 400
CLP S7 300 E S7 400
 
Ch3 v70 project_structure_en
Ch3 v70 project_structure_enCh3 v70 project_structure_en
Ch3 v70 project_structure_en
 
Delta v advanced control overview_en
Delta v advanced control overview_enDelta v advanced control overview_en
Delta v advanced control overview_en
 

آموزش و کار با چارت‌های CFC در PCS7

  • 1. ‫مدرس‬:‫اکبری‬ ‫صادق‬ Tel. 09123182734 SIMATIC PCS7 Training CFC Language ‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬ ‫نیرو‬ ‫آب‬-‫پاییز‬96 ‌‫‌های‌پیکربندی‌یک‌چارت‬‫م‬‫گا‬CFC ‌‫چارت‬CFC ‌‫ایجاد‌چارت‬CFC ‌‫کار‌با‌ویرایشگر‬CFC ‫پنجره‌کاتالوگ‬ ‫‌های‌از‌قبل‌آماده‌شده‬‫ک‬‫فانکشن‌بال‬ ‫نوع‌فانکشن‌بالک‬ ‌‫درج‌یک‌فانکشن‌بالک‌به‌یک‬CFC ‫مشخصات‌یک‌فانکشن‌بالک‬ ‌‫‌های‌ورودی‬‫ه‬‫پای‬‌/‫خروجی‌بالک‬ ‫اتصال‌ورودی‬/‫‌های‌بالک‬‫ی‬‫خروج‬ ‫اتصال‌متنی‬ ‫کتابخانه‌پروژه‬ ‫‌های‌یک‌چارت‬‫ک‬‫‌بال‬‫ن‬‫‌آوری‌فانکش‬‫ز‬‫برو‬ ‌‫‌های‌نوع‬‫ک‬‫فانکشن‌بال‬Multi Instance ‌‫‌های‬‫ک‬‫بال‬OB ‌‫‌ها‬‫ک‬‫‌بال‬‫ن‬‫اجرای‌فانکش‬RunSequence ‌‫گروه‌اجرایی‬RuntimeGroup ‫‌ها‬‫ک‬‫‌سازی‌اجرای‌بال‬‫ه‬‫بهین‬ ‫کامپایل‌و‌دانلود‌چارت‬
  • 2. ‫مدرس‬:‫اکبری‬ ‫صادق‬ Tel. 09123182734 SIMATIC PCS7 Training CFC Language ‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬ ‫نیرو‬ ‫آب‬-‫پاییز‬96 ‫چکیده‬CFC‌‫برگرفته‬‌‫از‌سه‬‫کلمه‬ContinuousFunction Chart‫‌باشد‬‫ی‬‫م‬‌.‌‫که‌مهمترین‌ابزار‌برنامه‬‫نویسی‬PCS7‌‫به‬ ‌‫شمار‬‫‌رود‬‫ی‬‫م‬‌.‌‫این‌ابزار‬‌‫همان‌طور‬‌‫که‌از‌اسمش‌پیداست‌برای‬‫‌سازی‌الجیک‌کنترل‌پیوس‬‫ه‬‫پیاد‬‌‫ته‌به‬ ‌‫کار‬‌‫‌رود‬‫ی‬‫م‬‌.‌‫ابزار‌دیگر‌برنامه‌نویسی‌در‬PCS7،‌‫‌های‬‫ت‬‫چار‬SFC‌‫نام‬‌‫دارد‌که‌برای‌کنترل‌ترتیبی‬ (Sequential‌)‫‌باشد‬‫ی‬‫م‬. ‌‫در‬‌‫این‌فصل‌با‌مواری‌مانند‌نحوه‌کار‌با‌ویرایشگر‬CFC،‫‌بالک‬‫ن‬‫مفاهیم‌پایه‌فانکش‬‌.‌‌‫نحوه‌درج‬ ‌‫‌های‬‫ت‬‫‌ها‌در‌چار‬‫ک‬‫‌بال‬‫ن‬‫فانکش‬CFC‌‫و‬‌‫کامپایل‌و‌دانلود‌آنها‌به‬CPU‌‫آشنا‬‌‫شده‌و‌در‌نهایت‌با‌نحوه‬ ‌‫‌ها‌در‬‫ک‬‫تست‌بال‬‫زمان‬Runtime‌‫کار‬‫خواهیم‌کرد‬.
  • 3. ‫مدرس‬:‫اکبری‬ ‫صادق‬ Tel. 09123182734 SIMATIC PCS7 Training CFC Language ‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬ ‫نیرو‬ ‫آب‬-‫پاییز‬96
  • 4. ‫مدرس‬:‫اکبری‬ ‫صادق‬ Tel. 09123182734 SIMATIC PCS7 Training CFC Language ‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬ ‫نیرو‬ ‫آب‬-‫پاییز‬96 ‫کنترل‬‫فرآیند‬‫کنترل‬‫عملیات‬‫یک‬‫فرآیند‬‫به‬‫سه‬‫صورت‬‫کلی‬،‫پیوسه‬‫ترتیبی‬‫و‬‫ترکیبی‬‫از‬‫این‬‫دو‬‫‌تواند‬‫ی‬‫م‬‫انجام‬ ‫شود‬.‫بیشتر‬‫عملیات‬‫یک‬‫پلنت‬‫فرآیندی‬‫توسط‬‫فرآیندهای‬‫پیوسته‬‫توصیف‬‫‌شو‬‫ی‬‫م‬‫د‬.‫این‬‫موضوع‬‫با‬ ‫ایجاد‬‫‌های‬‫ت‬‫چار‬CFC‫در‬‫ویرایشگر‬CFC‫سیستم‬PCS7‫محقق‬‫‌شود‬‫ی‬‫م‬. ‫چارت‬CFC‫برنامه‬‫کنترل‬‫به‬‫زبان‬CFC‫برای‬‫کنترل‬‫عملیات‬،‫پیوسته‬‫که‬‫بایستی‬‫به‬‫طور‬‫مداوم‬‫توسط‬CPU‫اسکن‬‫و‬ ‫پردازش‬،‫شود‬‫به‬‫کار‬‫‌رود‬‫ی‬‫م‬. ‫چارت‬CFC‫‌ترین‬‫م‬‫مه‬‫ابزار‬‫‌نویسی‬‫ه‬‫برنام‬PCS7‫‌باشد‬‫ی‬‫م‬. ‫چارت‬CFC‫یکی‬‫از‬‫اجزاء‬‫قابل‬‫درج‬‫در‬‫محیط‬SIMATIC Manager‫‌باشد‬‫ی‬‫م‬. ‫توسط‬‫ویزارد‬‫ایجاد‬‫پروژه‬‫به‬‫صورت‬‫خودکار‬‫در‬‫سطوح‬‫پلنت‬‫ایجاد‬‫‌گردد‬‫ی‬‫م‬. ‫بهتر‬‫است‬‫چارت‬CFC‫را‬‫در‬‫محیط‬Plant View‫ایجاد‬‫کرد‬. ‫توصیه‬‫‌شود‬‫ی‬‫م‬‫که‬‫نام‬‫هر‬‫چارت‬CFC‫پس‬‫ایجاد‬‫چارت‬‫تغییر‬‫یابد‬. ‫برای‬‫‌سازی‬‫ه‬‫پیاد‬‫برنامه‬‫کنترل‬‫یک‬‫پلنت‬‫با‬‫‌های‬‫ت‬‫چار‬CFC‫دو‬‫روش‬‫وجود‬‫دارد‬: ‫‌سازی‬‫ه‬‫پیاد‬‫کنترل‬‫تمام‬‫‌ها‬‫ش‬‫بخ‬‫و‬‫سطوح‬‫فرآیندی‬‫در‬‫یک‬CFC ‫نوشتن‬‫برنامه‬‫کنترل‬‫هر‬‫سطح‬‫از‬‫پلنت‬‫در‬‫یک‬CFC‫جداگانه‬ ‫ایجاد‬‫چارت‬‫برای‬‫ایجاد‬‫و‬‫تکمیل‬‫‌های‬‫ت‬‫چار‬CFC،‫‌های‬‫ک‬‫بلو‬‫واقع‬‫در‬‫کتابخانه‬PCS7‫در‬‫‌های‬‫ت‬‫چار‬CFC‫درج‬ ‫‌شوند‬‫ی‬‫م‬.‫که‬‫شامل‬‫بلوک‬‫کنترل‬‫فرایند‬‫و‬‫‌های‬‫ک‬‫بال‬‫مانیتورینگ‬‫مقادیر‬‫فرایندی‬‫‌باش‬‫ی‬‫م‬‫د‬.‫پس‬‫از‬‫درج‬ ‫‌ها‬‫ک‬‫بال‬‫در‬‫محیط‬CFC،‫ورودی‬‫و‬‫‌های‬‫ی‬‫خروج‬‫این‬‫‌ها‬‫ک‬‫بلو‬‫به‬‫طور‬‫مستقیم‬‫در‬‫ویرایشگر‬CFC‫به‬‫هم‬ ‫متصل‬‫و‬‫‌های‬‫ر‬‫پارامت‬‫‌ها‬‫ک‬‫بال‬‫مقداردهی‬‫‌شود‬‫ی‬‫م‬. ProcessTag‫تجهیزات‬‫فرایندی‬‫مثل‬‫موتور‬‫و‬‫وولو‬(Motors and Valves)‫از‬‫دیدگاه‬PCS7،‫با‬‫عنوان‬Process Tag‫شناخته‬ ‫‌شوند‬‫ی‬‫م‬.‫برای‬‫کنترل‬‫چنین‬،‫تجهیزاتی‬‫از‬‫قبل‬‫در‬‫کتابخانه‬PCS7،‫‌های‬‫ت‬‫چار‬CFC‌‫ت‬‫تح‬‫عنوان‬Process TagType‫آماده‬‫شده‬‫است‬.‫که‬‫در‬‫‌های‬‫ه‬‫کتابخان‬‫استاندارد‬‫در‬‫شاخه‬Template‫‌اند‬‫ه‬‫‌شد‬‫ی‬‫‌بند‬‫ه‬‫دست‬. ‫برای‬‫حفظ‬‫روشن‬‫ساختار‬‫پروژه‬‫مطابق‬‫با‬‫سطوح‬‫فرایندی‬،‫پلنت‬‫‌های‬‫ت‬‫چار‬CFC‫همیشه‬‫در‬ ‫‌های‬‫ه‬‫پوش‬‫سلسله‬‫مراتبی‬‫پلنت‬(PH)‫ایجاد‬‫و‬‫نگهداری‬‫‌شوند‬‫ی‬‫م‬.
  • 5. ‫مدرس‬:‫اکبری‬ ‫صادق‬ Tel. 09123182734 SIMATIC PCS7 Training CFC Language ‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬ ‫نیرو‬ ‫آب‬-‫پاییز‬96 CFC Charts  Theblockinstancesyouneedtosolvea technologicaltaskdefinition can bedividedinto anynumberof charts.  A CFC chartconsists ofsix pages(overview display)  1pageconsistsof a workarea andtwomarginalbars.  Automatic,chart-spanningmarginal barmanagement  User-friendly signal monitoring  AutoRoute  Resourcesare completely managedfor theuser.  1to1 documentationfor theentire information contents In principle, there are three basic steps: 1. Creating empty CFC charts in the plant hierarchy 2. Copy Blocks from PCS7 Libraries to Master data Library – Inserting individual blocks from MDL in an empty CFC chart 3. Interconnecting the inputs and outputs of blocks and assigning parameter values tothem ‫ویرایشگر‬CFC‫یک‬‫ابزار‬‫گرافیکی‬‫برای‬‫نوشتن‬‫‌های‬‫ه‬‫برنام‬PLC‫با‬‫زبان‬CFC‫‌باشد‬‫ی‬‫م‬. ‫ایجاد‬‫برنامه‬‫کنترل‬‫با‬‫درج‬(Insert)‫‌های‬‫ک‬‫بال‬‫از‬‫قبل‬‫آماده‬‫شده‬‫در‬‫یکی‬‫از‬‫‌ها‬‫ت‬‫شی‬‫و‬‫اتصال‬‫ورودی‬/‫خروجی‬‫آنها‬‫به‬‫هم‬‫صورت‬ ‫‌گیرد‬‫ی‬‫م‬.‫اتصاالت‬‫ممکن‬‫شامل‬: ‫بین‬‫فیلدهای‬IO‫در‬‫یک‬‫شیت‬‫یک‬‫چارت‬ ‫بین‬‫‌های‬‫ک‬‫بال‬‫تابع‬‫درون‬‫‌ها‬‫ت‬‫چار‬ ‫استفاده‬‫از‬Margin bar‫برای‬‫مدیریت‬‫‌های‬‫ل‬‫سیگنا‬‫مبداء‬‫و‬‫مقصد‬ ‫مزایا‬ ‫زبان‬‫برنامه‬‫نویسی‬‫برای‬‫مهندسین‬‫طراح‬ ‫سرعت‬‫بخشیدن‬‫به‬‫‌سازی‬‫ه‬‫پیاد‬‫برنامه‬،‫کنترل‬‫دیباگ‬‫کردن‬‫و‬‫‌اندازی‬‫ه‬‫را‬
  • 6. ‫مدرس‬:‫اکبری‬ ‫صادق‬ Tel. 09123182734 SIMATIC PCS7 Training CFC Language ‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬ ‫نیرو‬ ‫آب‬-‫پاییز‬96 ‫ویرایشگر‬CFC‫با‬‫دابل‬‫کلیک‬‫روی‬‫یک‬‫چارت‬CFC‫باز‬‫‌شود‬‫ی‬‫م‬. ‫چارت‬‫باز‬‫شده‬‫شامل‬‫یک‬‫شیت‬‫خالی‬(A)‫با‬‫شش‬‫قسمت‬‫برای‬‫قرار‬‫دادن‬‫‌های‬‫ک‬‫بال‬‫برنامه‬‫است‬ ‫افزودن‬‫شیت‬‫دیگر‬(B,C,…)‫در‬‫قبل‬‫و‬‫بعد‬‫از‬‫شیت‬A‫با‬‫راست‬‫کلیک‬‫بر‬‫روی‬‫تب‬‫‌ها‬‫ت‬‫شی‬‫در‬‫پایین‬‫پنجره‬‫صورت‬‫‌گیرد‬‫ی‬‫م‬. ‫‌نویسی‬‫ه‬‫برنام‬CFC‫با‬‫کشیدن‬‫‌ها‬‫ک‬‫بال‬‫از‬‫کاتالوگ‬‫سمت‬‫چپ‬‫به‬‫داخل‬‫محیط‬‫و‬‫اتصال‬‫ورودی‬‫و‬‫خروجی‬‫‌ها‬‫ک‬‫بال‬‫به‬‫هم‬‫به‬ ‫صورت‬‫گرافیکی‬‫انجام‬‫‌گیرد‬‫ی‬‫م‬. ‫نمایش‬‫‌های‬‫س‬‫آدر‬‫وروردی‬‫‌ها‬‫ک‬‫بال‬‫در‬‫نوار‬‫خاکستری‬‫سمت‬‫چپ‬‫و‬‫‌های‬‫س‬‫آدر‬‫خروجی‬‫‌ها‬‫ک‬‫بال‬‫در‬‫نوار‬‫خاکستری‬‫سمت‬ ‫راست‬‫شیت‬ ‫ویرایشگر‬CFC‫گزینه‬Save‫و‬Undo‫ندارد‬. IntroductiontotheCFC Editor Theactualediting oftheCFC chartssuchas inserting blocksandassigningparametervalues tothemis donein the CFC Editor. As soonas youopena CFC chart, theCFC Editor opens.Theeditoris always openedin theview in whichit wasclosed thelast time youworkedwith it. With its normalsettings,theCFC Editor is divided upas follows:  Ontheright-handside of theeditor yousee thechart displayed. If youhaveopenedanemptyCFC chart,here youwill simply seean emptyspace.Thisis whereyouinsert blocksas required todescribe continuousprocesses.Thefinal job is to assign parametervaluesandinterconnecttheblocks.  Ontheleft-hand side of theeditor youwill see thecatalogwith blocks,libraries, andcharts. All theworkthatyoudowith theCFC Editoris savedautomatically byPCS 7. Changingfrom theOverview toaSingle Sheet Youcanchangefrom theoverviewtothesingle sheetview bydouble-clicking onthe required sheet.
  • 7. ‫مدرس‬:‫اکبری‬ ‫صادق‬ Tel. 09123182734 SIMATIC PCS7 Training CFC Language ‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬ ‫نیرو‬ ‫آب‬-‫پاییز‬96 ‫کاتالوک‬‫حاوی‬‫‌ها‬‫ک‬‫‌بال‬‫ن‬‫فانکش‬‫یا‬‫‌های‬‫ن‬‫الما‬‫برنامه‬‫نویسی‬‫‌باشد‬‫ی‬‫م‬. ‫از‬‫منوی‬View > Catalog‫یا‬‫از‬‫طریق‬‫منو‬‫ابزار‬‫قابل‬‫نمایش‬‫‌باشد‬‫ی‬‫م‬‫که‬‫دارای‬‫سه‬‫بخش‬‫‌باشد‬‫ی‬‫م‬. Blocks–‫بخش‬‫پیش‬‫فرض‬‫کاتالوگ‬‫بوده‬‫و‬‫حاوی‬‫مجموعه‬‫‌های‬‫ن‬‫الما‬‫پایه‬‫‌نویسی‬‫ه‬‫برنام‬‫‌باشد‬‫ی‬‫م‬. Charts-‫شامل‬‫لیست‬‫‌های‬‫ت‬‫چار‬CFC‫دیگر‬‫موجود‬‫در‬‫پروژه‬‫و‬‫امکان‬‫‌آنها‬‫ی‬‫فراخوان‬‫در‬‫چارت‬‫باز‬‫شده‬‫جاری‬ ‫‌باشد‬‫ی‬‫م‬. Libraries-‫حاوی‬‫لیست‬‫‌های‬‫ک‬‫بال‬‫‌ای‬‫ه‬‫کتابخان‬‫مختلف‬‫‌باشد‬‫ی‬‫م‬. – Step7StandardLibrary – PCS7 Libraries – CFC Library –‫شامل‬‫‌هاي‬‫ه‬‫كتابخان‬‫بوط‬‫ر‬‫م‬‫به‬‫نصب‬‫‌هاي‬‫ه‬‫بست‬Optional‫نظير‬F-System‫و‬CEMAT ‫تفاوت‬‫‌ها‬‫ک‬‫بال‬ ‫‌های‬‫ک‬‫بال‬‫‌های‬‫ه‬‫کتابخان‬PCS7‫برای‬‫کارهای‬‫پیچیده‬‫کنترلی‬‫و‬‫استفاده‬‫از‬‫توابع‬‫از‬‫پیش‬‫تعریف‬‫شده‬‫‌ب‬‫ی‬‫م‬‫اشد‬. ‫پوشه‬Blocks‫حاوی‬‫‌های‬‫ک‬‫بال‬‫پایه‬‫المان‬‫اصلی‬‫یا‬Building Block(BOP)‫هستند‬‫ولی‬‫‌های‬‫ک‬‫بال‬‫‌های‬‫ه‬‫کتابخان‬‫از‬ ‫نوع‬‫فانکشن‬‫و‬‫فانکشن‬‫بالک‬‫هستند‬. ‫برخی‬‫از‬‫‌های‬‫ک‬‫بال‬‫‌های‬‫ه‬‫کتابخان‬‫دارای‬‫یک‬‫شکل‬‫گرافیکی‬‫بنام‬‫بالک‬‫آیکون‬‫در‬‫سیستم‬‫مانیتورین‬‫گ‬(OCM) ‫هستند‬. ‫‌های‬‫ک‬‫بال‬‫پایه‬‫در‬‫هر‬OB‫قابل‬‫فراخوانی‬‫هستند‬.‫ولی‬‫‌های‬‫ک‬‫بال‬‫‌های‬‫ه‬‫کتابخان‬‫فقط‬‫در‬OB‫های‬‫خاص‬‫و‬ ‫مشخص‬‫شده‬‫فراخوانی‬‫‌شوند‬‫ی‬‫م‬. ‫با‬‫هر‬‫بار‬‫فراخوانی‬‫‌های‬‫ک‬‫بال‬‫‌های‬‫ه‬‫کتابخان‬‫از‬‫جنس‬FB،‫یک‬DB‫جدیدی‬‫به‬‫آنها‬‫اختصاص‬‫داده‬‫‌شود‬‫ی‬‫م‬. ‫برای‬‫مشاهده‬‫اطالعات‬‫کامل‬‫در‬‫خصوص‬‫بالک‬‫مورد‬‫نظر،کلید‬F1‫را‬‫بر‬‫روی‬‫بالک‬‫کلیک‬‫نمایید‬.
  • 8. ‫مدرس‬:‫اکبری‬ ‫صادق‬ Tel. 09123182734 SIMATIC PCS7 Training CFC Language ‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬ ‫نیرو‬ ‫آب‬-‫پاییز‬96 Blocks Betweentheoperatingsystemandtheuser programsthere are theso-calledOrganization Blocks (OBs). “Block” is an importantconceptin PCS 7.Asummaryof theblocks used in thesystemis listed in Table above When ablock is created,it mustbe "declared"as a function block (FB), a function call (FC), ora basic operation,(BOP). A FB is a block with memory; in other words the data exist during processing from one cycle to another and can be accessed.Tomakethe dataaccessible, a datablock(DB) is created for eachblockinstance. In amulti-instance block,the calling FB contains subsidiary FBs butonly onecommonDB is created. A FC is a block without memory; in other words the values generated by the block are processed immediately. No data blockis required for aFC. A FC does nothavedefault values at theoutputs. A BOPis also a blockwithout memory.Theyare usedfor simple functions suchasAND,OR, etc. Basic operations are programcomponentsin CFC andare enteredas theSCL statementsduring compilation. BOPs are locatedin the CFC Chart folder. Refer toPicture whereBOPs are indicated bythebookicons.
  • 9. ‫مدرس‬:‫اکبری‬ ‫صادق‬ Tel. 09123182734 SIMATIC PCS7 Training CFC Language ‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬ ‫نیرو‬ ‫آب‬-‫پاییز‬96 Integrating Libraries ‫تلفیق‬‫کتابخانه‬‫های‬‫از‬‫‌ساخته‬‫ش‬‫پی‬‫در‬‫برنامه‬‫کاربر‬-‫موقع‬‫نصب‬‫سیستم‬‫مهندسی‬(PCS7-ES)‫کتابخانه‬‫های‬PCS7‫که‬‫حاوی‬‫بالک‬‫ها‬ ‫و‬‫چارت‬‫های‬‫از‬‫پیش‬‫ساخته‬،‫هستند‬‫به‬‫صورت‬‫اتوماتیک‬‫نصب‬‫می‬‫گردند‬. ‫بالک‬‫های‬‫مورد‬‫نیاز‬‫برای‬‫ایجاد‬‫برنامه‬‫کاربر‬‫بایستی‬‫در‬‫پروژه‬‫تلفیق‬(integrated)‫شوند‬. ‫برنامه‬‫کاربر‬‫به‬‫کمک‬‫ویرایشگر‬‫چارت‬‫های‬CFC‫و‬SFC‫ایجاد‬‫می‬‫گردد‬.‫بالک‬‫های‬‫ارایه‬‫شده‬‫در‬‫محیط‬CFCً‫ا‬‫اساس‬‫از‬‫کتابخانه‬‫های‬ ‫واقع‬‫در‬S7Manager‫در‬‫آدرس‬File -> Open -> Libraries‫نشات‬‫‌گیرند‬‫ی‬‫م‬. ‫برای‬‫مشاهده‬‫کتابخانه‬‫ها‬‫می‬‫توان‬‫به‬‫مسیر‬File -> Open -> Libraries‫مراجعه‬‫کرد‬. ‫برای‬‫نمایش‬‫و‬‫مخفی‬‫کردن‬‫این‬‫کتابخانه‬‫ها‬‫نیز‬‫می‬‫توان‬‫از‬‫فرمان‬File -> Manage-> Hide / Display‫استفاده‬‫کرد‬. Master Data Library : MDL ‫کتابخانه‬‫خاص‬‫پروژه‬‫‌باشد‬‫ی‬‫م‬.‫از‬‫نسحه‬PCS7 V7.0‫به‬‫باال‬‫عالوه‬‫بر‬‫پروژه‬‫ها‬‫می‬‫توان‬‫کتابخانه‬‫ها‬‫را‬‫نیز‬‫در‬‫یک‬Multiproject‫قرار‬ ‫داد‬. ‫می‬‫توان‬‫یکی‬‫از‬‫این‬‫کتابخانه‬‫ها‬‫را‬‫به‬‫عنوان‬‫کتابخانه‬‫خاص‬‫‌های‬‫ه‬‫داد‬‫پروژه‬‫برای‬‫ذخیره‬‫سازی‬‫بالک‬‫ها‬‫و‬‫چارت‬‫ها‬‫استف‬‫اده‬‫کرد‬.‫تا‬ ‫در‬‫تمام‬‫پروژه‬‫ها‬‫به‬‫صورت‬‫یک‬‫شکل‬‫از‬‫بالک‬‫ها‬‫و‬‫چارت‬‫ها‬‫استفاده‬‫کرد‬. ‫کتابخانه‬MDL‫تنها‬‫می‬‫تواند‬‫حاوی‬‫یک‬‫پوشه‬S7 Program‫باشد‬. ‫برای‬‫تعریف‬‫یک‬‫کتابخانه‬‫درج‬‫شده‬‫در‬‫یک‬Multiproject،‫به‬‫عنوان‬‫کتابخانه‬MD،‫در‬‫محیط‬Component View‫کتابخانه‬‫را‬‫انتخاب‬ ‫کرده‬‫و‬‫از‬‫فرمان‬‫زیر‬‫استفاده‬‫کنید‬. File  Multiproject  Defineas Master Data Library
  • 10. ‫مدرس‬:‫اکبری‬ ‫صادق‬ Tel. 09123182734 SIMATIC PCS7 Training CFC Language ‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬ ‫نیرو‬ ‫آب‬-‫پاییز‬96 Master data Library It is recommendedthatthe blocksused in a project(user-definedor the system libraries) arecollected into the projectmaster library. Block types used in a particular project,no matter they are PCS 7 library blocks or created by user, they have to be available in the master data library. After you are sure that all blocks required are in the master data library or located in a project library, it is recommended to hide all other libraries including the PCS 7 standard libraries as they havebeenadapted into the project library. To hide a library, use the Managefunction of the SIMATIC Manager,the menu path, File > Manage.SeePicture. From time to time, you have to be sure that blocks used in a project are in the master data library. It is particularly important that there is no conflict in block numbersand symbolic nameswithin the masterdata library.
  • 11. ‫مدرس‬:‫اکبری‬ ‫صادق‬ Tel. 09123182734 SIMATIC PCS7 Training CFC Language ‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬ ‫نیرو‬ ‫آب‬-‫پاییز‬96 ‫‌های‬‫ک‬‫بال‬‫پایه‬(Elementary Blocks) ‫حاوی‬‫بالک‬‫هایی‬‫برای‬‫انجام‬‫عملیات‬‫پایه‬Step7(BOP)‫در‬‫‌های‬‫ت‬‫چار‬CFC‫می‬‫باشد‬.‫این‬‫بالک‬‫های‬‫پایه‬‫مانند‬CMP_R‫و‬SQRT‫در‬‫کتابخانه‬ CFC‫قرار‬‫دارند‬‫و‬‫به‬‫همراه‬‫ویرایشگر‬CFC‫نصب‬‫می‬‫شوند‬. ‫بالک‬‫های‬‫تکنولوژیکی‬(Technological Blocks) ‫دسته‬‫بالک‬‫های‬‫زیر‬‫توابع‬‫پایه‬‫برای‬‫انجام‬‫تسک‬‫های‬‫اتوماسیون‬‫را‬‫فراهم‬‫می‬‫کند‬: ‫فانکشن‬‫بالک‬‫ها‬(Functionblocks)‫مانند‬AVER_P،INT_P،LIMITS_P ‫بالک‬‫های‬‫کنترل‬‫اپراتوری‬(Operatorcontrolblocks)‫مانند‬OP_A_LIM،OPD‫به‬‫همراه‬Faceplate‫های‬‫مربوطه‬ ‫بالک‬‫های‬‫پیام‬(Message)‫مانند‬MESSAGE, MSG_CSF ‫دسته‬‫بالک‬‫های‬‫زیر‬‫به‬‫همراه‬‫صفحات‬Faceplate‫مربوطه‬‫برای‬‫مانیتورینگ‬‫و‬‫بهره‬‫برداری‬‫در‬OS،‫تسک‬‫های‬‫پیچیده‬‫را‬‫پردازش‬‫می‬‫کنند‬.  Controller block CTRL_PID,CTRL_S  MotorblocksMOTOR,MOT_REV,MOT_SPED  Valve blocksVALVE, VAL_MOT  Interlock display INTERLOCK  DosageDOSE  Ratio controller RATIO_P  MonitoringblocksMEAS_MON,DIG_MON  MaintenanceblocksELAP_CNT,SWIT_CNT,OB1_TIME ‫‌های‬‫ک‬‫بال‬‫درایور‬‫کانال‬(Driver Blocks) ‫‌های‬‫ک‬‫بال‬‫درایو‬‫‌هایی‬‫ط‬‫واس‬‫به‬‫‌های‬‫ل‬‫ماژو‬I/O‫فراهم‬‫‌کنند‬‫ی‬‫م‬.  CH_AI,CH_AO,CH_DI, CH_DOfor theindividual channel –‌‫ر‬‫ایو‬‫ر‬‫د‬‫‌های‬‫ل‬‫کانا‬‫دیجیتال‬‫و‬‫آنالوگ‬‫در‬‫‌ها‬‫ت‬‫کار‬‫‌بشند‬‫ی‬‫م‬.  MODxx,RACK,SUBNET,OB_xx,CPU_RTfor module,chainand CPUdiagnostics –‫بالک‬‫های‬MODxx‫ای‬‫ر‬‫ب‬‌‫ر‬‫ایو‬‫ر‬‫د‬‫کارت‬‫‌ها‬‫ل‬‫ماژو‬‫و‬‫تشخیص‬‫و‬‫عیب‬‫یابی‬CPU‫هستند‬.  PA_xx,PO_xxPROFIBUSPA drivers –‫بالک‬‫های‬PA_xx‫ای‬‫ر‬‫ب‬‫ایورهای‬‫ر‬‫د‬‫کانال‬‫پروفی‬‫باس‬PA‫هستند‬.
  • 12. ‫مدرس‬:‫اکبری‬ ‫صادق‬ Tel. 09123182734 SIMATIC PCS7 Training CFC Language ‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬ ‫نیرو‬ ‫آب‬-‫پاییز‬96 ‫‌های‬‫ک‬‫بال‬‫تبادل‬‫داده‬‫بین‬‫دو‬‫سیستم‬(Communication Blocks) ‫بالک‬‫های‬‫ارتباط‬‫شبکه‬‫در‬‫کتابخانه‬PCS7 Library V6.1‫قرار‬‫دارند‬‫این‬‫بالک‬‫ها‬‫عبارتند‬‫از‬SEND_B0‫و‬REC_B0‫برای‬128‫مقدار‬ ‫باینری‬‫و‬SEN_R‫و‬REC_R‫برای‬‫انتقال‬32‫مقدار‬Boolean‫و‬32‫مقدار‬Real ‫هر‬‫دوی‬‫این‬‫جفت‬‫بالک‬‫ها‬‫برای‬‫تبادل‬‫داده‬‫و‬‫ارتباطات‬‫از‬‫طریق‬SystemBus‫مناسب‬‫هستند‬. ‫کتابخانه‬‫استاندارد‬Standard Library) ‫کتابخانه‬‫استاندارد‬‫از‬‫نسخه‬5‫بسته‬‫نرم‬‫افزار‬Step7‫به‬‫بعد‬‫بازسازی‬‫شده‬‫است‬‫و‬‫حاوی‬‫مجموعه‬‫‌های‬‫ک‬‫بال‬‫زیر‬‫می‬‫باشد‬. ‫فانکشن‬‫های‬‫سیستمی‬(System Functions):‫شامل‬‫فانکشن‬‫های‬‫سیستمی‬(SFC)‫و‬‫فانکشن‬‫‌های‬‫ک‬‫بال‬ ‫سیستمی‬(SFB)‫‌باشند‬‫ی‬‫م‬.‫‌طوری‬‫ه‬‫ب‬‫که‬‫در‬‫سیستم‬‫مهندسی‬AS‫یکپارچه‬‫شده‬‫و‬‫بلوک‬‫های‬‫کاربر‬‫قادر‬‫به‬ ‫فراخوانی‬‫آنها‬‫می‬‫باشند‬. ‫‌های‬‫ک‬‫بال‬S5-S7 Convert:‫بالک‬‫هایی‬‫برای‬‫تبدیل‬‫برنامه‬‫های‬Step5‫به‬Step7‫هستند‬. ‫دسته‬‫‌های‬‫ک‬‫بال‬IEC Functions:‫شامل‬‫بالک‬‫هایی‬‫مانند‬‫انجام‬‫عملیات‬‫رشته‬‫ای‬(I-STRING)‫و‬‫مقایسه‬(MAX) ‫‌باشند‬‫ی‬‫م‬. ‫دسته‬Communication Blocks:‫بالک‬‫های‬‫برای‬‫تبادل‬‫داده‬‫روی‬‫شبکه‬‫‌باشند‬‫ی‬‫م‬.‫که‬‫شامل‬‫توابع‬(FC)‫برای‬ ‫ارتباطات‬Prsfibus DP‫می‬‫باشد‬ ‫گروه‬PID Control:‫شامل‬‫‌بالک‬‫ن‬‫فانکش‬‫هایی‬(FB)‫برای‬‫کنترل‬PID‫هستند‬. ‫دسته‬TI-S7Convert:‫شامل‬‫بالک‬‫های‬‫برای‬‫تبدیل‬‫برنامه‬‫های‬TI‫به‬S7‫می‬‫باشند‬. ‫نکته‬ ‫کتابخانه‬REDUNDUNT_IO (V1)‫تا‬‫نسخه‬6.1‫‌افزار‬‫م‬‫نر‬PCS7‫و‬‫کتابخانه‬REDUNDANT IO CGP‫در‬ ‫نسخه‬7.0‫و‬‫باالتر‬‫برای‬‫‌های‬‫م‬‫سیست‬H‫‌پذیر‬‫ل‬‫تحم‬‫خطا‬‫به‬‫همراه‬I/O‫افزونه‬‫موجود‬‫‌باشد‬‫ی‬‫م‬.
  • 13. ‫مدرس‬:‫اکبری‬ ‫صادق‬ Tel. 09123182734 SIMATIC PCS7 Training CFC Language ‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬ ‫نیرو‬ ‫آب‬-‫پاییز‬96 When youplacea blockon a CFC chart, youplaceonly its instanceon the chart. Instancemeansa usageof a blocktype. When draggingthe Valve block,FB73, from the PCS 7 library anddroppingit on to a CFC, aninstance ofFB73 is placedonthe chart. The blocktype is left in the Blocksfolder (Prog1)andin the CFC Chart folder.See Picture Above. Further Instanceblocks canbe draggedfroma type in the CFC Chart folder ratherthan fromlibraries or from the Blocksfolder. The formeris faster as nochecksfor discrepancybetweena blocktype in the CFC Chartfolder andBlocks folderare performed. Note  In areal project, themasterdatalibrary is usedthroughoutaproject engineeringcycle. Block typesare createdin or copied intothe masterdatalibrary. Themasterdatalibrary is theonlysourcefor a particular project.  Youcancreate anynumberofblock instancesfrom a blocktype.Youcan assignnamestotheseblockinstances, interconnectthem,andassignparameterstothem withoutchangingthefunctionality ofthe type.
  • 14. ‫مدرس‬:‫اکبری‬ ‫صادق‬ Tel. 09123182734 SIMATIC PCS7 Training CFC Language ‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬ ‫نیرو‬ ‫آب‬-‫پاییز‬96 Block typesare ready-madeprogramsections that canbe insertedin a CFC chart. When ablock typeis inserted, a blockinstanceis created.You cancreateany numberof blockinstancesfroma block type. For the SIMATIC S7 CPUs, the blocktypes arecreated,edited, andcompiledin the LadderLogic editor (LAD), Statement List (STL) editor or StructuredControl Language(SCL) editor. For PCS 7 projects, functionblocksare createdin the SCL or by compilingcharts as blocks. Block typesof a project arelocatedin theBlocks folderas shown in Picture. Blocks folderalso containsother blocks,e.g. systemfunction blocks(SFB), datablocks (DB), andorganization‫ی‬ blocks(OB) The blocktypes of Blocksfolder arealso shown in the CFC library catalogueso that theycan beaccessedin theCFC editor. In Picture Above,block typeof the S7 program,Prog1,are shown. Block typesare obtainedfromthreesources, whichare fromthe systemlibraries, fromuser-designedlibraries, or createdin theproject. The threesourcesof block typesare shownin Picture. Block typesare also storedin theCFC Chart folder.The CFC Chartfolder containsblocksindicated bythe blue boxesas shownin Picture.
  • 15. ‫مدرس‬:‫اکبری‬ ‫صادق‬ Tel. 09123182734 SIMATIC PCS7 Training CFC Language ‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬ ‫نیرو‬ ‫آب‬-‫پاییز‬96 Block typesare identified bytheir numbersandsymbolicnameswhile symbolic namesare optional. When thesystem blocksare used,their symbolicnamesareautomaticallyenteredin the Symbols table. The nameof theblock is usuallyenteredin the Symbols table or Symbolseditor. In Picture, a blocktype, FB73, has asymbolic name VALVE, which is definedin the Symbolstable . Block types  Theblocktypedeterminesthecharacteristics (algorithm) for all implementationsof this type.  A blocktyperepresents atemplatefor anynumberof instancesanddescribes howtheseinstancesare structuredinternally.  All instancesof a blocktypeobeythesamebasic definition as regardstheir characteristics andtheir data structure. Block Instances  A blockinstanceis aconcreteobject generatedaccordingtoits type(blocks) description.  Thetypedescribesthe characteristics andinformation structurefor theinstance while thecurrent stateof eachinstance dependsonits actually executedoperationsandis reflected in theinformation contents.  Eachinstancehas auniqueidentifier thatenablesinstances tobedistinguishedfrom oneanother.
  • 16. ‫مدرس‬:‫اکبری‬ ‫صادق‬ Tel. 09123182734 SIMATIC PCS7 Training CFC Language ‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬ ‫نیرو‬ ‫آب‬-‫پاییز‬96 ‫تلفیق‬‫بالک‬‫ها‬‫در‬‫برنامه‬(Integrating Blocks) ‫وقتی‬‫چارت‬CFC‫باز‬‫می‬‫شود‬.‫پنجره‬Catalog‫را‬‫در‬‫صورتیکه‬‫فعال‬‫نباشد‬.‫از‬‫مسیر‬‫زیر‬‫فعال‬‫کنید‬. – View  Catalog ‫برای‬‫استفاده‬‫از‬‫یک‬‫بالک‬‫در‬،‫برنامه‬‫بالک‬‫مورد‬‫نظر‬‫را‬‫در‬‫بین‬‫کتابخانه‬‫های‬‫موجود‬‫جستجو‬‫و‬‫از‬‫تکنیک‬Drag‫روی‬‫بالک‬‫و‬ Drop‫بالک‬‫بر‬‫روی‬‫چارت‬‫استفاده‬‫کرده‬‫و‬‫بالک‬‫را‬‫روی‬‫چارت‬‫قرار‬‫دهید‬. ‫وقتی‬‫یک‬‫تایپ‬‫بالک‬(Block Type)‫را‬‫برای‬‫اولین‬‫بار‬‫در‬‫چارت‬‫قرار‬‫می‬‫دهید‬.‫‌های‬‫ه‬‫داد‬‫این‬‫بالک‬‫در‬‫پوشه‬Blocks،‫پوشه‬Chart‫و‬ ‫جدول‬‫‌ها‬‫ل‬‫سیمب‬‫وارد‬‫‌شود‬‫ی‬‫م‬.‫درج‬‫‌ها‬‫ه‬‫داد‬‫در‬‫این‬‫‌ها‬‫ه‬‫پوش‬‫به‬‫صورت‬‫مخفی‬‫صورت‬‫‌گیرد‬‫ی‬‫م‬ (Import). ‫بالک‬‫قرار‬‫داده‬‫شده‬،‫درچارت‬‫به‬‫منظور‬‫فراخوانی‬‫و‬‫اجرا‬‫توسط‬CPU،‫در‬‫داخل‬‫یک‬OB‫ادغام‬‫می‬‫شود‬.‫به‬‫این‬‫معنی‬‫که‬‫این‬ ‫بالک‬‫در‬‫زمان‬‫اجرا‬‫در‬‫آن‬OB‫فراخوانی‬‫می‬‫شود‬. ‫از‬‫قبل‬‫در‬‫زمان‬‫طراحی‬،‫کتابخانه‬‫هر‬‫یک‬‫از‬‫بالک‬‫های‬‫کتابخانه‬‫های‬PCS7‫برای‬‫نصب‬‫در‬‫یک‬OB،‫خاص‬‫تنظیم‬‫شده‬‫است‬.‫به‬ ‫این‬‫معنی‬‫که‬‫برای‬‫هر‬،‫بالک‬‫یک‬OB‫تنظیم‬‫شده‬‫است‬.‫که‬‫موقع‬‫قرار‬‫دادن‬‫در‬،‫چارت‬‫در‬‫ابتدا‬‫در‬ ‫داخل‬‫همان‬OB،‫ادغام‬‫می‬‫شود‬.‫به‬‫طوریکه‬‫از‬‫پنجره‬Run Sequence‫‌توان‬‫ی‬‫م‬OB‫پیش‬‫تنظیم‬‫را‬‫عوض‬ ‫کرد‬.
  • 17. ‫مدرس‬:‫اکبری‬ ‫صادق‬ Tel. 09123182734 SIMATIC PCS7 Training CFC Language ‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬ ‫نیرو‬ ‫آب‬-‫پاییز‬96 Blocks ‫یک‬‫اصل‬‫پایه‬‫در‬‫مهندسی‬‫‌گوید‬‫ی‬‫م‬‫که‬‫چرخ‬‫را‬‫نباید‬‫دوباره‬‫اختراع‬‫کرد‬.‫کتابخانه‬‫های‬‫‌های‬‫ک‬‫بال‬‫از‬‫‌ساخته‬‫ش‬‫پی‬‫حاوی‬‫راه‬‫حل‬‫هایی‬‫هستند‬‫ک‬‫ه‬‫می‬‫توان‬ ‫استفاده‬‫مجدد‬‫کرد‬.‫مستندات‬‫بالک‬(‫که‬‫به‬‫صورت‬‫آنالین‬‫با‬‫فشردن‬‫کلید‬F1‫روی‬‫بالک‬‫باز‬‫می‬‫شود‬)‫داده‬‫هایی‬‫که‬‫در‬ ‫بخش‬‫ورودی‬‫بالک‬‫به‬‫منظور‬‫حصول‬‫نتایج‬‫در‬‫بخش‬‫خروجی‬،‫بالک‬‫بایستی‬‫فراهم‬‫شوند‬‫را‬‫توصیف‬‫می‬‫کن‬‫ند‬. Charts (Templates) ‫‌های‬‫ل‬‫‌ح‬‫ه‬‫را‬‫کنترلی‬‫از‬‫پیبش‬‫تعریف‬‫شده‬‫هستند‬‫که‬‫تنها‬‫الزم‬‫است‬‫با‬‫مشخصات‬‫فرآیند‬‫تطبیق‬‫داده‬‫شوند‬. ‫به‬‫این‬‫معنی‬‫که‬‫برای‬‫اجزای‬‫فرآیند‬‫مانند‬‫موتور‬‫یک‬‫چارت‬‫کنترل‬‫به‬‫صورت‬general‫ایجادشده‬‫که‬‫فقط‬‫بایستی‬‫پارامترهای‬ ‫‌ها‬‫ک‬‫بال‬‫را‬‫با‬‫‌های‬‫ر‬‫پارامت‬‫فرآیند‬‫تطبیق‬‫داد‬. Import ‫عمل‬Import:‫از‬‫‌جایی‬‫ن‬‫آ‬‫که‬‫‌های‬‫ک‬‫بال‬‫موجود‬‫در‬‫‌ها‬‫ه‬‫کتابخان‬‫به‬‫صورت‬Type،‫هستند‬‫قبل‬‫از‬‫استفاده‬‫از‬‫آنها‬‫بایستی‬‫به‬‫پوشه‬Blocks،Import‫شده‬‫و‬‫سپس‬ ‫برای‬‫‌سازی‬‫ه‬‫پیاد‬‫برنامه‬‫در‬‫‌های‬‫ت‬‫چار‬CFC،‫ورودی‬‫و‬‫‌های‬‫ی‬‫خروج‬‫آنها‬‫به‬‫‌های‬‫ک‬‫بال‬‫دیگر‬‫متصل‬‫شوند‬. Inserting in Chart ‫قرار‬‫دادن‬‫در‬‫چارت‬(Inserting In Chart‌)‫‌ها‬‫ک‬‫بال‬‫را‬‫‌توان‬‫ی‬‫م‬‫از‬‫طریق‬Drag & Drop،‫در‬‫چارت‬‫قرار‬‫داد‬.‫برای‬‫این‬‫کار‬‫بالک‬‫را‬‫در‬‫لیست‬‫‌های‬‫ک‬‫بال‬‫کتابخانه‬ ‫مربوطه‬،‫انتخاب‬‫و‬‫آن‬‫را‬‫در‬‫پنجره‬‫کدنویسی‬‫چارت‬‫قرار‬‫‌دهیم‬‫ی‬‫م‬(‫در‬‫یکی‬‫از‬‫شیت‬1‫تا‬6) Block Header ‫هدر‬‫بالک‬‫حاوی‬‫اطالعاتی‬‫است‬‫که‬‫‌توان‬‫ی‬‫م‬‫بالک‬‫را‬‫شناخت‬. Set Parameters ‫برای‬‫تغییر‬‫‌های‬‫ر‬‫پارامت‬،‫بالک‬‫بالک‬‫را‬‫انتخاب‬‫و‬‫با‬‫دابل‬‫کلیک‬‫یا‬‫راست‬،‫کلیک‬‫پنجره‬Object Properties‫را‬‫باز‬‫‌کنیم‬‫ی‬‫م‬ Connect ‫اگر‬‫قرار‬‫است‬‫نتایج‬‫حاصل‬‫از‬‫یک‬‫بالک‬‫توسط‬‫بالک‬‫دیگر‬‫پردازش‬‫بیشتری‬‫شود‬.‫خروجی‬‫این‬‫بالک‬‫به‬‫ورودی‬‫بالکی‬‫که‬‫این‬‫مقدار‬‫ر‬‫ا‬‫پردازش‬‫می‬‫کند‬ ‫متصل‬‫می‬‫گردد‬(‫برای‬‫این‬‫کار‬‫ابتدا‬‫در‬‫خروجی‬‫بالک‬‫کلیک‬‫و‬‫سپس‬‫در‬‫ورودی‬‫بالک‬‫دوم‬‫کلیک‬‫نمایید‬‫و‬‫یا‬‫ب‬‫ه‬‫روش‬ Drag& Drop‫این‬‫کار‬‫را‬‫انجام‬‫دهید‬‫یعنی‬‫پایه‬‫خروجی‬‫بالک‬‫را‬‫انتخاب‬(Drag)‫و‬‫بر‬‫روی‬‫ورودی‬‫بالک‬Drop‫کنید‬. SheetBars ‫همچنین‬‫می‬‫توان‬‫بین‬‫بالک‬‫هایی‬‫که‬‫در‬‫یک‬Sheet‫قرار‬،‫ندارند‬‫از‬‫طریق‬‫باز‬‫کردن‬‫یک‬‫پنجره‬‫جدید‬‫در‬CFC‫اتصاالت‬‫برقرار‬‫کرد‬.‫به‬‫طوری‬‫که‬‫دو‬‫تا‬‫شیت‬ ‫در‬‫دو‬‫پنجره‬‫مختلف‬‫نمایش‬‫داده‬‫می‬‫شوند‬‫و‬‫اتصاالت‬‫بین‬‫‌های‬‫ه‬‫پای‬‫بالک‬‫به‬‫همان‬‫صورت‬‫معمول‬‫صورت‬‫می‬‫گیر‬‫د‬.
  • 18. ‫مدرس‬:‫اکبری‬ ‫صادق‬ Tel. 09123182734 SIMATIC PCS7 Training CFC Language ‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬ ‫نیرو‬ ‫آب‬-‫پاییز‬96 ‫با‬‫قرار‬‫دادن‬‫بالک‬‫در‬‫محیط‬CFC‫یک‬‫شماره‬‫برای‬‫نام‬‫آن‬‫تخصیص‬‫داده‬‫‌شود‬‫ی‬‫م‬.‫که‬‫در‬‫گوشه‬‫سمت‬‫چپ‬‫بالک‬‫قرار‬‫‌گیر‬‫ی‬‫م‬‫د‬. ‫با‬‫دابل‬‫کلیک‬‫بر‬‫روی‬‫بالک‬‫پنجره‬Properties‫آن‬‫نمایان‬‫‌شود‬‫ی‬‫م‬‫که‬‫بهتر‬‫است‬‫یک‬‫اسم‬‫با‬‫معنی‬‫مرتبط‬‫با‬‫فرآیند‬‫برای‬‫بال‬‫ک‬‫در‬ ‫قسمت‬Name‫وارد‬‫شود‬. CFC Objects :The most important CFC terms areoutlined here. In CFC, the identifier for a blockinstanceis madeupof :  thechart name,whichis uniquein theCPU,  theseparator‘.’,  andtheblockname,whichis uniquewithin thechart (maximumof 24characters for theblock name). Blocks :  In theSTEP7languageusage,blocksare separateparts oftheuser program definedbytheir function,their structure,or their application purpose.  Thereare logic blocks(FB, FC,...), datablocks,anduser-defined datatypes.  Basic instructions:Functionssuchas AND,SUM,etc.containedin theS7 machinemodel  Globaladdresses:I/O signals, bit memories,counters,timers, andglobaldatablocks
  • 19. ‫مدرس‬:‫اکبری‬ ‫صادق‬ Tel. 09123182734 SIMATIC PCS7 Training CFC Language ‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬ ‫نیرو‬ ‫آب‬-‫پاییز‬96 Block IO  Eachblockhasa numberof different I/Os thatare displayed in a tableof theproperties dialog.  Tofind theI/Os quicklyin this dialog, youcanclick in thecolumnheadof thetable andsortthecolumnin ascendingor descendingorder.  TheI/Os ofa blockcan bebothvisible or invisible: Youcanonlysee visible parametersin thepropertiesof theblockbut notin therepresentationin theCFC chart.  Youcanspecify whichI/Os in theCFC chartwill bevisible andwhich will beinvisible. Youspecify this in theproperties of theblockin the“Invisible“ columnbyuncheckingthe checkboxofthe relevantI/O tomaketheI/O visible in theCFC chart.This functionhelpsto makea CFC chart easier toread.
  • 20. ‫مدرس‬:‫اکبری‬ ‫صادق‬ Tel. 09123182734 SIMATIC PCS7 Training CFC Language ‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬ ‫نیرو‬ ‫آب‬-‫پاییز‬96
  • 21. ‫مدرس‬:‫اکبری‬ ‫صادق‬ Tel. 09123182734 SIMATIC PCS7 Training CFC Language ‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬ ‫نیرو‬ ‫آب‬-‫پاییز‬96 makethe requiredinterconnectionsin the chartsbetweenoutputs andinputs. You cancreatethe interconnectionsof blocksconvenientlyby :  clicking onthegraphicuser interface oftheCFC editorwith themouse.  Click first theoutputof ablock andthentheinputyouwantto connecttoit. After clicking ontheinput,theinterconnection is displayedas aline.  TheCFC Editor automatically drawslines in thebestposition.  Thepositionof thelines hasnoeffect onthefunctionof theinterconnection. Note  If youmakeanincorrect interconnection:  Right-click ontheline of theincorrectly interconnectionandselect themenucommandEdit > Delete.
  • 22. ‫مدرس‬:‫اکبری‬ ‫صادق‬ Tel. 09123182734 SIMATIC PCS7 Training CFC Language ‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬ ‫نیرو‬ ‫آب‬-‫پاییز‬96 Textual interconnection is a virtual connection arising when a partner chart is moved to another S7 program or when it is created deliberately. Textual interconnectionis indicated by a yellowtriangle as shown in Picture 2.25. ‫ایجاد‬‫اتصال‬‫متنی‬:‫دو‬‫روش‬‫وجود‬‫دارد‬. ‫روش‬‫اول‬:‫روی‬‫پایه‬‫ورودی‬‫یا‬‫خروجی‬‫بالک‬‫مورد‬‫نظر‬‫با‬‫ماوس‬‫کلیک‬‫کرده‬‫و‬‫سپس‬‫روی‬‫پایه‬‫ورودی‬‫یا‬ ‫خروجی‬‫بالک‬‫دیگر‬‫که‬‫در‬‫صفحه‬‫نمایش‬‫آورده‬‫شده‬‫با‬‫ماوس‬‫کلیک‬‫‌کنیم‬‫ی‬‫م‬. –‫امکان‬‫اتصال‬‫ورودی‬‫به‬‫ورودی‬‫یا‬‫خروجی‬‫به‬‫خروجی‬‫وجود‬‫ندارد‬. ‫روش‬‫دوم‬:‫راست‬‫کلیک‬‫بر‬‫روی‬‫ورودی‬‫مورد‬‫نظر‬‫و‬‫انتخاب‬‫گزینه‬Textualinterconnection –‫پنجره‬‌‫ر‬‫مذکو‬‫فقط‬‫ای‬‫ر‬‫ب‬‫‌های‬‫ه‬‫پای‬‫ورودی‬‫بالک‬‫ظاهر‬‫‌شود‬‫ی‬‫م‬‫و‬‫آدرس‬‫پایه‬‫خروجی‬‫وارد‬‫‌شود‬‫ی‬‫م‬. –‫در‬‫صورت‬‫یکسان‬‫بودن‬‫سطح‬Hierarchy‫آدرس‬‫مبدا‬‫و‬،‫مقصد‬‌‫ی‬‫نیاز‬‫به‬‫ذکر‬‫نام‬‫سطح‬‫نیست‬‫و‬‌‫ر‬‫دستو‬‫با‬ ‫عالمت‬‫شروع‬‫‌شود‬‫ی‬‫م‬. –‫نام‬‫بالک‬‫در‬‫یک‬CFC‫که‬‫شامل‬‫چندین‬‫شیت‬‫می‬،‫باشد‬‫بفرد‬‫ر‬‫منحص‬‫است‬. –‫پرچم‬‫نگ‬‫ر‬‫زرد‬‫نشان‬‫دهنده‬‫اشکال‬‫در‬‫‌دهی‬‫س‬‫آدر‬‫یا‬‫عدم‬‫شناسایی‬‫مقصد‬‫می‬‫باشد‬.
  • 23. ‫مدرس‬:‫اکبری‬ ‫صادق‬ Tel. 09123182734 SIMATIC PCS7 Training CFC Language ‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬ ‫نیرو‬ ‫آب‬-‫پاییز‬96 If the connectedpartneris movedbackor a purposely-createdtextualinterconnectionis fulfilled, the textual interconnection will beclosed by using the Close or“MakeTextual Interconnection”functionandthe yellow triangle disappeared.See Picture The “MakeTextual Interconnections”functioncanalso be performedwhencompilingprogram. Note: Copyingor movingchartsin the Plant view within a CPU will retainall the interconnectionsbetweenchartswhile adaptthe interconnections automaticallyto new paths. When copyingor movinga plant hierarchicalfolder containingchart(s)and picture(s),interconnectionsbetweenthe charts andbetween blocksand their graphicobjects(icons) areretainedand adapted. Therefore,textual interconnectionswill not occurin the two casesabove.
  • 24. ‫مدرس‬:‫اکبری‬ ‫صادق‬ Tel. 09123182734 SIMATIC PCS7 Training CFC Language ‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬ ‫نیرو‬ ‫آب‬-‫پاییز‬96 Exercise ‫تمرین‬:‫در‬Plant View‫یک‬‫چارت‬‫بنام‬test‫ایجاد‬‫و‬‫در‬‫داخل‬‫آن‬‫بالک‬‫های‬‫باال‬‫را‬‫درج‬‫کنید‬.‫برای‬ ‫این‬‫کار‬‫پوشه‬Reactorsi/Testi‫را‬‫به‬‫عنوان‬‫سطوح‬‫فرآیندی‬‫ایجاد‬‫کنید‬.‫هر‬‫دو‬‫بالک‬‫در‬OB32‫اجرا‬‫می‬- ‫شود‬.‫اولین‬‫بالک‬‫تایپ‬PT1_P‫و‬‫دومین‬‫بالک‬‫یک‬‫جمع‬‫کننده‬‫چهارتایی‬ADD4_P‫‌باشد‬‫ی‬‫م‬. ------------------------------------------------------------------------------------------------ Steps 1. Call the projectin plant view. Createfolder. 2. Insert new CFC chart in the correspondinghierarchycontainer. 3. Define predecessorfor installation. 4. Enter blocksfromthe library into thechart andnamethem. 5. Set parametersfor blockson the sheetand interconnectthem. 6. Compile, downloadandtest program. ------------------------------------------------------------------------------------------------ Procedure In the blocknames,"i" stands for yourgroupnumber. Add PH 1.Select the plant hierarchyview in the SIMATIC Managervia menucommand View  Plant View Select the "REACTORSi" folder in the project PRO_ASi. Then right-click andselect New Object...  HierarchyFolder to insert a newfolder. Renamethe folder "TESTi" Createa chart 2.Select the "TESTi" folder, right-click andselect New Object...  CFC to insert a chart. Nameyourchart "ATTEMPTi" OpenChart Select the "ATTEMPTi" chart. To openthe chart, right-click andselect Open Object(or double-click)
  • 25. ‫مدرس‬:‫اکبری‬ ‫صادق‬ Tel. 09123182734 SIMATIC PCS7 Training CFC Language ‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬ ‫نیرو‬ ‫آب‬-‫پاییز‬96 Settings for compile 5. Charts must be convertedfromthe graphicformto machinelanguageanddownloadedto theAS. To initiate the conversionfrom a CFC chart, select Chart  Compile Charts asProgram (or click the circledC Compile icon). The entire softwareis compiledfor theCPU whichis associatedwith this CFC chart. A dialog boxis displayedfor the compilationsettings (see slide). Only"Entire Program"is possible under"Scope"thefirst timeyoucompile.Youcanselect "Changesonly" for anysubsequent compilations (after changes/additions). ImportantOption "Generatemoduledrivers" (only meaningfulif thereis a minimumof onechanneldriver in the chart). This results in the CFC creatingadditional chartswith the requireddriversfor data transferwith the I/O modules anddiagnostics capability. A chart "@CPU_RT" is createdin addition. The "CPU_RT" block insertedthere monitorsthe CPU performancein order to avoida CPU stop (fordetails onthe block functions,pleaserefer to its online help) Downloading: The compiledchartsmust now bedownloadedto theCPU. Activate the following menucommandto start this process: PLC  Download or click on theDownloadicon (circledon the slide). The first time the chart is downloaded,it is only possible to downloadthe entireprogram(in combinationwith CPU Stop andautomaticdeletion of the programstill residingin the CPU).
  • 26. ‫مدرس‬:‫اکبری‬ ‫صادق‬ Tel. 09123182734 SIMATIC PCS7 Training CFC Language ‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬ ‫نیرو‬ ‫آب‬-‫پاییز‬96 Testing in CFC To test yourprogram,follow the menupath: Debug> Test Mode.You canmonitor I/O valuesby addingthem into Watch List. Then,the valuesare highlightedin yellow. Right click on anI/O andthen “addI/O to Watch List. To changea value online, doubleclick an input, e.g. AUTO_OC. The I/O Propertiesdialog will openandyou canset a new valuefor the variable.See Picture. Note To operatethe valvein the CFC Test Mode youset andreset AUTO_OC. To be ableto operatethe valve,youneedto enablethe use of AUTO_OC by setting LIOP_SEL and AUT_L both to be “True”. The library functionVALVE is explainedin details in Next Chapter
  • 27. ‫مدرس‬:‫اکبری‬ ‫صادق‬ Tel. 09123182734 SIMATIC PCS7 Training CFC Language ‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬ ‫نیرو‬ ‫آب‬-‫پاییز‬96 Thereare two Test Modesnamely:  ProcessModeandLaboratoryMode.  Youcanchooseoneof thembefore testing.Toswitchbetweenthetwomodes,follow themenupath: – Debug> ProcessMode(or LaboratoryMode). In processmode,communicationfor the online dynamicupdateof blocksis restricted andthus causesmoderateload on the CP and bus. When thetest modeis activated,all blocksare assignedthe "watch off" attribute. The laboratorymodeallows convenientandefficient testing and commissioning.In contrast to processmode,the laboratorymodedoesnot restrict communicationfor online dynamicupdateof blocks. So, use the laboratorymodewith caution. When thetest modeis activated,all blocksare assignedthe "watch on" attribute.
  • 28. ‫مدرس‬:‫اکبری‬ ‫صادق‬ Tel. 09123182734 SIMATIC PCS7 Training CFC Language ‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬ ‫نیرو‬ ‫آب‬-‫پاییز‬96 ‫برای‬‫پیکربندی‬‫یک‬‫چارت‬CFC‫مراحل‬‫زیر‬‫صورت‬‫می‬‫گیرد‬: ‫ایجاد‬‫یک‬‫چارت‬CFC‫در‬‫یک‬‫سطح‬‫فرآیندی‬‫در‬‫محیط‬Plant View ‫باز‬‫کردن‬‫چارت‬CFC ‫کپی‬‫فانکشن‬‫‌های‬‫ک‬‫بال‬‫موردنظر‬‫به‬‫کتابخانه‬MDL‫پروژه‬(‫اختیاری‬) ‫درج‬‫یا‬‫قرار‬‫دادن‬‫فانکشن‬‫‌های‬‫ک‬‫بال‬‫موردنظر‬‫در‬‫محیط‬‫ویرایشگر‬CFC(Insert blocks) ‫تنظیم‬‫پارامترهای‬‫بالک‬ –‫تغيرنام‬‫پیش‬‫فرض‬‫به‬‫نام‬‫های‬‫مناسب‬ –‫تنظیم‬‫مقادیر‬‫ورودی‬/‫خروجی‬ ‫ترسیم‬‫اتصال‬‫بین‬‫‌های‬‫ک‬‫بال‬‫داخل‬‫‌های‬‫ت‬‫شی‬‫چارت‬‫و‬‫یا‬‫بین‬‫‌های‬‫ت‬‫چار‬CFC ‫دانلود‬‫برنامه‬‫کامپایل‬‫شده‬‫به‬CPU ‫تست‬‫و‬‫دیباگ‬‫نمودن‬‫برنامه‬‫دانلود‬‫شده‬ ‫نکته‬ ‫در‌صورت‌نیاز‌به‌به‌اطالعات‌بیشتر‌در‌مورد‌بالک‌ها،‌به‌عنوان‌مثال‌این‌که‌بالک‌تابع‌موردنظر‌چه‬ ‫ورودی‬/‌‫خروجی‌هایی‌دارد،‌بالک‌مربوطه‌در‌کتابخانه‌را‌انتخاب‌کنید‌و‌سپس‌کلید‬F1‫را‌فشار‌دهید‬‌.‌‫این‌کار‬ ‫راهنمای‌کاربری‌را‌برای‌این‌بالک‌باز‌خواهد‌کرد‬.
  • 29. ‫مدرس‬:‫اکبری‬ ‫صادق‬ Tel. 09123182734 SIMATIC PCS7 Training CFC Language ‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬ ‫نیرو‬ ‫آب‬-‫پاییز‬96 With Memory Reset Object‫ها‬‫و‬Tag‫ها‬‫دز‬WINCC‫پاک‬‫شده‬‫و‬‫از‬‫نو‬‫ساخته‬‫می‬‫شود‬. ‫با‬‫کامپایل‬OS‫دیتا‬‫از‬‫سیستم‬AS‫در‬ES‫به‬OS‫منتقل‬‫می‬‫گردد‬. ‫در‬‫صورت‬‫ظاهر‬‫شدن‬‫پیام‬‫خطا‬‫در‬‫شروع‬‫کامپایل‬‫به‬‫معنی‬‫کامپایل‬‫نشدن‬‫یک‬‫یا‬‫چند‬CFC‫می‬‫باشد‬.
  • 30. ‫مدرس‬:‫اکبری‬ ‫صادق‬ Tel. 09123182734 SIMATIC PCS7 Training CFC Language ‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬ ‫نیرو‬ ‫آب‬-‫پاییز‬96 With Memory Reset Object‫ها‬‫و‬Tag‫ها‬‫دز‬WINCC‫پاک‬‫شده‬‫و‬‫از‬‫نو‬‫ساخته‬‫می‬‫شود‬. ‫با‬‫کامپایل‬OS‫دیتا‬‫از‬‫سیستم‬AS‫در‬ES‫به‬OS‫منتقل‬‫می‬‫گردد‬. ‫در‬‫صورت‬‫ظاهر‬‫شدن‬‫پیام‬‫خطا‬‫در‬‫شروع‬‫کامپایل‬‫به‬‫معنی‬‫کامپایل‬‫نشدن‬‫یک‬‫یا‬‫چند‬CFC‫می‬‫باشد‬.
  • 31. ‫مدرس‬:‫اکبری‬ ‫صادق‬ Tel. 09123182734 SIMATIC PCS7 Training CFC Language ‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬ ‫نیرو‬ ‫آب‬-‫پاییز‬96 ‫در‬‫صورتی‬‫که‬‫تایپ‬‫فانکشن‬‫‌های‬‫ک‬‫‌بال‬‫استفاده‬‫شده‬‫در‬‫چارت‬‫تغییر‬،‫یابد‬‫‌توان‬‫ی‬‫م‬‫‌های‬‫ک‬‫بال‬‫استفاده‬‫شده‬‫را‬‫ب‬‫روزآوری‬‫کرده‬‫و‬ ‫با‬‫تایپ‬‫جدید‬‫جایگزین‬‫نمود‬. ‫این‬‫کار‬‫با‬import‫کردن‬‫تایپ‬‫جدید‬‫به‬‫پوشه‬CFC Chart‫انجام‬‫‌گیرد‬‫ی‬‫م‬. ‫بین‬‫‌های‬‫ک‬‫بال‬‫موجود‬‫در‬‫پوشه‬Blocks‫که‬‫تایپ‬‫جدید‬‫وجود‬‫دارد‬‫و‬‫پوشه‬Charts‫مقایسه‬‫صورت‬‫‌گیرد‬‫ی‬‫م‬. Central typechangesmeanthat all instancesof a block typealreadyincludedin CFC charts areautomaticallyupdatedif the blocktype is changed.For example,a userblock is modified later afterits instanceshavebeenused in CFC charts. You can updateall the instancesbyimporting the newtype to the CFC Chart Folder. The function, “Importingblock type”,canbe foundfollowing the menupath: Options > BlockTypes. See Picture Alternatively, you canusethe New Version functionto updateblocktypes usedin a project. SeePicture. The BlockTypes dialog is whereblock typesare comparedbetweenthe Blocks folderandthe CFC Chartfolder. Block typesin thesetwo folders haveto bethe same. The functionof the central typechangeis useful andpowerful.If the PCS 7 library blockshavebeenchangedbySiemens dueto a newer releaseof the system. Youhaveto decideif the newerversionof the blocks is to beusedin yourproject.
  • 32. ‫مدرس‬:‫اکبری‬ ‫صادق‬ Tel. 09123182734 SIMATIC PCS7 Training CFC Language ‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬ ‫نیرو‬ ‫آب‬-‫پاییز‬96 If block instancesaredeletedfrom a chartor deletedbecauseof deleting charts, their types will not be deletedeither fromthe CFC Chart folder orfrom the Blocksfolder thoughthe blocktypes arenot used in the project. Block typesthat are not usedin a projectcanbe removedfromthe project byusing the Clean up functionas shown in Picture Using the function, youwill be askedif block typeis to be removedfromthe CFC Chartfolder (Steps 2 and 3 in Picture) andBlocksfolder (Steps 3 and 4 in Picture 6.10)respectively. Note The library blocks,e.g. SFB36 as in Picture, could beremovedas they arecontainedin the firmwareof AS.
  • 33. ‫مدرس‬:‫اکبری‬ ‫صادق‬ Tel. 09123182734 SIMATIC PCS7 Training CFC Language ‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬ ‫نیرو‬ ‫آب‬-‫پاییز‬96 Locate Change To detect possible changes between e.g.  already instantiated blocks in the project and  the associated library substitute before any further use, you can compare blocks - as shown above: Right-click on selected blocks or blocks to be checked (here FBs from the library --> Compare blocks... --> Specify comparison path/objects (here select block container for the project). Result A: No deviations identified in compared objects Result B: List of objects with deviation + specific description Note This is only a "fast comparison" without additional options (where are any differences?). From the PCS 7 viewpoint, the VXM option (Version Cross Manager) offers more efficient information (also for non-programmers). This application will be discussed later. However, the VXM does not evaluate the consequences for the S7 program if the change were carried out. A further possibility is shown on the next pages. This indicates the consequences of a possible synchronization with the option for aborting the commenced synchronization if the change does not appear to be appropriate (e.g. downloading only possible with CPU stop).
  • 34. ‫مدرس‬:‫اکبری‬ ‫صادق‬ Tel. 09123182734 SIMATIC PCS7 Training CFC Language ‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬ ‫نیرو‬ ‫آب‬-‫پاییز‬96 Functions couldcall other functions. The calledfunctions aresub-functionsandareblock typesthem. For example,a closedloop controlblock calls a signaling blockanda controlling block. When copyinga multi-instanceblock to a project (to the Blocksfolder) all sub-blockshaveto be copiedinto the blockfolder as well. Note Called SFBs and SFCs, suchas SFC6 (RD_SINFO) or SFB0 (CTU) arelocated firstly in the PCS 7 libraries andcopiedinto your S7 program whenyou compilethe calling block. Called FBs are copiedto the blockfolder whenyouinsert thecalling block in a CFC chart if they are locatedin the samelibrary as the calling block. Otherwise, the calledblocks haveto becopiedinto the S7 programBlocks foldermanually.
  • 35. ‫مدرس‬:‫اکبری‬ ‫صادق‬ Tel. 09123182734 SIMATIC PCS7 Training CFC Language ‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬ ‫نیرو‬ ‫آب‬-‫پاییز‬96 Multiple Instance The FB602 is structured so that another, already existing FB40 can be called within it. This FB is detected as static variable with the data type FB and allows to achieve nesting of variables and concentration of all instance data in one instance data block (multiple instance). Structure If you want to look at the structure of your new block, proceed as follows: - In the block folder of your library, select FB40 (INT_P), then right-click and select Open Object. LAD/STL/FBD is opened. - Close the block only via File -> Close (Do not save, if you are prompted to save!) - In this editor open your block FB602 (V_SIM_FB) via right-click and select Object -> Open Now you can see the above structure on your screen. Attributes - Position the mouse pointer in a line (with green marking), then right-click and select Object properties -> Attributes to display the table with attributes (properties) of the parameter. Changes If you change/supplement attributes here, and then save the block, it will be given an STL identification. The changes must be made known to the CFC (if the block has already been used). Further consequences arise from the type of modified attributes.
  • 36. ‫مدرس‬:‫اکبری‬ ‫صادق‬ Tel. 09123182734 SIMATIC PCS7 Training CFC Language ‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬ ‫نیرو‬ ‫آب‬-‫پاییز‬96 The interface between the operating system of a CPU and the user program are the tasks known in S7 as organization blocks (OB).Using these OBs, specific programsections canbe executedat certain times and in certain situations. There areOBs for CPU startup, for processinterrupts, and for cyclic interrupts(with different time bases)etc. For example,OB32has cyclicinterrupts every 1 second.Function blocksinserted in OB32are called every second. When ablock is inserted in a chart, by defaultit is automatically installed in OB35. The cycletime of OB35 is 0.1 seconds. OBs cannotbe inserted nor edited in CFC. In CFC, the OBs are displayed in the Runtimeeditor. OBs with differenttime cycles areset in the HW Config as illustrated in Picture. Note The defaultcycles areset as in Picture. It is recommended notto changethe default settings.
  • 37. ‫مدرس‬:‫اکبری‬ ‫صادق‬ Tel. 09123182734 SIMATIC PCS7 Training CFC Language ‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬ ‫نیرو‬ ‫آب‬-‫پاییز‬96 ‫‌هایی‬‫ه‬‫مشخص‬‫چون‬Run Sequence‫و‬Runtime group،‫برای‬‫پاسخ‬CPU‫برحسب‬‫زمان‬،‫واکنش‬‫زمان‬،‫مرده‬‫یا‬‫ثبات‬‫ساختارهای‬ ‫وابسته‬‫به‬،‫زمان‬‫به‬‫عنوان‬‫مثال‬‫کنترل‬‫حلقه‬‫بسته‬.‫تعیین‬‫کننده‬‫‌باشد‬‫ی‬‫م‬. ‫برای‬‫باز‬‫کردن‬‫پنجره‬Runtime Sequence‫به‬‫دور‬‫روش‬‫‌توان‬‫ی‬‫م‬‫عمل‬‫کرد‬: ‫از‬‫طریق‬‫دگمه‬RuntimeSequence‫در‬Toolbar ‫راست‬‫کلیک‬‫بر‬‫روی‬‫بالک‬‫و‬‫اتخاب‬‫گزینه‬Goto Insert Point ‫‌های‬‫ت‬‫قابلی‬‫پنجره‬Runtime Sequence ‫تغییر‬OB‫اختصاص‬‫داده‬‫شده‬‫به‬‫بالک‬ ‫انتقال‬‫یک‬‫مجموعه‬RuntimeGroup‫یا‬‫یک‬‫بالک‬‫خاص‬‫از‬‫زیر‬‫مجموعه‬‫یک‬OB‫به‬‫زیرمجموعه‬OB‫دیگر‬. ‫امکان‬drag‫کل‬‫یک‬‫چارت‬‫و‬drop‫آن‬‫به‬‫درون‬‫یک‬OB‫دیگر‬ ‫نکته‬:‫در‬‫پنجره‬RuntimeSequence‫فهرست‬‫تمامی‬OB‫ها‬‫حتی‬‫در‬‫صورت‬‫عدم‬‫وجود‬OB‫موردنظر‬‫در‬CPU‫مشاهده‬‫‌شود‬‫ی‬‫م‬.
  • 38. ‫مدرس‬:‫اکبری‬ ‫صادق‬ Tel. 09123182734 SIMATIC PCS7 Training CFC Language ‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬ ‫نیرو‬ ‫آب‬-‫پاییز‬96 When ablock insertedinto a CFC chart, a blockis installed in a runtime groupin default OB. It is important to re-locatethe runtime groupinto an appropriateOB. A runtime groupis createdwhenyou insert a CFC chart. When ablock is placedon anempty CFC chart, the blockis installed inside the group.Subsequentlydragged-and-droppedblockson the chart arearrangedin the groupandthe orderin which they areplaced. ‫پردازش‌بالک‬ ‫‌های‬‫ک‬‫محل‌پردازش‌پیش‌فرض‌بال‬PCS7‫در‬OB35(Cyclic InterruptOBs-100ms)‫است‬. ‌‫‌های‌کتابخانه‬‫ک‬‫بیشتر‌بال‬PCS7‌‫فقط‌در‬Cyclic InterruptOBs‫قابل‌اجرا‌هست‬. ‌‫در‌صورتی‌که‌حجم‌اجرای‌برنامه‌به‌صورتی‌باشد‌که‌اجرای‌آن‌بیش‌از‌زمان‌تنظیم‌شده‌در‬HWConfig‌‫برای‬OB‌‫مورد‌نظر‬ ‫باشد‬‌.CPU‌‫با‌مشکل‌مواجه‌خواهد‌شد‌که‌این‌مشکل‌در‬OB1‫وجود‌ندارد‬. ‌‫شماره‬Runtime Group‌‫شماره‌مربوط‌به‌چارت‬CFC‌‫در‌زیرمجموعه‬OB‌‌‫و‌شماره‬RuntimeSequence‌‫شماره‌یا‌ترتیب‌اختصاص‬ ‫‌باشد‬‫ی‬‫داده‌شده‌برای‌پردازش‌بالک‌در‌درون‌چارت‌م‬. ‌‫در‌فهرست‬RuntimeGroup‌‫تمام‬OB‌‫های‌تعریف‌شده‌در‬S7‫‌اند‬‫ه‬‫لیست‌شد‬‌.‌‫ممکن‌است‬CPU‌‫انتخاب‌شده‌تمام‌این‬OB‌‫ها‌را‬ ‫پشتیبانی‌نکند‬‌‌. ‌‫در‌صورت‌عدم‌وجود‬OB‌‫در‬CPU‫‌گردد‬‫ی‬‫برنامه‌دچار‌فالت‌م‬. ‌‫اگر‌بالکی‌به‌صورت‌مستقیم‌و‌بدون‬Group‌‫در‌زیر‬OB35‌‫قرار‌گیرد‌در‌این‌صورت‌شماره‬1/-‫خواهد‌گرفت‬‌‌.
  • 39. ‫مدرس‬:‫اکبری‬ ‫صادق‬ Tel. 09123182734 SIMATIC PCS7 Training CFC Language ‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬ ‫نیرو‬ ‫آب‬-‫پاییز‬96 Run Sequence ‫بر‬‫روی‬‫آیکون‬Run Sequence‫در‬‫میله‬‫ابزار‬(‫که‬‫به‬‫صورت‬‫دایره‬‫قرمز‬‫رنگ‬‫نشان‬‫داده‬‫شده‬)‫کلیک‬‫کنید‬.‫یک‬‫پنجره‬‫باز‬‫م‬‫ی‬‫شود‬ ‫که‬‫در‬‫آن‬‫تمام‬‫بالک‬‫های‬OB‫مربوط‬‫به‬CPU‫فهرست‬‫شده‬‫است‬. ‫وقتی‬‫یک‬‫پروژه‬‫ایجاد‬‫می‬‫شود‬‫پیش‬‫فرض‬(Predecessor)‫نصب‬‫بالک‬‫ها‬‫در‬OB‫ها‬‫بر‬‫روی‬OB35‫تنظیم‬‫شده‬‫است‬.‫به‬‫این‬‫معنی‬‫که‬ ‫وقتی‬‫یک‬‫چارت‬‫ایجاد‬‫می‬‫شود‬.‫یک‬runtime group‫به‬‫صورت‬‫اتوماتیک‬‫در‬OB35‫به‬‫اسم‬‫همان‬ ‫چارت‬‫ایجاد‬‫‌شود‬‫ی‬‫م‬.‫وقتی‬‫بالک‬‫ها‬‫به‬‫چارت‬‫اضافه‬‫می‬‫شوند‬‫به‬‫صورت‬‫اتوماتیک‬‫در‬‫این‬Runtime Group‫گروه‬‫بندی‬‫می‬‫شوند‬. Moving the RuntimeGroup ‫برای‬‫تغییر‬OB‫مربوط‬‫به‬‫یک‬Run Time Group(‫چارت‬CFC)‫سیمبل‬‫پوشه‬Run Time Group‫ایجاد‬‫شده‬‫برای‬‫چارت‬‫جدید‬(َ‫ال‬‫مث‬ ‫پوشه‬Test‫در‬‫شکل‬‫باال‬)‫را‬‫با‬‫ماوس‬‫گرفته‬‫و‬‫به‬‫داخل‬‫یک‬OB‫دیگر‬(OB32)‫بکشید‬‫که‬‫در‬‫داخل‬ CPU‫این‬OB‫با‬‫سیکل‬‫زمانی‬‫متفاوت‬‫اجرا‬‫می‬‫شود‬. ‫برای‬‫اینکه‬‫در‬‫زمان‬‫ایجاد‬‫چارت‬‫های‬،‫جدید‬‫‌ها‬‫ت‬‫چار‬‫در‬‫یک‬OB‫دیگری‬‫غیر‬‫از‬OB35‫نصب‬‫شوند‬‫بایستی‬‫یک‬‫پیش‬‫فرض‬ ‫نصب‬‫دیگری‬(Predecessorfor installation)‫تعریف‬‫کرد‬. Predecessorfor Installation ‫برای‬‫تغییر‬OB،‫‌فرض‬‫ش‬‫پی‬OB‫مورد‬‫نظر‬(‫مثال‬OB32)‫را‬‫اتخاب‬‫کرده‬‫و‬‫سپس‬‫با‬‫راست‬‫کلیک‬‫روی‬‫آن‬‫گزینه‬Predecessor for installation position‫را‬‫اجرا‬‫کنید‬.‫با‬‫این‬‫کار‬‫مکان‬‫جدید‬‫پس‬‫از‬‫تایید‬‫پنجره‬‫عملیاتی‬‫تعیین‬‫م‬‫ی‬‫شود‬. ‫لذا‬‫بالک‬‫های‬‫بعدی‬‫در‬Run Time Group‫انتخاب‬‫شده‬‫قرار‬‫خواهند‬‫گرفت‬. Run Time Group‫به‬‫صورت‬‫رنگ‬‫سبز‬‫روشن‬‫خواهد‬‫شد‬‫و‬‫پیش‬‫فرض‬‫جدید‬OB32/test‫در‬‫قسمت‬‫پایین‬‫و‬‫سمت‬‫راست‬‫پنجره‬ CFC‫نشان‬‫داده‬‫خواهد‬‫شد‬.(‫شکل‬‫را‬‫ببینید‬).
  • 40. ‫مدرس‬:‫اکبری‬ ‫صادق‬ Tel. 09123182734 SIMATIC PCS7 Training CFC Language ‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬ ‫نیرو‬ ‫آب‬-‫پاییز‬96 The defaultsequenceof blocksin anOB by no meansrepresentsthe signal flow betweenthe blocks. Generally,blocks shouldbe executedin a logic sequencewhichdependson signal flows. For example,blocksin Picture should bearrangedin the following order:  (1) Block FB_OPENor FB_CLOSE  (2) Block VALVE  (3) Block OUT To arrangeblocksin a logic order, the function“OptimizeRun Sequence”is used. The menupathto call up the functionandsettings of the function is illustrated in Picture. If “Optimize runsequence”is performed,the blocks of the groupwill bearrangedaccordingto the signal flow sequencebetween theblocks. In debuggingandtesting, youcanactivate or de-activatethe Optimize run sequencefunction byselect or de-selectthe Active box(Step 3 of Picture).
  • 41. ‫مدرس‬:‫اکبری‬ ‫صادق‬ Tel. 09123182734 SIMATIC PCS7 Training CFC Language ‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬ ‫نیرو‬ ‫آب‬-‫پاییز‬96 Reductionratio The reductionratio determineswhethertheCFCblocks/SFCchartsofa runtime groupare processedeachtime oronlyevery nth time thetaskis executed."n"is an integer(n = 2t,where 0 <= t <= 15). The cycle times are a multiple ofthebasic reductionratio ofthetask. Example: Basic cycle ofa cyclic interrupt(OB 33): 500ms Possibleclock cycles with reductionratio: 1 s, 2s, 4 s, 8 s,16 s, etc. The default settingis 1 sotheblock/SFCchart is executedin every cycle (in OB 33every500ms). Phaseoffsetallows a uniformdistributionofload within theCPU.It mustbe consideredin conjunctionwith "n", thereductionratio. The blocks or SFCchartsofthe runtimegroupare executedas oftenas specified by"n", offset by"m"unitsofthe taskcycle. "m" is an integer, where0<= m<= (n-1). Example: Basic cycle ofa cyclic interrupt: 500ms Reductionratio: 16(i.e., theblock/SFCchart is processedatintervals of 8 s) Phaseoffset:3. The block/SFCchart is processedat intervals of 1.5s, 9.5 s, 17.5s,etc. The default is 0; in otherwords,the block/SFCchart is executedwithouta phaseoffset. "Optimizerunsequence"option Youcan select/deselectthecheckboxin orderto include orexcludea runtime groupfrom run sequenceoptimization.If theruntime groupscontains F objects,the optionis notenabled. Youwill find moredetailed information in: Optimizing therun sequence "Active"option Youcan select/deselectthecheckboxin orderto enable/disablethe runtimegroupfor processing,if it is notinterconnected.Aninterconnection alwayshas priority. In the detailwindowof theruntimeeditorin thecolumn"Inactive", the modeofthe runtimegroupis displayed.The namecorrespondswiththatof theruntime propertiesfield ofa block. This character"!" meansthatthe relevant runtimegroupis inactive; this character "?" meansthatthe runtime groupEN is interconnectedorSFCaccessexistsandtherefore is notin static processmode(may beactive or inactive). Usingthe shortcutmenucommandsSwitchonRuntimeGroupandSwitchoff RuntimeGroup,youcan select ordeselectthe optionfortheselected runtimegroup,withoutinitiating the objectproperties.
  • 42. ‫مدرس‬:‫اکبری‬ ‫صادق‬ Tel. 09123182734 SIMATIC PCS7 Training CFC Language ‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬ ‫نیرو‬ ‫آب‬-‫پاییز‬96 The Optimize runsequenceoption hasto beset oneby onefor eachruntime group.However,the option is set by default. The Optimize runsequencefunctionis executedby the menupath as illustrated in Picture. The Optimizing runsequencefunctionis relevantto all runtime groupsratherthan the blocksin an AS that havebeenactivated forthe function. Therefore,the function couldchangea largenumberof blockscontainedin differentCFC chartsand has a globalimpact onthe behaviorof runtimeperformanceof a S7 program. After optimizing run sequence, the blocks on the chart, val, are re-arranged.
  • 43. ‫مدرس‬:‫اکبری‬ ‫صادق‬ Tel. 09123182734 SIMATIC PCS7 Training CFC Language ‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬ ‫نیرو‬ ‫آب‬-‫پاییز‬96 .
  • 44. ‫مدرس‬:‫اکبری‬ ‫صادق‬ Tel. 09123182734 SIMATIC PCS7 Training CFC Language ‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬ ‫نیرو‬ ‫آب‬-‫پاییز‬96 Runtime groups can be activated or deactivated individually (for example by a block output of the "BOOL"data type). If a runtime group is deactivated, the blocks it contains will not be executed when the program is executed. You can also de-activate an OB in runtime. ‌‫کنترل‌یک‬CFC‌‫از‌یک‬CFC‫دیگر‬ ‌‫روی‌خروجی‌بالک‌در‌یک‬CFC‌‫کلیک‌و‌گزینه‬Interconnection to Runtime Group‫‌کنیم‬‫ی‬‫را‌انتخاب‌م‬ ‌‫سپس‌از‌لیست‌نمایش‌داده‌شده‬OB‌‫و‬CFC‌‫مورد‌نظر‌بکار‌رفته‌در‌آن‬OB‫‌کنیم‬‫ی‬‫را‌انتخاب‌م‬. ‌‫با‌این‌کار‌پرچم‌قرمز‌رنگ‌در‌بخش‌اتصاالت‌خروجی‬CFC‫‌شود‬‫ی‬‫اول‌ظاهر‌م‬. ‌‫با‌این‌کار‬Enable‌‫مربوط‌به‬CFC‌‫دوم‌به‌یک‌شدن‌خروجی‌موردنظر‌در‬CFC‫اول‌بستگی‌خواهد‌داشت‬. ‌‫‌ها‌در‬‫ک‬‫بر‌روی‌بال‬CFC‫‌شود‬‫ی‬‫دوم‌عالمت‌سوال‌؟‌ظاهر‌م‬.
  • 45. ‫مدرس‬:‫اکبری‬ ‫صادق‬ Tel. 09123182734 SIMATIC PCS7 Training CFC Language ‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬ ‫نیرو‬ ‫آب‬-‫پاییز‬96 Interconnecting Runtime GroupStatically If youselect a runtimegroupin theruntimesequenceandopenits properties,theActive optionis set.This meansthatallblocks from this groupare takeninto accountfor eachOB pass. If youdeactivatethis option,noneoftheblocks in thegroupare takenintoaccount/processed. In theassociatedCFC chart all blocksdisplay a red exclamationmarkin therectangle showingtheexecutiondata.This indicates to theconfiguringengineer that theblockis notactive! Alternative Select the runtimegroupin theruntimesequenceandexecutetheprocessusingthe contextmenuby right-clickingandselectingSwitchon(activate)RuntimeGroup or right-clickingandselectingSwitch off(Deactivate)runtimegroup
  • 46. ‫مدرس‬:‫اکبری‬ ‫صادق‬ Tel. 09123182734 SIMATIC PCS7 Training CFC Language ‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬ ‫نیرو‬ ‫آب‬-‫پاییز‬96 ‫‌‌بالک‬‫ن‬‫یک‌فانکش‬‫به‌دو‌صورت‌در‬S7‫‌شود‬‫ی‬‫‌سازی‌م‬‫ه‬‫پیاد‬: ‫نوشتن‬‫یک‬‌‫ن‬‫فانکش‬‫بالک‬‫به‬‫زبان‬‫های‬‫پایه‬FBD-LAD-STL‫در‬‫قالب‬FB‫یا‬FC‫و‬‫فراخوانی‬‫آن‬‫در‬‫محیط‬CFC ‌‫نوشتن‌یک‌برنامه‌به‌زبان‬SCL‫و‌کامپایل‌آن‌در‌قالب‬FB‌‫و‌فراخوانی‌آن‌در‌محیط‬CFC FC‌‫یا‬FB‌‫موردنظر‌در‌محیط‬ComponentView‫‌شود‬‫ی‬‫ساخته‌م‬. ‌‫شماره‌اختصاص‌داده‌شده‌به‬FC‫فقط‌در‌رنج‌مجاز‌امکان‌پذیر‌است‬. ‌‫‌های‌مجاز‌برای‌تولید‬‫ه‬‫شمار‬FC‌‫توسط‌کاربراز‌منوی‬Options‫تنظیم‌می‌شود‬. ‌‫شماره‌مجاز‌از‬60‌‫تا‬700‌‫برای‌کاربر‌یا‌سایر‌برنامه‌ها‌یا‌ماژول‌های‌قابل‌نصب‌در‬PCS7‫‌باشد‬‫ی‬‫م‬.
  • 47. ‫مدرس‬:‫اکبری‬ ‫صادق‬ Tel. 09123182734 SIMATIC PCS7 Training CFC Language ‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬ ‫نیرو‬ ‫آب‬-‫پاییز‬96 ‫در‬‫داخل‬‫چارت‬CFC‫‌توان‬‫ی‬‫م‬‫ورودی‬/‫خروجی‬‫بالک‬‫ها‬‫را‬‫به‬I/O‫‌های‬‫تعریف‬‫شده‬‫برای‬‫چارت‬‫متصل‬‫کرد‬. ‫امکان‬‫اتصال‬‫‌های‬‫ه‬‫پای‬‫‌ها‬‫ک‬‫بال‬‫برای‬‫برخی‬‫از‬‫‌ها‬‫ک‬‫بال‬‫مانند‬‫‌های‬‫ک‬‫بال‬Driver‫که‬‫بایستی‬‫به‬‫کانال‬‫فیزیکی‬‫متصل‬،‫گردد‬‫به‬Chart IO ‫وجود‬‫ندارد‬. ‫مراحل‬‫فراخوانی‬‫یک‬‫چارت‬CFC‫از‬‫چارت‬CFC‫دیگر‬(ChartIn Chart)‫‌انداز‬‫ت‬‫عبار‬: ‫فعال‬‫کردن‬‫پنجره‬Chart Input/output‫از‬‫منوی‬View‫ویرایشگر‬CFC ‫تعریف‬‫پارامترهای‬‫ورودی‬‫و‬‫خروجی‬‫برای‬‫یک‬‫چارت‬CFC ‫اتصال‬‫متغییرهای‬‫تعریف‬‫شده‬‫به‬‫ورودی‬‫خروجی‬‫های‬‫‌ها‬‫ک‬‫بال‬‫در‬‫درون‬‫چارت‬ –‫است‬‫ر‬‫کلیک‬‫بر‬‫روی‬‫پایه‬‫موردنظر‬‫و‬‫انتخاب‬‫ینه‬‫ز‬‫گ‬Interconnect ToChart I/O –‫ظاهر‬‫شدن‬‫پرچم‬‫سفید‬‫نگ‬‫ر‬‫در‬‫بخش‬‌‫ی‬‫خاکستر‬‫نگ‬‫ر‬
  • 48. ‫مدرس‬:‫اکبری‬ ‫صادق‬ Tel. 09123182734 SIMATIC PCS7 Training CFC Language ‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬ ‫نیرو‬ ‫آب‬-‫پاییز‬96 Chart inChart Purposeofthis technique: Todesignclear,well-structured charts. Chart sectionsthat are repeatedlyusedwith thesamestructurecanbe combinedtolooklike onechart with a predefinedsheetbar - andthuslike a blockwith I/O. Procedure 1.Thelower-levelchart is created andgiveninterconnections(this canalso becarried outin a (masterdata) library). 2.Thepreviouslycreated chartis inserted in the higher-levelchart.Thereit its displayed like ablock;its sheetbar(I/O) was defined in step1. 3.If thelower-level chart wascreated in a library andwasdraggedintothetopchart,it will notbeshownin theproject's chartfolder (as youcan onlysee thetopchart there).Theassociated blocksare inserted in theruntimesequence.Youcanchangetheir sequence in there if required. Alternative: If youobtainthe"New chart" from theCatalog tab"Blocks" andplace it as anemptychart in theCFC chart,thenyoucan implement a top-downapproach- i.e. reverse thesequencein points 1and2in theabovedescribedprocedure: 1.In thehigher-level chart,first place "only" emptycharts aswildcards for specific functions; thefunctionis documentedfirst "only" as nameof therespective empty"black box".Theresult is a functionoverviewchart consistingof thevariousindividual charts. In thesecondstep,thedetails are addedtotheseindividual chartsas lower-levelcharts,i.e. "filled" with blockfunctionality and providedwithchart interconnections. 3.Nowyoucan interconnecttheindividual charts in thehigher-level chart.
  • 49. ‫مدرس‬:‫اکبری‬ ‫صادق‬ Tel. 09123182734 SIMATIC PCS7 Training CFC Language ‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬ ‫نیرو‬ ‫آب‬-‫پاییز‬96 the chart-in-charttechniqueis a functionfor efficient engineering. This involvesinserting oneCFC chartinto another.The insertedchart thenbecomesthe hierarchicalchartandthe other the basechart. This enablesyouto createa chart onceand thenuse it as the basis for numerousothercharts. This means,for example,you cancreatea simulation chartfor a valveand theninsert this simulation chart as a hierarchicalchart into the basechart for the "valve"processtag. Of course,you canopenandedit the hierarchicalchartfrom the basechartat anytime. Example: As mentionedandshown in Picture, You couldplacea chart ontoanotherchart. the chart, CFC_val, is placedonto CFC_2. The chartnesting structure is displayedin the Blocks/chartscatalogueas shown in Picture whereChart CFC_2containsCFC_val. Picture also shows howto openthe original chart(Step 3).
  • 50. ‫مدرس‬:‫اکبری‬ ‫صادق‬ Tel. 09123182734 SIMATIC PCS7 Training CFC Language ‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬ ‫نیرو‬ ‫آب‬-‫پاییز‬96
  • 51. ‫مدرس‬:‫اکبری‬ ‫صادق‬ Tel. 09123182734 SIMATIC PCS7 Training CFC Language ‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬ ‫نیرو‬ ‫آب‬-‫پاییز‬96
  • 52. ‫مدرس‬:‫اکبری‬ ‫صادق‬ Tel. 09123182734 SIMATIC PCS7 Training CFC Language ‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬ ‫نیرو‬ ‫آب‬-‫پاییز‬96 Compiling CFC chartas block type(Chart-in-Block) You cancompilea chartas a block. Blockinstancesin the chartbecomesubsectionsof the chart block.A chartblockis then a blocktype. Note To makea chartout of a block, the blocksin the chartmust not be installed in a runtime groupandtheyshould not haveinterconnectionsto other charts.
  • 53. ‫مدرس‬:‫اکبری‬ ‫صادق‬ Tel. 09123182734 SIMATIC PCS7 Training CFC Language ‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬ ‫نیرو‬ ‫آب‬-‫پاییز‬96 ‫پس‬‫از‬‫تعریف‬I/O‫برای‬‫یک‬،‫چارت‬‫‌توان‬‫ی‬‫م‬‫چارت‬‫را‬‫به‬‫عنوان‬‫یک‬‫بلوک‬‫کامپایل‬‫کرد‬. ‫لذا‬‫برای‬‫استفاده‬‫از‬‫بالک‬‫در‬‫‌ها‬‫ت‬‫چار‬‫نیاز‬‫است‬‫که‬‫برای‬IO‫های‬‫چارت‬‫که‬‫‌های‬‫ر‬‫پارامت‬‫بالک‬‫حاصل‬‫از‬‫کامپایل‬‫خواهد‬،‫بود‬ ‫همانند‬SCL‫‌هایی‬‌‫ی‬‫ویژگ‬(attributes)‫تعریف‬‫کنیم‬. ‫تصویر‬‫نشان‬‫میدهد‬‫که‬‫چگونه‬‫برای‬‫باز‬‫کردن‬‫خواص‬‫متغیر‬‫محاوره‬‫ارائه‬‫شده‬‫است‬‫که‬‫یک‬‫ن‬‫مودار‬ I / O‫تعریف‬‫را‬‫مشخص‬‫ویژگی‬‫های‬‫سیستم‬‫برای‬‫یک‬‫متغیر‬‫وجود‬‫دارد‬. ‫پنجره‬‫تعریف‬‌‫ی‬‫ویژگ‬‫برای‬‫پارامترهای‬‫انتخاب‬،‫شده‬‫در‬‫تصویر‬‫باال‬‫نشان‬‫داده‬‫شده‬‫است‬.
  • 54. ‫مدرس‬:‫اکبری‬ ‫صادق‬ Tel. 09123182734 SIMATIC PCS7 Training CFC Language ‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬ ‫نیرو‬ ‫آب‬-‫پاییز‬96 For analogvariables, engineeringunits areprovidedat block instances.See Picture. You canedit andadd units in the file andthey becomeavailablesystem-wide.When upgradingthe PCS 7 systeminstallation, you should rememberto backup the files. Storing of the engineering units
  • 55. ‫مدرس‬:‫اکبری‬ ‫صادق‬ Tel. 09123182734 SIMATIC PCS7 Training CFC Language ‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬ ‫نیرو‬ ‫آب‬-‫پاییز‬96 In the Test Modeof the CFC, you cantest anddebugyourprogram. The CFC test modeis convenientfortesting oneCFC sheet. To monitor andmanipulatevariablesfromdifferent chartsand/orfrom differentCPUs, youcould usethe DynamicDisplay function.
  • 56. ‫مدرس‬:‫اکبری‬ ‫صادق‬ Tel. 09123182734 SIMATIC PCS7 Training CFC Language ‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬ ‫نیرو‬ ‫آب‬-‫پاییز‬96 TestMode Youmustactivate "test mode"totest thefunctiondownloadedtotheAS.  First activate Debug ProcessMode Or Debug LaboratoryMode toselect/checktheappropriate testenvironment.  Usethe following commandtoactivate/deactivatetest mode: Debug TestMode With laboratoryoperation,monitoringis automatically activatedfor theparametersspecified "for test".Duringprocess operation, youmust select therequired blockeach timeandidentify it for monitoringby right-clickandselectingWatchOn Test 1 If thetest modeis active andtheparameters tobetestedhaveayellow background(default settingfor updatedvalues),youcanset parametersfor theinput parameter.Thenewvalue is written tothe ASandtotheproject. Changethevalueonthe"First" block,"U" input.Monitortheresult onthe"Second" block,"V" output. Test 2 DynamicDisplay offers an additionaltest procedure.Youcanopena displaywindowin CFC: View DynamicDisplay Use"drag anddrop"in this windowtodragtheblock parametersyouwant tomonitor(from anyoftheprojects- evenfrom different CPUs). Oneline in thetable is reservedfor eachparameter. Uponactivation oftest mode,youcanmonitoror edit (if permissible) theseselected parameters. Youcandelete severalparametersyounolongerneedbyselecting therelevant line,right-clickingandselectingDelete. YoucanusetheNew ,Renameor Delete buttonsin the tablewindowtocreate, renameor delete newdynamicdisplays.
  • 57. ‫مدرس‬:‫اکبری‬ ‫صادق‬ Tel. 09123182734 SIMATIC PCS7 Training CFC Language ‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬ ‫نیرو‬ ‫آب‬-‫پاییز‬96 Additionalexercise(option) Trytorecognize theconsequencesof anOB32overload.Use theLOADblock from theKURSBS60library for thispurpose(see slide). SupplementtheCFC "Attempti"chartas suggestedabove. ----------------------------------------------------------------------------------------------------- Procedure 1.LOADblock:Switch theloadonusing"ON"=1. Increase theOB32loadbyincreasing theparameter "CYCL". 2.INT block:With theparameters"TI"=1 and"U"=1,theblockwill incrementthe output"ACTUAL" eachtime OB32is called. If Test  Testsettings Monitoringcycle = 1second is set in theCFC, thevalue of theoutputwill be incrementedby1 everysecondin test mode.This applies tonormaloperation. Increase theCYCL input ofthe LOADblock,andobservetheoutput"V" of theINTblock. Also checkthediagnosticsbuffer of yourCPU usingthe CFC menu PLC Moduleinformation  "Diagnostics buffer" tab andthe(OB1) cycle time in thetabwith this name. 3.Connectthe output"V" oftheINT blocktotheinput"U" of theMEAS_MONblock. In thelatter, select "Long-term archiving" in theproperties of theinput"U" under"Archive". 4.Compile anddownloadtheAS 5.Compile theOS. Theparameter"U" of theMEAS_MOSis created therein TagLogging,in the"System archives" archive. 6.Activate theOS,andcreate anonline trendfor this variable. Carry outthesameincrease totheload in theAS, andcheck the reaction ontheOS.
  • 58. ‫مدرس‬:‫اکبری‬ ‫صادق‬ Tel. 09123182734 SIMATIC PCS7 Training CFC Language ‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬ ‫نیرو‬ ‫آب‬-‫پاییز‬96
  • 59. ‫مدرس‬:‫اکبری‬ ‫صادق‬ Tel. 09123182734 SIMATIC PCS7 Training CFC Language ‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬ ‫نیرو‬ ‫آب‬-‫پاییز‬96 With Memory Reset Object‫ها‬‫و‬Tag‫ها‬‫در‬WINCC‫پاک‬‫شده‬‫و‬‫از‬‫نو‬‫ساخته‬‫‌شود‬‫ی‬‫م‬. ‫با‬‫کامپایل‬OS‫‌ها‬‫ر‬‫متغیی‬‫از‬‫سیستم‬AS‫در‬ES‫به‬OS‫منتقل‬‫می‬‫گردد‬. ‫در‬‫صورت‬‫ظاهر‬‫شدن‬‫پیام‬‫خطا‬‫در‬‫شروع‬‫کامپایل‬‫به‬‫معنی‬‫کامپایل‬‫نشدن‬‫یک‬‫یا‬‫چند‬CFC‫می‬‫باشد‬.
  • 60. ‫مدرس‬:‫اکبری‬ ‫صادق‬ Tel. 09123182734 SIMATIC PCS7 Training CFC Language ‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬ ‫نیرو‬ ‫آب‬-‫پاییز‬96
  • 61. ‫مدرس‬:‫اکبری‬ ‫صادق‬ Tel. 09123182734 SIMATIC PCS7 Training CFC Language ‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬ ‫نیرو‬ ‫آب‬-‫پاییز‬96
  • 62. ‫مدرس‬:‫اکبری‬ ‫صادق‬ Tel. 09123182734 SIMATIC PCS7 Training CFC Language ‫پتروفن‬ ‫شرکت‬–‫امام‬ ‫بندر‬ ‫نیرو‬ ‫آب‬-‫پاییز‬96