Working with CFC chart

 
What is CFC?
CFC (Continuous Function Chart) is an editor with a graphical user interface, an extension based on the STEP 7 software package. It is used to create the entire software structure of the CPU and uses per-configured blocks. The editor lets you insert blocks into function charts, assign block parameters and interconnect blocks. Interconnecting means that values can be transferred from one output to one or more inputs during communication between the blocks or other objects.

Operating principle
You work with graphic tools in the CFC editor: You drag-and-drop pre-configured blocks from the pool of blocks to your chart. The chart is a kind of "drawing board". You interconnect the block inputs and outputs via a mouse click. There is no need to consider details such as algorithms or the assignment of machine resources, in other words, you can fully concentrate on the technological aspects of your configuration. The runtime properties of blocks are assigned default settings you can adapt individually. Since individual blocks or groups of blocks can be copied or moved from chart to chart, you can save a considerable amount of time. Interconnections between the blocks are retained. After having created all functions, generate the executable machine code by means of mouse click, download the code to the target system and debug it using the CFC debugger functions provided for this purpose.

Target systems
CFC can be used to configure various target systems. Operations performed by the user when working with CFC are identical to a great extent. It is possible that parts of this Help are not valid for target systems that are different than SIMATIC. This affects the description of the STEP7 and PCS 7-specific blocks in particular. In this case, please read the Help for the superposed applications.
This section explains the procedures for configuring your S7 target system:

1. Creating the project structure
In the SIMATIC Manager, you need to create a chart folder for the CFC below the hierarchy level of the program folder. Create the specific CFC charts in the chart folder, either in the SIMATIC Manager or directly in the CFC editor. In PCS 7, you use the "New Project" wizard for these steps.

2. Creating blocks (optional)
CFC works with ready-made blocks. These can be blocks from libraries, other programs, or block types created by you. You can create block types in CFC by compiling the charts.

3. Inserting and importing blocks
Block types required for the project must be implemented and, in some cases, imported to the project according to the target system used. You insert blocks into the chart from the catalog using drag-and-drop or copy a block from another position to the S7 program block folder. Inserting a block in a chart creates a block instance with a name that is unique throughout the chart. You can create any number of block instances from each block type. When a block is inserted in a chart, the block type is imported to the CFC data management.

4. Assigning parameters and interconnecting the blocks
You can assign parameters to block I/Os and interconnect them. Targets of the interconnection are other blocks, nested charts or shared addresses. You can specify textual interconnections at block/chart inputs whose interconnection target is not yet in the chart folder. This interconnection remains open until the referenced target of the interconnection is available and the interconnection is made via a menu command.

5. Adapting the runtime properties
The runtime properties of a block determine how the block is included in the processing of the entire structure on the PLC. The properties are decisive for the response of the target system in terms of reaction times, dead times or the stability of time-dependent structures, for example, control loops. When it is inserted, each block is assigned default runtime properties. A block is inserted in a task at the position you specify. You can change the position at which the block is installed and other attributes later if necessary.

6. Compiling the CFC charts
When a program is compiled, all charts of the active CPU are converted to machine code. Different compilers are used, depending on the target system; the call is identical, however. If you compile as a block type, only the individual chart is compiled.

7. Downloading the CFC program
You can download the CFC program to the CPU after compilation.

8. Testing the CFC program
You can test the compiled and downloaded program. The scope and type of test functions differs depending on the target system. In the test mode, you are connected to the automation system online.

Interaction between CFC and SIMATIC Manager
The following should be observed when working with the SIMATIC Manager:
- You can only delete charts, chart folders and projects using the SIMATIC Manager if no chart in the particular chart folder or project is currently being edited in CFC.
- Projects that contain CFC charts may not be saved on diskettes, neither using the "New project" nor the "Save project as" functions.
- You should only generate chart reference data in the CFC. If you generate reference data in the SIMATIC Manager, you will no longer be able to download changes to this program online. Flow of configuration data The figure below shows the flow of configuration data in S7, starting at the creation of block types and going through to the point where the machine code is downloaded to the automation system.





Process objects (only relevant for CFC in PCS 7)
Process objects are all SFCs and all block instances that contain blocks which support reporting, operating and monitoring. These are the objects that are transferred to the OS and require licenses. Driver block are not used as PO. In the SIMATIC Manager, you can start a function that identifies all of the POs configured and booked in the Automation License Manager (ALM). The result is displayed in the "PCS 7 license information" dialog box. This allows you to check whether the existing "SIMATIC PCS 7 AS RT PO" license, or the license you intend to order, is adequate for your project and the number of POs you can still add to your project. These objects are only entered in the count if they can be downloaded to an AS. Block instances in S7 programs without hardware assignment (at the project level or in libraries) are not considered.

Show process object statistics
Procedure:
1. Selects the multiproject or the project.
2. Select the PCS 7 license information shortcut menu command.
3. In the left window of the dialog box, select the "Process objects (AS RT PO)" license. The "PCS 7 license information" dialog box opens. The right window shows the total of all process objects in the multiproject and the number of process objects in each individual project and station.

Count and Booking of the PO Licenses

