Workingwithcfccharts 170930195645
Workingwithcfccharts 170930195645
Workingwithcfccharts 170930195645
چارتCFC
ایجادچارتCFC
کارباویرایشگرCFC
پنجرهکاتالوگ
فانکشنبالکهایازقبلآمادهشده
نوعفانکشنبالک
درجیکفانکشنبالکبهیکCFC
مشخصاتیکفانکشنبالک
پایههایورودی/خروجیبالک
اتصالورودی/خروجیهایبالک
اتصالمتنی
کتابخانهپروژه
بروزآوریفانکشنبالکهاییکچارت
فانکشنبالکهاینوعMulti Instance
بالکهایOB
اجرایفانکشنبالکهاRun Sequence
گروهاجراییRuntime Group
بهینهسازیاجرایبالکها
کامپایلودانلودچارت
شرکت پتروفن – بندر امام SIMATIC PCS7 Training مدرس :صادق اکبری
آب نیرو -پاییز 96 CFC Language Tel. 09123182734
CFCبرگرفتهازسهکلمه Continuous Function Chartمیباشد.کهمهمترینابزاربرنامهنویسی PCS7به چکیده
شمارمیرود.اینابزارهمانطورکهازاسمشپیداستبرایپیادهسازیالجیککنترلپیوستهبه
کارمیرود.ابزاردیگربرنامهنویسیدر ،PCS7چارتهای SFCنامداردکهبرایکنترلترتیبی
()Sequentialمیباشد.
دراینفصلبامواریمانندنحوهکارباویرایشگر ،CFCمفاهیمپایهفانکشنبالک.نحوهدرج
فانکشنبالکهادرچارتهای CFCوکامپایلودانلودآنهابه CPUآشناشدهودرنهایتبانحوه
تستبالکهادرزمان Runtimeکارخواهیمکرد.
شرکت پتروفن – بندر امام SIMATIC PCS7 Training مدرس :صادق اکبری
آب نیرو -پاییز 96 CFC Language Tel. 09123182734
شرکت پتروفن – بندر امام SIMATIC PCS7 Training مدرس :صادق اکبری
آب نیرو -پاییز 96 CFC Language Tel. 09123182734
کنترل عملیات یک فرآیند به سه صورت کلی پیوسه ،ترتیبی و ترکیبی از این دو میتواند انجام کنترل فرآیند
شود .بیشتر عملیات یک پلنت فرآیندی توسط فرآیندهای پیوسته توصیف میشود .این موضوع با
ایجاد چارتهای CFCدر ویرایشگر CFCسیستم PCS7محقق میشود.
برنامه کنترل به زبان CFCبرای کنترل عملیات پیوسته ،که بایستی به طور مداوم توسط CPUاسکن و چارت CFC
پردازش شود ،به کار میرود.
چارت CFCمهمترین ابزار برنامهنویسی PCS7میباشد.
چارت CFCیکی از اجزاء قابل درج در محیط SIMATIC Managerمیباشد.
توسط ویزارد ایجاد پروژه به صورت خودکار در سطوح پلنت ایجاد میگردد.
بهتر است چارت CFCرا در محیط Plant Viewایجاد کرد.
توصیه میشود که نام هر چارت CFCپس ایجاد چارت تغییر یابد.
برای پیادهسازی برنامه کنترل یک پلنت با چارتهای CFCدو روش وجود دارد:
پیادهسازی کنترل تمام بخشها و سطوح فرآیندی در یک CFC
نوشتن برنامه کنترل هر سطح از پلنت در یک CFCجداگانه
برای ایجاد و تکمیل چارتهای ،CFCبلوکهای واقع در کتابخانه PCS7در چارتهای CFCدرج ایجاد چارت
میشوند .که شامل بلوک کنترل فرایند و بالکهای مانیتورینگ مقادیر فرایندی میباشد .پس از درج
بالکها در محیط ،CFCورودی و خروجیهای این بلوکها به طور مستقیم در ویرایشگر CFCبه هم
متصل و پارامترهای بالکها مقداردهی میشود.
تجهیزات فرایندی مثل موتور و وولو ( )Motors and Valvesاز دیدگاه ،PCS7با عنوان Process Tagشناخته Process Tag
میشوند .برای کنترل چنین تجهیزاتی ،از قبل در کتابخانه ،PCS7چارتهای CFCتحت عنوان Process
Tag Typeآماده شده است .که در کتابخانههای استاندارد در شاخه Templateدستهبندیشدهاند.
برای حفظ روشن ساختار پروژه مطابق با سطوح فرایندی پلنت ،چارتهای CFCهمیشه در
پوشههای سلسله مراتبی پلنت ( )PHایجاد و نگهداری میشوند.
شرکت پتروفن – بندر امام SIMATIC PCS7 Training مدرس :صادق اکبری
آب نیرو -پاییز 96 CFC Language Tel. 09123182734
CFC Charts
The block instances you need to solve a technological task definition can be divided into any number of charts.
A CFC chart consists of six pages (overview display)
1 page consists of a work area and two marginal bars.
Automatic, chart-spanning marginal bar management
User-friendly signal monitoring
AutoRoute
Resources are completely managed for the user.
1 to 1 documentation for the entire 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 to them
.میباشدCFC با زبانPLC یک ابزار گرافیکی برای نوشتن برنامههایCFCویرایشگر
خروجی آنها به هم صورت/) بالکهای از قبل آماده شده در یکی از شیتها و اتصال ورودیInsert( ایجاد برنامه کنترل با درج
: اتصاالت ممکن شامل.میگیرد
در یک شیت یک چارتIO بین فیلدهای
بین بالکهای تابع درون چارتها
برای مدیریت سیگنالهای مبداء و مقصدMargin bar استفاده از
مزایا
زبان برنامه نویسی برای مهندسین طراح
دیباگ کردن و راهاندازی، سرعت بخشیدن به پیادهسازی برنامه کنترل
شرکت پتروفن – بندر امام SIMATIC PCS7 Training صادق اکبری: مدرس
96 پاییز-آب نیرو CFC Language Tel. 09123182734
. باز میشودCFC با دابل کلیک روی یک چارتCFC ویرایشگر
) با شش قسمت برای قرار دادن بالکهای برنامه استA(چارت باز شده شامل یک شیت خالی
. با راست کلیک بر روی تب شیتها در پایین پنجره صورت میگیردA ) در قبل و بعد از شیتB,C,…( افزودن شیت دیگر
با کشیدن بالکها از کاتالوگ سمت چپ به داخل محیط و اتصال ورودی و خروجی بالکها به هم بهCFC برنامهنویسی
.صورت گرافیکی انجام میگیرد
نمایش آدرسهای وروردی بالکها در نوار خاکستری سمت چپ و آدرسهای خروجی بالکها در نوار خاکستری سمت
راست شیت
.نداردUndo وSave گزینهCFC ویرایشگر
شرکت پتروفن – بندر امام SIMATIC PCS7 Training صادق اکبری: مدرس
96 پاییز-آب نیرو CFC Language Tel. 09123182734
کاتالوک حاوی فانکشنبالکها یا المانهای برنامه نویسی میباشد.
از منوی View > Catalogیا از طریق منو ابزار قابل نمایش میباشد که دارای سه بخش میباشد.
– Blocks بخش پیش فرض کاتالوگ بوده و حاوی مجموعه المانهای پایه برنامهنویسی میباشد.
-Charts شامل لیست چارتهای CFCدیگر موجود در پروژه و امکان فراخوانیآنها در چارت باز شده جاری
میباشد.
- Libraries حاوی لیست بالکهای کتابخانهای مختلف میباشد.
– Step7 Standard Library
– PCS7 Libraries
– CFC Library
– شامل كتابخانههاي مربوط به نصب بستههاي Optionalنظير F-Systemو CEMAT
تفاوت بالکها
بالکهای کتابخانههای PCS7برای کارهای پیچیده کنترلی و استفاده از توابع از پیش تعریف شده میباشد.
پوشه Blocksحاوی بالکهای پایه المان اصلی یا ) BOP( Building Blockهستند ولی بالکهای کتابخانههای از
نوع فانکشن و فانکشن بالک هستند.
برخی از بالکهای کتابخانههای دارای یک شکل گرافیکی بنام بالک آیکون در سیستم مانیتورینگ () OCM
هستند.
بالکهای پایه در هر OBقابل فراخوانی هستند .ولی بالکهای کتابخانههای فقط در OBهای خاص و
مشخص شده فراخوانی میشوند.
با هر بار فراخوانی بالکهای کتابخانههای از جنس ،FBیک DBجدیدی به آنها اختصاص داده میشود.
برای مشاهده اطالعات کامل در خصوص بالک مورد نظر،کلید F1را بر روی بالک کلیک نمایید.
شرکت پتروفن – بندر امام SIMATIC PCS7 Training مدرس :صادق اکبری
آب نیرو -پاییز 96 CFC Language Tel. 09123182734
Blocks
Organization Blocks (OBs). Between the operating system and the user programs there are the so-called
“Block” is an important concept in PCS 7. A summary of the blocks used in the system is listed in Table above
When a block is created, it must be "declared" as a function block (FB), a function call (FC), or a 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. To make the data accessible, a data block (DB) is created for each block instance.
In a multi-instance block, the calling FB contains subsidiary FBs but only one common DB is created.
A FC is a block without memory; in other words the values generated by the block are processed immediately. No data
block is required for a FC. A FC does not have default values at the outputs.
A BOP is also a block without memory.They are used for simple functions such as AND, OR, etc.
Basic operations are program components in CFC and are entered as the SCL statements during compilation.
BOPs are located in the CFC Chart folder. Refer to Picture where BOPs are indicated by the book icons.
شرکت پتروفن – بندر امام SIMATIC PCS7 Training صادق اکبری: مدرس
96 پاییز-آب نیرو CFC Language Tel. 09123182734
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 Define as Master Data Library
شرکت پتروفن – بندر امام SIMATIC PCS7 Training مدرس :صادق اکبری
آب نیرو -پاییز 96 CFC Language Tel. 09123182734
Master data Library
It is recommended that the blocks used in a project (user-defined or the system libraries) are collected into the project master 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 have been adapted into the project library.
To hide a library, use the Manage function of the SIMATIC Manager, the menu path, File > Manage. See Picture.
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 numbers and symbolic names within the master data library.
شرکت پتروفن – بندر امام SIMATIC PCS7 Training صادق اکبری: مدرس
96 پاییز-آب نیرو CFC Language Tel. 09123182734
بالکهای پایه ()Elementary Blocks
حاوی بالکهایی برای انجام عملیات پایه )BOP( Step7در چارتهای CFCمیباشد .این بالکهای پایه مانند CMP_Rو SQRTدر کتابخانه
CFCقرار دارند و به همراه ویرایشگر CFCنصب میشوند.
بالکهای تکنولوژیکی ()Technological Blocks
دسته بالکهای زیر توابع پایه برای انجام تسکهای اتوماسیون را فراهم میکند:
فانکشن بالکها ( ) Function blocksمانند LIMITS_P ،INT_P ،AVER_P
بالکهای کنترل اپراتوری ( ) Operator controlblocksمانند OPD ،OP_A_LIMبه همراه Faceplateهای مربوطه
بالکهای پیام ( ) Messageمانند MESSAGE , MSG_CSF
دسته بالکهای زیر به همراه صفحات Faceplateمربوطه برای مانیتورینگ و بهرهبرداری در ،OSتسکهای پیچیده را پردازش میکنند.
Controller block CTRL_PID, CTRL_S
Motor blocks MOTOR, MOT_REV, MOT_SPED
Valve blocks VALVE, VAL_MOT
Interlock display INTERLOCK
Dosage DOSE
Ratio controller RATIO_P
Monitoring blocks MEAS_MON, DIG_MON
Maintenance blocks ELAP_CNT, SWIT_CNT, OB1_TIME
شرکت پتروفن – بندر امام SIMATIC PCS7 Training مدرس :صادق اکبری
آب نیرو -پاییز 96 CFC Language Tel. 09123182734
بالکهای تبادل داده بین دو سیستم ()Communication Blocks
بالکهای ارتباط شبکه در کتابخانه PCS7 Library V6.1قرار دارند این بالکها عبارتند از SEND_B0و REC_B0برای 128مقدار
باینری و SEN_Rو REC_Rبرای انتقال 32مقدار Booleanو 32مقدار Real
هر دوی این جفت بالکها برای تبادل داده و ارتباطات از طریق System Busمناسب هستند.
کتابخانه استاندارد )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-S7 Convertشامل بالکهای برای تبدیل برنامههای TIبه S7میباشند.
نکته
کتابخانه )REDUNDUNT_IO (V1تا نسخه 6.1نرمافزار PCS7و کتابخانه REDUNDANT IO CGPدر
نسخه 7.0و باالتر برای سیستمهای Hتحملپذیر خطا به همراه I/Oافزونه موجود میباشد.
شرکت پتروفن – بندر امام SIMATIC PCS7 Training مدرس :صادق اکبری
آب نیرو -پاییز 96 CFC Language Tel. 09123182734
When you place a block on a CFC chart, you place only its instance on the chart.
Instance means a usage of a block type.
When dragging the Valve block, FB73, from the PCS 7 library and dropping it on to a CFC, an instance of FB73 is placed on the chart. The
block type is left in the Blocks folder (Prog1) and in the CFC Chart folder. See Picture Above.
Further Instance blocks can be dragged from a type in the CFC Chart folder rather than from libraries or from the Blocks folder. The former is
faster as no checks for discrepancy between a block type in the CFC Chart folder and Blocks folder are
performed.
Note
In a real project, the master data library is used throughout a project engineering cycle. Block types are created in or copied
into the master data library. The master data library is the only source for a particular project.
You can create any number of block instances from a block type. You can assign names to these block instances ,
interconnect them, and assign parameters to them without changing the functionality of the type.
شرکت پتروفن – بندر امام SIMATIC PCS7 Training صادق اکبری: مدرس
96 پاییز-آب نیرو CFC Language Tel. 09123182734
Block types are ready-made program sections that can be inserted in a CFC chart.
When a block type is inserted, a block instance is created. You can create any number of block instances from a block type.
For the SIMATIC S7 CPUs, the block types are created, edited, and compiled in the Ladder Logic editor (LAD), Statement List (STL) editor
or Structured Control Language (SCL) editor.
For PCS 7 projects, function blocks are created in the SCL or by compiling charts as blocks.
Block types of a project are located in the Blocks folder as shown in Picture.
Blocks folder also contains other blocks, e.g. system function blocks (SFB), data blocks (DB), and organization یblocks (OB)
The block types of Blocks folder are also shown in the CFC library catalogue so that they can be accessed in the CFC editor. In Picture
Above, block type of the S7 program,Prog1, are shown.
Block types are obtained from three sources, which are from the system libraries, from user-designed libraries, or created in the project. The
three sources of block types are shown in Picture.
Block types are also stored in the CFC Chart folder. The CFC Chart folder contains blocks indicated by the blue boxes as shown in Picture.
شرکت پتروفن – بندر امام SIMATIC PCS7 Training صادق اکبری: مدرس
96 پاییز-آب نیرو CFC Language Tel. 09123182734
Block types are identified by their numbers and symbolic names while symbolic names are optional.
When the system blocks are used, their symbolic names are automatically entered in the Symbols table.
The name of the block is usually entered in the Symbols table or Symbols editor. In Picture, a block type, FB73, has a symbolic name
VALVE, which is defined in the Symbols table .
Block types
The block type determines the characteristics (algorithm) for all implementations of this type.
A block type represents a template for any number of instances and describes how these instances are structured internally.
All instances of a block type obey the same basic definition as regards their characteristics and their data structure.
Block Instances
A block instance is a concrete object generated according to its type (blocks) description.
The type describes the characteristics and information structure for the instance while the current state of each instance
depends on its actually executed operations and is reflected in the information contents.
Each instance has a unique identifier that enables instances to be distinguished from one another.
شرکت پتروفن – بندر امام SIMATIC PCS7 Training صادق اکبری: مدرس
96 پاییز-آب نیرو CFC Language Tel. 09123182734
تلفیق بالکها در برنامه ()Integrating Blocks
وقتی چارت CFCباز میشود .پنجره Catalogرا در صورتیکه فعال نباشد .از مسیر زیر فعال کنید.
– View Catalog
برای استفاده از یک بالک در برنامه ،بالک مورد نظر را در بین کتابخانههای موجود جستجو و از تکنیک Dragروی بالک و
Dropبالک بر روی چارت استفاده کرده و بالک را روی چارت قرار دهید.
وقتی یک تایپ بالک ( )Block Typeرا برای اولین بار در چارت قرار میدهید .دادههای این بالک در پوشه ،Blocksپوشه Chartو
جدول سیمبلها وارد میشود .درج دادهها در این پوشهها به صورت مخفی صورت میگیرد
(.)Import
بالک قرار داده شده درچارت ،به منظور فراخوانی و اجرا توسط ،CPUدر داخل یک OBادغام میشود .به این معنی که این
بالک در زمان اجرا در آن OBفراخوانی میشود.
از قبل در زمان طراحی کتابخانه ،هر یک از بالکهای کتابخانههای PCS7برای نصب در یک OBخاص ،تنظیم شده است .به
این معنی که برای هر بالک ،یک OBتنظیم شده است .که موقع قرار دادن در چارت ،در ابتدا در
داخل همان ،OBادغام میشود .به طوریکه از پنجره Run Sequenceمیتوان OBپیش تنظیم را عوض
کرد.
شرکت پتروفن – بندر امام SIMATIC PCS7 Training مدرس :صادق اکبری
آب نیرو -پاییز 96 CFC Language Tel. 09123182734
Blocks
یک اصل پایه در مهندسی میگوید که چرخ را نباید دوباره اختراع کرد .کتابخانههای بالکهای از پیشساخته حاوی راهحلهایی هستند که میتوان
استفاده مجدد کرد .مستندات بالک (که به صورت آنالین با فشردن کلید F1روی بالک باز میشود) دادههایی که در
بخش ورودی بالک به منظور حصول نتایج در بخش خروجی بالک ،بایستی فراهم شوند را توصیف میکنند.
)Charts (Templates
راهحلهای کنترلی از پیبش تعریف شده هستند که تنها الزم است با مشخصات فرآیند تطبیق داده شوند.
به این معنی که برای اجزای فرآیند مانند موتور یک چارت کنترل به صورت generalایجادشده که فقط بایستی پارامترهای
بالکها را با پارامترهای فرآیند تطبیق داد.
Import
عمل : Importاز آنجایی که بالکهای موجود در کتابخانهها به صورت Typeهستند ،قبل از استفاده از آنها بایستی به پوشه Import ،Blocksشده و سپس
برای پیادهسازی برنامه در چارتهای ،CFCورودی و خروجیهای آنها به بالکهای دیگر متصل شوند.
Inserting in Chart
قرار دادن در چارت ( ) Inserting In Chartبالکها را میتوان از طریق ،Drag & Dropدر چارت قرار داد .برای این کار بالک را در لیست بالکهای کتابخانه
مربوطه انتخاب ،و آن را در پنجره کدنویسی چارت قرار میدهیم (در یکی از شیت 1تا ) 6
Block Header
هدر بالک حاوی اطالعاتی است که میتوان بالک را شناخت.
Set Parameters
برای تغییر پارامترهای بالک ،بالک را انتخاب و با دابل کلیک یا راست کلیک ،پنجره Object Propertiesرا باز میکنیم
Connect
اگر قرار است نتایج حاصل از یک بالک توسط بالک دیگر پردازش بیشتری شود .خروجی این بالک به ورودی بالکی که این مقدار را پردازش میکند
متصل میگردد (برای این کار ابتدا در خروجی بالک کلیک و سپس در ورودی بالک دوم کلیک نمایید و یا به روش
Drag & Dropاین کار را انجام دهید یعنی پایه خروجی بالک را انتخاب ( ) Dragو بر روی ورودی بالک Dropکنید.
Sheet Bars
همچنین میتوان بین بالکهایی که در یک Sheetقرار ندارند ،از طریق باز کردن یک پنجره جدید در CFCاتصاالت برقرار کرد .به طوری که دو تا شیت
در دو پنجره مختلف نمایش داده میشوند و اتصاالت بین پایههای بالک به همان صورت معمول صورت میگیرد.
شرکت پتروفن – بندر امام SIMATIC PCS7 Training مدرس :صادق اکبری
آب نیرو -پاییز 96 CFC Language Tel. 09123182734
. که در گوشه سمت چپ بالک قرار میگیرد. یک شماره برای نام آن تخصیص داده میشودCFC با قرار دادن بالک در محیط
آن نمایان میشود که بهتر است یک اسم با معنی مرتبط با فرآیند برای بالک درProperties با دابل کلیک بر روی بالک پنجره
. وارد شودName قسمت
CFC Objects :The most important CFC terms are outlined here.
شرکت پتروفن – بندر امام SIMATIC PCS7 Training صادق اکبری: مدرس
96 پاییز-آب نیرو CFC Language Tel. 09123182734
Block IO
Each block has a number of different I/Os that are displayed in a table of the properties dialog.
To find the I/Os quickly in this dialog, you can click in the column head of the table and sort the column in ascending or
descending order.
The I/Os of a block can be both visible or invisible: You can only see visible parameters in the properties of the block but
not in the representation in the CFC chart.
You can specify which I/Os in the CFC chart will be visible and which will be invisible. You specify this in the properties
of the block in the “Invisible“ column by unchecking the check box of the relevant I/O to make the I/O visible in the CFC
chart. This function helps to make a CFC chart easier to read.
شرکت پتروفن – بندر امام SIMATIC PCS7 Training صادق اکبری: مدرس
96 پاییز-آب نیرو CFC Language Tel. 09123182734
شرکت پتروفن – بندر امام SIMATIC PCS7 Training مدرس :صادق اکبری
آب نیرو -پاییز 96 CFC Language Tel. 09123182734
make the required interconnections in the charts between outputs and inputs.
You can create the interconnections of blocks conveniently by :
clicking on the graphic user interface of the CFC editor with the mouse.
Click first the output of a block and then the input you want to connect to it. After clicking on the input, the interconnection
is displayed as a line.
The CFC Editor automatically draws lines in the best position.
The position of the lines has no effect on the function of the interconnection.
Note
If you make an incorrect interconnection:
Right-click on the line of the incorrectly interconnection and select the menu command Edit > Delete.
شرکت پتروفن – بندر امام SIMATIC PCS7 Training صادق اکبری: مدرس
96 پاییز-آب نیرو CFC Language Tel. 09123182734
Textual interconnection is a virtual connection arising when a partner chart is moved to another S7 program or when it is created deliberately.
Textual interconnection is indicated by a yellow triangle as shown in Picture 2.25.
شرکت پتروفن – بندر امام SIMATIC PCS7 Training مدرس :صادق اکبری
آب نیرو -پاییز 96 CFC Language Tel. 09123182734
If the connected partner is moved back or a purposely-created textual interconnection is fulfilled, the textual interconnection will be closed by
using the Close or “Make Textual Interconnection” function and the yellow triangle disappeared. See Picture
The “Make Textual Interconnections” function can also be performed when compiling program.
Note:
Copying or moving charts in the Plant view within a CPU will retain all the interconnections between charts while adapt the interconnections
automatically to new paths.
When copying or moving a plant hierarchical folder containing chart(s) and picture(s), interconnections between the charts and between
blocks and their graphic objects (icons) are retained and adapted.
Therefore, textual interconnections will not occur in the two cases above.
شرکت پتروفن – بندر امام SIMATIC PCS7 Training صادق اکبری: مدرس
96 پاییز-آب نیرو CFC Language Tel. 09123182734
Exercise
برای. ایجاد و در داخل آن بالکهای باال را درج کنیدtest یک چارت بنامPlant View در: تمرین
- اجرا میOB32 هر دو بالک در.را به عنوان سطوح فرآیندی ایجاد کنیدReactorsi/Testi این کار پوشه
. میباشدADD4_P و دومین بالک یک جمعکننده چهارتاییPT1_P اولین بالک تایپ.شود
------------------------------------------------------------------------------------------------
Steps 1. Call the project in plant view. Create folder.
2. Insert new CFC chart in the corresponding hierarchy container.
3. Define predecessor for installation.
4. Enter blocks from the library into the chart and name them.
5. Set parameters for blocks on the sheet and interconnect them.
6. Compile, download and test program.
------------------------------------------------------------------------------------------------
Procedure In the block names, "i" stands for your group number.
Add PH 1.Select the plant hierarchy view in the SIMATIC Manager via menu command
View Plant View
Select the "REACTORSi" folder in the project PRO_ASi. Then
right-click and select New Object... Hierarchy Folder
to insert a new folder. Rename the folder "TESTi"
Create a chart 2.Select the "TESTi" folder,
right-click and select New Object... CFC
to insert a chart. Name your chart "ATTEMPTi"
Open Chart Select the "ATTEMPTi" chart. To open the chart,
right-click and select Open Object (or double-click)
شرکت پتروفن – بندر امام SIMATIC PCS7 Training صادق اکبری: مدرس
96 پاییز-آب نیرو CFC Language Tel. 09123182734
Settings for
compile 5. Charts must be converted from the graphic form to machine language and downloaded to the AS.
To initiate the conversion from a CFC chart, select
Chart Compile Charts as Program
(or click the circled C Compile icon).
The entire software is compiled for the CPU which is associated with this CFC chart.
A dialog box is displayed for the compilation settings (see slide).
Only "Entire Program" is possible under "Scope" the first time you compile. You can select "Changes only" for any subsequent compilations (after
changes/additions).
Important Option
"Generate module drivers" (only meaningful if there is a minimum of one channel driver in the chart). This
results in the CFC creating additional charts with the required drivers for data transfer with the I/O modules
and diagnostics capability.
A chart "@CPU_RT" is created in addition. The "CPU_RT" block inserted there monitors the CPU
performance in order to avoid a CPU stop (for details on the block functions, please refer to its online help)
Downloading:
The compiled charts must now be downloaded to the CPU. Activate the following menu command to start this
process:
PLC Download
or click on the Download icon (circled on the slide).
The first time the chart is downloaded, it is only possible to download the entire program (in combination with
CPU Stop and automatic deletion of the program still residing in the CPU).
شرکت پتروفن – بندر امام SIMATIC PCS7 Training صادق اکبری: مدرس
96 پاییز-آب نیرو CFC Language Tel. 09123182734
Testing in CFC
To test your program, follow the menu path: Debug > Test Mode. You can monitor I/O values by adding them into Watch List. Then, the
values are highlighted in yellow.
Right click on an I/O and then “add I/O to Watch List.
To change a value online, double click an input, e.g. AUTO_OC. The I/O Properties dialog will open and you can set a new value for the
variable. See Picture.
Note
To operate the valve in the CFC Test Mode you set and reset AUTO_OC.
To be able to operate the valve, you need to enable the use of AUTO_OC by setting LIOP_SEL and AUT_L both to be “True”.
The library function VALVE is explained in details in Next Chapter
شرکت پتروفن – بندر امام SIMATIC PCS7 Training صادق اکبری: مدرس
96 پاییز-آب نیرو CFC Language Tel. 09123182734
There are two Test Modes namely:
Process Mode and Laboratory Mode.
You can choose one of them before testing. To switch between the two modes, follow the menu path:
– Debug > Process Mode (or Laboratory Mode).
In process mode, communication for the online dynamic update of blocks is restricted and thus causes moderate load on the CP and bus.
When the test mode is activated, all blocks are assigned the "watch off" attribute.
The laboratory mode allows convenient and efficient testing and commissioning. In contrast to process mode, the laboratory mode does not
restrict communication for online dynamic update of blocks. So, use the laboratory mode with caution.
When the test mode is activated, all blocks are assigned the "watch on" attribute.
شرکت پتروفن – بندر امام SIMATIC PCS7 Training صادق اکبری: مدرس
96 پاییز-آب نیرو CFC Language Tel. 09123182734
برای پیکربندی یک چارت CFCمراحل زیر صورت می گیرد:
ایجاد یک چارت CFCدر یک سطح فرآیندی در محیط Plant View
باز کردن چارت CFC
کپی فانکشن بالکهای موردنظر به کتابخانه MDLپروژه (اختیاری)
درج یا قرار دادن فانکشن بالکهای موردنظر در محیط ویرایشگر )Insert blocks( CFC
تنظیم پارامترهای بالک
– تغيرنام پیش فرض به نام های مناسب
– تنظیم مقادیر ورودی /خروجی
ترسیم اتصال بین بالکهای داخل شیتهای چارت و یا بین چارتهای CFC
دانلود برنامه کامپایل شده به CPU
تست و دیباگ نمودن برنامه دانلود شده
نکته
درصورتنیازبهبهاطالعاتبیشتردرموردبالکها،بهعنوانمثالاینکهبالکتابعموردنظرچه
ورودی/خروجیهاییدارد،بالکمربوطهدرکتابخانهراانتخابکنیدوسپسکلید F1رافشاردهید.اینکار
راهنمایکاربریرابرایاینبالکبازخواهدکرد.
شرکت پتروفن – بندر امام SIMATIC PCS7 Training مدرس :صادق اکبری
آب نیرو -پاییز 96 CFC Language Tel. 09123182734
With Memory Reset
Object ها و Tagها دز WINCCپاک شده و از نو ساخته می شود.
با کامپایل OSدیتا از سیستم ASدر ESبه OSمنتقل می گردد.
در صورت ظاهر شدن پیام خطا در شروع کامپایل به معنی کامپایل نشدن یک یا چند CFCمی باشد.
شرکت پتروفن – بندر امام SIMATIC PCS7 Training مدرس :صادق اکبری
آب نیرو -پاییز 96 CFC Language Tel. 09123182734
With Memory Reset
Object ها و Tagها دز WINCCپاک شده و از نو ساخته می شود.
با کامپایل OSدیتا از سیستم ASدر ESبه OSمنتقل می گردد.
در صورت ظاهر شدن پیام خطا در شروع کامپایل به معنی کامپایل نشدن یک یا چند CFCمی باشد.
شرکت پتروفن – بندر امام SIMATIC PCS7 Training مدرس :صادق اکبری
آب نیرو -پاییز 96 CFC Language Tel. 09123182734
میتوان بالکهای استفاده شده را بروزآوری کرده و،در صورتی که تایپ فانکشنبالکهای استفاده شده در چارت تغییر یابد
.با تایپ جدید جایگزین نمود
. انجام میگیردCFC Chart کردن تایپ جدید به پوشهimport این کار با
. مقایسه صورت میگیردCharts که تایپ جدید وجود دارد و پوشهBlocks بین بالکهای موجود در پوشه
Central type changes mean that all instances of a block type already included in CFC charts are automatically updated if the block type is
changed. For example, a user block is modified later after its instances have been used in CFC charts. You can
update all the instances by importing the new type to the CFC Chart Folder.
The function, “Importing block type”, can be found following the menu path: Options > Block Types. See Picture
Alternatively, you can use the New Version function to update block types used in a project. See Picture.
The Block Types dialog is where block types are compared between the Blocks folder and the CFC Chart folder. Block types in these two
folders have to be the same.
The function of the central type change is useful and powerful. If the PCS 7 library blocks have been changed by Siemens due to a newer
release of the system. You have to decide if the newer version of the blocks is to be used in your project.
شرکت پتروفن – بندر امام SIMATIC PCS7 Training صادق اکبری: مدرس
96 پاییز-آب نیرو CFC Language Tel. 09123182734
If block instances are deleted from a chart or deleted because of deleting charts, their types will not be deleted either from the CFC Chart
folder or from the Blocks folder though the block types are not used in the project.
Block types that are not used in a project can be removed from the project by using the Clean up function as shown in Picture
Using the function, you will be asked if block type is to be removed from the CFC Chart folder (Steps 2 and 3 in Picture) and Blocks folder
(Steps 3 and 4 in Picture 6.10) respectively.
Note
The library blocks, e.g. SFB36 as in Picture, could be removed as they are contained in the firmware of AS.
شرکت پتروفن – بندر امام SIMATIC PCS7 Training صادق اکبری: مدرس
96 پاییز-آب نیرو CFC Language Tel. 09123182734
Locate Change To detect possible changes between e.g.
already instantiated blocks in the project and
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).
شرکت پتروفن – بندر امام SIMATIC PCS7 Training صادق اکبری: مدرس
96 پاییز-آب نیرو CFC Language Tel. 09123182734
Functions could call other functions.
The called functions are sub-functions and are block types them. For example, a closed loop control block calls a signaling block and a
controlling block.
When copying a multi-instance block to a project (to the Blocks folder) all sub-blocks have to be copied into the block folder as well.
Note
Called SFBs and SFCs, such as SFC6 (RD_SINFO) or SFB0 (CTU) are located firstly in the PCS 7 libraries and copied into your S7 program
when you compile the calling block.
Called FBs are copied to the block folder when you insert the calling block in a CFC chart if they are located in the same library as the calling
block. Otherwise, the called blocks have to be copied into the S7 program Blocks folder manually.
شرکت پتروفن – بندر امام SIMATIC PCS7 Training صادق اکبری: مدرس
96 پاییز-آب نیرو CFC Language Tel. 09123182734
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.
شرکت پتروفن – بندر امام SIMATIC PCS7 Training صادق اکبری: مدرس
96 پاییز-آب نیرو CFC Language Tel. 09123182734
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 program sections can be executed at certain times and in certain situations.
There are OBs for CPU startup, for process interrupts, and for cyclic interrupts (with different time bases) etc.
For example, OB32 has cyclic interrupts every 1 second. Function blocks inserted in OB32 are called every second.
When a block is inserted in a chart, by default it is automatically installed in OB35. The cycle time of OB35 is 0.1 seconds.
OBs cannot be inserted nor edited in CFC. In CFC, the OBs are displayed in the Runtime editor.
OBs with different time cycles are set in the HW Config as illustrated in Picture.
Note
The default cycles are set as in Picture. It is recommended not to change the default settings.
شرکت پتروفن – بندر امام SIMATIC PCS7 Training صادق اکبری: مدرس
96 پاییز-آب نیرو CFC Language Tel. 09123182734
مشخصههایی چون Run Sequenceو ،Runtime groupبرای پاسخ CPUبرحسب زمان واکنش ،زمان مرده ،یا ثبات ساختارهای
وابسته به زمان ،به عنوان مثال کنترل حلقه بسته.تعیین کننده میباشد.
برای باز کردن پنجره Runtime Sequenceبه دور روش میتوان عمل کرد:
از طریق دگمه Runtime Sequenceدر Tool bar
راست کلیک بر روی بالک و اتخاب گزینه Go to Insert Point
قابلیتهای پنجره Runtime Sequence
تغییر OBاختصاص داده شده به بالک
انتقال یک مجموعه Runtime Groupیا یک بالک خاص از زیر مجموعه یک OBبه زیرمجموعه OBدیگر.
امکان dragکل یک چارت و dropآن به درون یک OBدیگر
نکته :در پنجره Runtime Sequenceفهرست تمامی OBها حتی در صورت عدم وجود OBموردنظر در CPUمشاهده میشود.
شرکت پتروفن – بندر امام SIMATIC PCS7 Training مدرس :صادق اکبری
آب نیرو -پاییز 96 CFC Language Tel. 09123182734
When a block inserted into a CFC chart, a block is installed in a runtime group in default OB.
It is important to re-locate the runtime group into an appropriate OB.
A runtime group is created when you insert a CFC chart.
When a block is placed on an empty CFC chart, the block is installed inside the group. Subsequently dragged-and-dropped blocks on the chart
are arranged in the group and the order in which they are placed.
پردازشبالک
.( استCyclic Interrupt OBs-100ms) OB35 درPCS7 محلپردازشپیشفرضبالکهای
. قابلاجراهستCyclic Interrupt OBs فقطدرPCS7 بیشتربالکهایکتابخانه
موردنظرOB برایHWConfig درصورتیکهحجماجرایبرنامهبهصورتیباشدکهاجرایآنبیشاززمانتنظیمشدهدر
.وجودنداردOB1 بامشکلمواجهخواهدشدکهاینمشکلدرCPU .باشد
شمارهیاترتیباختصاصRuntime SequenceوشمارهOB درزیرمجموعهCFC شمارهمربوطبهچارتRuntime Group شماره
.دادهشدهبرایپردازشبالکدردرونچارتمیباشد
هاراOB انتخابشدهتماماینCPUممکناست. لیستشدهاندS7هایتعریفشدهدرOB تمامRuntime Groupدرفهرست
.پشتیبانینکند
. برنامهدچارفالتمیگرددCPU درOB درصورتعدموجود
. خواهدگرفت-/1 قرارگیرددراینصورتشمارهOB35 درزیرGroup اگربالکیبهصورتمستقیموبدون
شرکت پتروفن – بندر امام SIMATIC PCS7 Training صادق اکبری: مدرس
96 پاییز-آب نیرو CFC Language Tel. 09123182734
Run Sequence
بر روی آیکون Run Sequenceدر میله ابزار (که به صورت دایره قرمز رنگ نشان داده شده) کلیک کنید .یک پنجره باز میشود
که در آن تمام بالکهای OBمربوط به CPUفهرست شده است.
وقتی یک پروژه ایجاد میشود پیشفرض ( )Predecessorنصب بالکها در OBها بر روی OB35تنظیم شده است .به این معنی که
وقتی یک چارت ایجاد میشود .یک runtime groupبه صورت اتوماتیک در OB35به اسم همان
چارت ایجاد میشود .وقتی بالکها به چارت اضافه میشوند به صورت اتوماتیک در این Runtime
Groupگروهبندی میشوند.
Moving the Runtime Group
برای تغییر OBمربوط به یک ( Run Time Groupچارت )CFCسیمبل پوشه Run Time Groupایجاد شده برای چارت جدید (مثالَ
پوشه Testدر شکل باال) را با ماوس گرفته و به داخل یک OBدیگر ( )OB32بکشید که در داخل
CPUاین OBبا سیکل زمانی متفاوت اجرا میشود.
برای اینکه در زمان ایجاد چارتهای جدید ،چارتها در یک OBدیگری غیر از OB35نصب شوند بایستی یک پیشفرض
نصب دیگری ( )Predecessor for installationتعریف کرد.
شرکت پتروفن – بندر امام SIMATIC PCS7 Training مدرس :صادق اکبری
آب نیرو -پاییز 96 CFC Language Tel. 09123182734
The default sequence of blocks in an OB by no means represents the signal flow between the blocks. Generally, blocks should be executed in
a logic sequence which depends on signal flows. For example, blocks in Picture should be arranged in the
following order:
(1) Block FB_OPEN or FB_CLOSE
(2) Block VALVE
(3) Block OUT
To arrange blocks in a logic order, the function “Optimize Run Sequence” is used.
The menu path to call up the function and settings of the function is illustrated in Picture.
If “Optimize run sequence” is performed, the blocks of the group will be arranged according to the signal flow sequence between the blocks.
In debugging and testing, you can activate or de-activate the Optimize run sequence function by select or de-select the Active box (Step 3 of
Picture).
شرکت پتروفن – بندر امام SIMATIC PCS7 Training صادق اکبری: مدرس
96 پاییز-آب نیرو CFC Language Tel. 09123182734
Reduction ratio
The reduction ratio determines whether the CFC blocks/SFC charts of a runtime group are processed each time or only every nth time the task is
executed. "n" is an integer (n = 2t, where 0 <= t <= 15).
The cycle times are a multiple of the basic reduction ratio of the task.
Example:
Basic cycle of a cyclic interrupt (OB 33): 500 ms
Possible clock cycles with reduction ratio: 1 s, 2 s, 4 s, 8 s, 16 s, etc.
The default setting is 1 so the block/SFC chart is executed in every cycle (in OB 33 every 500 ms).
Phase offset allows a uniform distribution of load within the CPU. It must be considered in conjunction with "n", the reduction ratio. The blocks or
SFC charts of the runtime group are executed as often as specified by "n", offset by "m" units of the task cycle. "m" is an integer, where 0 <= m <=
(n-1).
Example:
Basic cycle of a cyclic interrupt: 500 ms
Reduction ratio: 16 (i.e., the block/SFC chart is processed at intervals of 8 s)
Phase offset: 3. The block/SFC chart is processed at intervals of 1.5 s, 9.5 s, 17.5 s, etc.
The default is 0; in other words, the block/SFC chart is executed without a phase offset.
"Optimize run sequence" option
You can select/deselect the check box in order to include or exclude a runtime group from run sequence optimization. If the runtime groups contains
F objects, the option is not enabled.
You will find more detailed information in: Optimizing the run sequence
"Active" option
You can select/deselect the check box in order to enable/disable the runtime group for processing, if it is not interconnected. An interconnection
always has priority.
In the detail window of the runtime editor in the column "Inactive", the mode of the runtime group is displayed. The name corresponds with that of
the runtime properties field of a block. This character "!" means that the relevant runtime group is inactive; this character "?" means that the runtime
group EN is interconnected or SFC access exists and therefore is not in static process mode (may be active or inactive).
Using the shortcut menu commands Switch on Runtime Group and Switch off Runtime Group, you can select or deselect the option for the selected
runtime group, without initiating the object properties.
شرکت پتروفن – بندر امام SIMATIC PCS7 Training صادق اکبری: مدرس
96 پاییز-آب نیرو CFC Language Tel. 09123182734
The Optimize run sequence option has to be set one by one for each runtime group. However, the option is set by default.
The Optimize run sequence function is executed by the menu path as illustrated in Picture.
The Optimizing run sequence function is relevant to all runtime groups rather than the blocks in an AS that have been activated for the
function. Therefore, the function could change a large number of blocks contained in different CFC charts and
has a global impact on the behavior of runtime performance of a S7 program.
شرکت پتروفن – بندر امام SIMATIC PCS7 Training صادق اکبری: مدرس
96 پاییز-آب نیرو CFC Language Tel. 09123182734
.
شرکت پتروفن – بندر امام SIMATIC PCS7 Training مدرس :صادق اکبری
آب نیرو -پاییز 96 CFC Language Tel. 09123182734
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کنترلیک
راانتخابمیکنیمInterconnection to Runtime Group کلیکوگزینهCFCرویخروجیبالکدریک
. راانتخابمیکنیمOB موردنظربکاررفتهدرآنCFC وOBسپسازلیستنمایشدادهشده
. اولظاهرمیشودCFCبااینکارپرچمقرمزرنگدربخشاتصاالتخروجی
. اولبستگیخواهدداشتCFC دومبهیکشدنخروجیموردنظردرCFC مربوطبهEnableبااینکار
. دومعالمتسوال؟ظاهرمیشودCFCبررویبالکهادر
شرکت پتروفن – بندر امام SIMATIC PCS7 Training صادق اکبری: مدرس
96 پاییز-آب نیرو CFC Language Tel. 09123182734
Interconnecting Runtime Group Statically
If you select a runtime group in the runtime sequence and open its properties, the Active option is set. This means that all blocks
from this group are taken into account for each OB pass.
If you deactivate this option, none of the blocks in the group are taken into account/processed.
In the associated CFC chart all blocks display a red exclamation mark in the rectangle showing the execution data. This indicates to
the configuring engineer that the block is not active!
Alternative Select the runtime group in the runtime sequence and execute the process using the context menu by
right-clicking and selecting Switch on (activate) Runtime Group or
right-clicking and selecting Switch off (Deactivate) runtime group
شرکت پتروفن – بندر امام SIMATIC PCS7 Training صادق اکبری: مدرس
96 پاییز-آب نیرو CFC Language Tel. 09123182734
یکفانکشنبالک بهدوصورتدر S7پیادهسازیمیشود:
نوشتن یک فانکشن بالک به زبان های پایه FBD-LAD-STLدر قالب FBیا FCو فراخوانی آن در محیط CFC
نوشتنیکبرنامهبهزبان SCLوکامپایلآندرقالب FBوفراخوانیآندرمحیطCFC
FC یا FBموردنظردرمحیط Component Viewساختهمیشود.
شمارهاختصاصدادهشدهبه FCفقطدررنجمجازامکانپذیراست.
شمارههایمجازبرایتولید FCتوسطکاربرازمنوی Optionsتنظیممیشود.
شمارهمجازاز 60تا 700برایکاربریاسایربرنامههایاماژولهایقابلنصبدر PCS7میباشد.
شرکت پتروفن – بندر امام SIMATIC PCS7 Training مدرس :صادق اکبری
آب نیرو -پاییز 96 CFC Language Tel. 09123182734
در داخل چارت CFCمیتوان ورودی/خروجی بالک ها را به I/Oهای تعریف شده برای چارت متصل کرد.
امکان اتصال پایههای بالکها برای برخی از بالکها مانند بالکهای Driverکه بایستی به کانال فیزیکی متصل گردد ،به Chart IO
وجود ندارد.
مراحل فراخوانی یک چارت CFCاز چارت CFCدیگر ( )Chart In Chartعبارتانداز:
فعال کردن پنجره Chart Input/outputاز منوی Viewویرایشگر CFC
تعریف پارامترهای ورودی و خروجی برای یک چارت CFC
اتصال متغییرهای تعریف شده به ورودی خروجی های بالکها در درون چارت
– راست کلیک بر روی پایه موردنظر و انتخاب گزینه Interconnect To Chart I/O
– ظاهر شدن پرچم سفید رنگ در بخش خاکستری رنگ
شرکت پتروفن – بندر امام SIMATIC PCS7 Training مدرس :صادق اکبری
آب نیرو -پاییز 96 CFC Language Tel. 09123182734
Chart in Chart Purpose of this technique: To design clear, well-structured charts.
Chart sections that are repeatedly used with the same structure can be combined to look like one chart with a predefined sheet bar -
and thus like a block with I/O.
Procedure 1. The lower-level chart is created and given interconnections (this can also be carried out in a (master data) library).
2. The previously created chart is inserted in the higher-level chart. There it its displayed like a block; its sheet bar (I/O) was
defined in step 1.
3. If the lower-level chart was created in a library and was dragged into the top chart, it will not be shown in the project's chart folder
(as you can only see the top chart there). The associated blocks are inserted in the runtime sequence. You can change their sequence
in there if required.
Alternative: If you obtain the "New chart" from the Catalog tab "Blocks" and place it as an empty chart in the CFC chart, then you can implement
a top-down approach - i.e. reverse the sequence in points 1 and 2 in the above described procedure:
1. In the higher-level chart, first place "only" empty charts as wildcards for specific functions; the function is documented first
"only" as name of the respective empty "black box". The result is a function overview chart consisting of the various individual
charts.
In the second step, the details are added to these individual charts as lower-level charts, i.e. "filled" with block functionality and
provided with chart interconnections.
3. Now you can interconnect the individual charts in the higher-level chart.
شرکت پتروفن – بندر امام SIMATIC PCS7 Training صادق اکبری: مدرس
96 پاییز-آب نیرو CFC Language Tel. 09123182734
the chart-in-chart technique is a function for efficient engineering.
This involves inserting one CFC chart into another. The inserted chart then becomes the hierarchical chart and the other the base chart.
This enables you to create a chart once and then use it as the basis for numerous other charts. This means, for example, you can create a
simulation chart for a valve and then insert this simulation chart as a hierarchical chart into the base chart for
the "valve" process tag.
Of course, you can open and edit the hierarchical chart from the base chart at any time.
Example:
As mentioned and shown in Picture, You could place a chart onto another chart. the chart, CFC_val, is placed onto CFC_2.
The chart nesting structure is displayed in the Blocks/charts catalogue as shown in Picture where Chart CFC_2 contains CFC_val.
Picture also shows how to open the original chart (Step 3).
شرکت پتروفن – بندر امام SIMATIC PCS7 Training صادق اکبری: مدرس
96 پاییز-آب نیرو CFC Language Tel. 09123182734
شرکت پتروفن – بندر امام SIMATIC PCS7 Training مدرس :صادق اکبری
آب نیرو -پاییز 96 CFC Language Tel. 09123182734
شرکت پتروفن – بندر امام SIMATIC PCS7 Training مدرس :صادق اکبری
آب نیرو -پاییز 96 CFC Language Tel. 09123182734
Compiling CFC chart as block type (Chart-in-Block)
You can compile a chart as a block. Block instances in the chart become subsections of the chart block. A chart block is then a block type.
Note
To make a chart out of a block, the blocks in the chart must not be installed in a runtime group and they should not have interconnections to
other charts.
شرکت پتروفن – بندر امام SIMATIC PCS7 Training صادق اکبری: مدرس
96 پاییز-آب نیرو CFC Language Tel. 09123182734
پس از تعریف I/Oبرای یک چارت ،میتوان چارت را به عنوان یک بلوک کامپایل کرد.
لذا برای استفاده از بالک در چارتها نیاز است که برای IOهای چارت که پارامترهای بالک حاصل از کامپایل خواهد بود،
کنیم. تعریف ()attributes ویژگیهایی SCL همانند
تصویر نشان میدهد که چگونه برای باز کردن خواص متغیر محاوره ارائه شده است که یک نمودار
I / Oتعریف را مشخص ویژگی های سیستم برای یک متغیر وجود دارد.
پنجره تعریف ویژگی برای پارامترهای انتخاب شده ،در تصویر باال نشان داده شده است.
شرکت پتروفن – بندر امام SIMATIC PCS7 Training مدرس :صادق اکبری
آب نیرو -پاییز 96 CFC Language Tel. 09123182734
For analog variables, engineering units are provided at block instances. See Picture.
You can edit and add units in the file and they become available system-wide. When upgrading the PCS 7 system installation, you should
remember to back up the files.
شرکت پتروفن – بندر امام SIMATIC PCS7 Training صادق اکبری: مدرس
96 پاییز-آب نیرو CFC Language Tel. 09123182734
In the Test Mode of the CFC, you can test and debug your program.
The CFC test mode is convenient for testing one CFC sheet.
To monitor and manipulate variables from different charts and/or from different CPUs, you could use the Dynamic Display function.
شرکت پتروفن – بندر امام SIMATIC PCS7 Training صادق اکبری: مدرس
96 پاییز-آب نیرو CFC Language Tel. 09123182734
Test Mode You must activate "test mode" to test the function downloaded to the AS.
First activate
Debug Process Mode Or
Debug Laboratory Mode
to select/check the appropriate test environment.
Use the following command to activate/deactivate test mode:
Debug Test Mode
With laboratory operation, monitoring is automatically activated for the parameters specified "for test". During process operation,
you must select the required block each time and identify it for monitoring by
right-click and selecting Watch On
Test 1 If the test mode is active and the parameters to be tested have a yellow background (default setting for updated values), youcan set
parameters for the input parameter. The new value is written to the AS and to the project.
Change the value on the "First" block, "U" input. Monitor the result on the "Second" block, "V" output.
Test 2 Dynamic Display offers an additional test procedure. You can open a display window in CFC:
View Dynamic Display
Use "drag and drop" in this window to drag the block parameters you want to monitor (from any of the projects- even from different
CPUs). One line in the table is reserved for each parameter.
Upon activation of test mode, you can monitor or edit (if permissible) these selected parameters.
You can delete several parameters you no longer need by selecting the relevant line, right-clicking and selecting Delete.
You can use the New , Rename or Delete buttons in the table window to create, rename or delete new dynamic displays.
شرکت پتروفن – بندر امام SIMATIC PCS7 Training صادق اکبری: مدرس
96 پاییز-آب نیرو CFC Language Tel. 09123182734
Additional exercise (option)
Try to recognize the consequences of an OB32 overload. Use the LOAD block from the KURSBS60 library for this purpose (see
slide). Supplement the CFC "Attempti" chart as suggested above.
-----------------------------------------------------------------------------------------------------
Procedure 1. LOAD block: Switch the load on using "ON"=1. Increase the OB32 load by increasing the parameter "CYCL".
2. INT block: With the parameters "TI"=1 and "U"=1, the block will increment the output "ACTUAL" each time OB32 is called. If
Test Test settings Monitoring cycle = 1 second
is set in the CFC, the value of the output will be incremented by 1 every second in test mode. This applies to normal operation.
Increase the CYCL input of the LOAD block, and observe the output "V" of the INT block.
Also check the diagnostics buffer of your CPU using the CFC menu
PLC Module information "Diagnostics buffer" tab
and the (OB1) cycle time in the tab with this name.
3. Connect the output "V" of the INT block to the input "U" of the MEAS_MON block.
In the latter, select "Long-term archiving" in the properties of the input "U" under "Archive".
4. Compile and download the AS
5. Compile the OS. The parameter "U" of the MEAS_MOS is created there in Tag Logging, in the "System archives" archive.
6. Activate the OS, and create an online trend for this variable. Carry out the same increase to the load in the AS, and check the
reaction on the OS.
شرکت پتروفن – بندر امام SIMATIC PCS7 Training صادق اکبری: مدرس
96 پاییز-آب نیرو CFC Language Tel. 09123182734
شرکت پتروفن – بندر امام SIMATIC PCS7 Training مدرس :صادق اکبری
آب نیرو -پاییز 96 CFC Language Tel. 09123182734
With Memory Reset
Object ها و Tagها در WINCCپاک شده و از نو ساخته میشود.
با کامپایل OSمتغییرها از سیستم ASدر ESبه OSمنتقل می گردد.
در صورت ظاهر شدن پیام خطا در شروع کامپایل به معنی کامپایل نشدن یک یا چند CFCمی باشد.
شرکت پتروفن – بندر امام SIMATIC PCS7 Training مدرس :صادق اکبری
آب نیرو -پاییز 96 CFC Language Tel. 09123182734
شرکت پتروفن – بندر امام SIMATIC PCS7 Training مدرس :صادق اکبری
آب نیرو -پاییز 96 CFC Language Tel. 09123182734
شرکت پتروفن – بندر امام SIMATIC PCS7 Training مدرس :صادق اکبری
آب نیرو -پاییز 96 CFC Language Tel. 09123182734
شرکت پتروفن – بندر امام SIMATIC PCS7 Training مدرس :صادق اکبری
آب نیرو -پاییز 96 CFC Language Tel. 09123182734