The following scenarios are considered: 

First full download of a program
The loader determines that this program has never been downloaded. A PO info is created in the ES data management and assigned the CPU identification data along with the current number of POs. The current number of POs is booked in the ALM. This results in reducing the counter reading of licenses.

 Downloading changes to a program on the same CPU
After comparing the data of the PO info the loader determines that this program has already been downloaded to the same CPU. The current number of POs is determined and the difference made up between values of the last download procedure. The difference is booked in the ALM. This results in reducing or increasing the counter reading of licenses. The stored number of POs in the PO info is replaced with the current number.

Moving a program to a different CPU
After comparing the data of the PO info the loader determines that this program has already been downloaded to a different CPU. A message is output which indicates that the number of POs stored during the last download can no longer be booked back if this download procedure continues. Here you can terminate the download process and book back the used PO licenses. Use the Charts > Booking Back Process Objects for selected chart folder. Requirement: The existing CPU must be connected. The PO info is updated with the data from the CPU that is currently connected when you continue the download. The current number of POs is determined and entered likewise in the PO info. This number is booked in the ALM. This results in reducing the counter reading of licenses.

Shutting down a CPU
If you no longer wish to use a CPU then you can retrieve its used POs. Use the Charts > Booking Back Process Objects for selected chart folder. A comparison with the PO info is made to verify whether the same CPU that was used during the last download is connected. If this is not the case then a corresponding message appears informing that the PO licenses that were used during the last download cannot be booked back by deleting the program in the connected CPU. The process must be terminated here in order to repeat it after the "correct" CPU is connected. A security check is made to verify the pending deletion of the program after the correct CPU is connected. The program is deleted after confirmation is made. The number of stored PO licenses is booked back in the ALM. Thereafter the PO info is initialized, in other words, during the next download procedure the program appears as if it were newly created. The PO info remains unchanged if you were unable to book back the POs because the license was no longer available. You can book back the POs at a later time after the license is available again. This function is terminated after a corresponding message appears if no CPU is connected or the one that is connected is not accessible.

Multiple use of a program in several CPUs
If the same program is downloaded to several CPUs then the number on the PO counter for each downloaded CPU is reduced by the current number of POs. After comparing the data of the PO info the loader determines that this program has already been downloaded to a different CPU. A message is output which indicates that the number of POs stored during the last download can no longer be booked back if this download procedure continues. Here you can terminate the download process. Otherwise the PO info is updated with the data from the CPU that is currently connected. The current number of POs is determined and entered likewise in the PO info. This number is booked in the ALM. This results in reducing the counter reading of licenses.

Creating a Chart

Aim
Measurement of temperature


Create the block as follows:
1. Click . The catalog opens. The default setting is that the catalog is already open.
2. In the catalog click on the icon of the library tab; open the CFC Library. This is a collection of block libraries.
3. Select the "Libraries" tab and drag-and-drop the "OpAnIn01 block and OpAnOu from the "pcs7 AP_Lib\channel
4. Drag the block from the list and drop it to the top right of Sheet 1 in the chart.
5. Click on the icon in the toolbar or double-click on a free area in the vicinity of the two blocks. This switches to the sheet view. In the sheet view, you see the blocks as graphic objects with a head and multiple I/Os on the body. The I/Os (inputs left, outputs right) are shown as fields with the I/O name and with the data type in the "wide" view. With the menu command Options > Settings > Block/Sheet Bar Width..., you can set the block width to "Narrow" or "Wide" in

the dialog box. The "Narrow" default setting shows the blocks more narrow and without specifying the data type.

Interconnecting blocks
Interconnect the blocks as follows:

1. Click on the OUT output on the PCS7 AnIn block and then click on the PV_IN input on the PCS7 AnOu block.
2. Right click on the PV_in and create interconnection of Analog channel at which temperature sensor is connected. And add I/O find at out of AnOu block.
3. You can also set scaling ration of temperature in input block.

How to compile and download a chart.
Proceed as follows to compile and download the chart as a program:
1. Click on the icon in the toolbar of the CFC or select the menu command Chart > Compile > Chart as Program....
2. Set "Scope: Entire Program" in the dialog box. Click "OK". Compiling is triggered and the progress is shown in a dialog box.
3. Click "Close" in the final message with the S7 protocols. You can ignore any warnings it contains.
4. Click on the icon or select the menu command CPU > Download.... The program is downloaded to the CPU.
5. Select the type of download in the dialog box. "Entire program" is set by default here.
6. Click "Yes" in the safety prompt. The CPU is set to STOP before the download and any blocks in the CPU are deleted. The download procedure is displayed in another dialog box.
7. When the download is successfully completed, click "Yes" in the final message. The CPU restarts.

How to test the program
1. Click the or select the menu command Test > Test Mode.
2. Before switching to test mode, use the menu command Test > Laboratory Mode to set test mode from "Process mode" to "Laboratory mode". This automatically sets all block I/Os to "Watch".(i.e. check temperature online)

Note: No I/O is listed by default for monitoring in "Process mode". In this test mode, you need to select given blocks and list them for monitoring by clicking on the icon.

No comments:

Post a Comment