Sunteți pe pagina 1din 56

CFC

Continuous Function Chart


Overview

STEP7

Libraries

CFC

SCL

GRAPH

Common Project - Database

SIMATIC
S7
Siemens AG 2001. All rights reserved.

Date:
File:

16.8.01
CFC_1e.1

HiGraph

The CFC Configuration Tool

S7 SCL

S7 GRAPH

LAD

SIMATIC
S7
Siemens AG 2001. All rights reserved.

STEP7

CFC
DOCPRO

Date:
File:

16.8.01
CFC_1e.2

STL

S7 HiGraph

FBD

CFC in the STEP7 Environment

SIMATIC Manager
SCL

CFC

Libraries

STEP7

GRAPH

Common database

SIMATIC
S7
Siemens AG 2001. All rights reserved.

Date:
File:

16.8.01
CFC_1e.3

HiGraph

The Block Concept

SIMATIC
S7
Siemens AG 2001. All rights reserved.

Date:
File:

16.8.01
CFC_1e.4

Project Planning instead of Programming

1. Add blocks

6. Ready

SIMATIC
S7
Siemens AG 2001. All rights reserved.

2. Set parameters for


and connect blocks

5. Test
M7 only

Date:
File:

16.8.01
CFC_1e.5

3. Adapt run-time
properties

4. Compile /load

Customer Advantages
Saving engineering costs
Pre-defined blocks used
Development times shorter
High quality through error-free blocks

Expanding with additional libraries


Using your own blocks
Flexibility through scalability

Graphic configuration
Simple to use without knowledge of Internas
Development times shorter

User-friendly testing procedure


Supported during startup

Homogenous integration into SIMATIC STEP 7


Consistent data storage

SIMATIC
S7
Siemens AG 2001. All rights reserved.

Date:
File:

16.8.01
CFC_1e.6

Basic Principles of CFC

STEP7

Libraries

CFC

SCL

GRAPH

Joint project - database

SIMATIC
S7
Siemens AG 2001. All rights reserved.

Date:
File:

16.8.01
CFC_2e.1

HiGraph

CFC Installation
SW minimum requirements
Operating system
WINDOWS 95, 98, NT
WINDOWS 2000, Me (Basic and SCL V5.1 + SP1,2)
SIMATIC S7 basic package
STEP7 V5.x with authorization
Authorization for CFC

HW minimum requirements
Programming device (PG) or PC
Pentium processor
With more than 128 Mbyte RAM
CFC requires approximately 52 MByte hard disk space
and approximately 200 Mbyte for the swap file
MPI connection

SIMATIC
S7
Siemens AG 2001. All rights reserved.

Date:
File:

16.8.01
CFC_2e.2

Charts in the STEP7 Project

SIMATIC
S7
Siemens AG 2001. All rights reserved.

Date:
File:

16.8.01
CFC_2e.3

The CFC Editor

Chart partion

overview

Page 4

Double click changes


to sheet view

Page 5

Page 3

SIMATIC
S7
Siemens AG 2001. All rights reserved.

Page 6

Date:
File:

16.8.01
CFC_2e.4

Chart, Sheets and Sheet Bars


Zoom in or zoom
out the view.
Page number

Chart partition A - Z

Sheet bar

Sheet bar

SIMATIC
S7
Siemens AG 2001. All rights reserved.

Date:
File:

16.8.01
CFC_2e.5

The Block Catalog


Static text

Basic operations

The listed entries are supplemented automatically, if


additional blocks are inserted in the chart
(corresponds to the blocks family attribute).

S7 program
block containers

Blocks

SIMATIC
S7
Siemens AG 2001. All rights reserved.

Date:
File:

16.8.01
CFC_2e.6

The Block Libraries


CFC library with blocks sorted
by CPU type

Additionally installed libraries,


such as for SIMATIC PCS7 and
your own libraries

STEP 7 library

Libraries

SIMATIC
S7
Siemens AG 2001. All rights reserved.

Date:
File:

16.8.01
CFC_2e.7

Chart in Chart
CFC1 chart (higher-level chart)
Contains additional (lower-level) charts

This chart was inserted in the


CFC1 chart three times.

Current S7 program charts

SIMATIC
S7
Siemens AG 2001. All rights reserved.

Date:
File:

16.8.01
CFC_2e.8

Inserting Blocks

CTUD block family

Inserting with
drag & drop

SIMATIC
S7
Siemens AG 2001. All rights reserved.

Date:
File:

16.8.01
CFC_2e.9

Block Representations
Block header

Block name

Block type
Run properties

Comment

Block
body

Default input values


Input parameters
Output parameters

SIMATIC
S7
Siemens AG 2001. All rights reserved.

Date:
File:

16.8.01
CFC_2e.10

Block Representations (2)

SIMATIC
S7
Siemens AG 2001. All rights reserved.

Date:
File:

16.8.01
CFC_2e.11

Interconnecting Inputs/Outputs
Multiple connection

Inverted signal

SIMATIC
S7
Siemens AG 2001. All rights reserved.

Date:
File:

16.8.01
CFC_2e.12

Interconnecting to Global Operands

Selection from
symbol table

Operand input

SIMATIC
S7
Siemens AG 2001. All rights reserved.

Date:
File:

16.8.01
CFC_2e.13

Working with CFC

STEP7

Libraries

CFC

SCL

GRAPH

Common project - database

SIMATIC
S7
Siemens AG 2001. All rights reserved.

Date:
File:

16.8.01
CFC_3e.1

HiGraph

Block Object Properties

Number of the FB in the


block container

Instance DB of the FB

Installation in
other OBs
Block attributes

SIMATIC
S7
Siemens AG 2001. All rights reserved.

Date:
File:

16.8.01
CFC_3e.2

Block I/Os

Parameter
name

These connections are


logged on automatically
for testing.

Data type

Parameter type

Default value

Parameter not displayed


in CFC

SIMATIC
S7
Siemens AG 2001. All rights reserved.

Date:
File:

16.8.01
CFC_3e.3

Runtime Properties

SIMATIC
S7
Siemens AG 2001. All rights reserved.

Date:
File:

16.8.01
CFC_3e.4

The Run-Time Sequence

SIMATIC
S7
Siemens AG 2001. All rights reserved.

Date:
File:

16.8.01
CFC_3e.5

The Sheet Bars


The right sheet bar as the source of a signal
Destination is
Chart REACTOR(A),
Block Distance,
Input EN

The signal comes from


the Chart REACTOR(A),
Block Buffer_FB_for_B,
Output READY with the
commentary,
all values sorted.

Symbolic and
absolute address,
commentary
(from the symbol table)
The left sheet bar is the destination for a signal.

SIMATIC
S7
Siemens AG 2001. All rights reserved.

Date:
File:

16.8.01
CFC_3e.6

Signal Tracking

Sheet margin bar jump

SIMATIC
S7
Siemens AG 2001. All rights reserved.

Date:
File:

16.8.01
CFC_3e.7

Compilation Settings
DB numbers the CFC cannot use

FC numbers the CFC


cannot use

The CPU can do this.

SIMATIC
S7
Siemens AG 2001. All rights reserved.

Date:
File:

16.8.01
CFC_3e.8

Still available for CFC

Compiling Charts
Chart 1/C...

Chart 2/C...

Chart1/B

Chart 2/B

Chart 1/A

Chart 2/A

Chart 3/C...
Chart 3/B
Chart 3/A

One SCL source


@SCLFileFromCFC...

S7 code
OBs, FCs, FBs, and
DBs

SAMPLE_T is
automatically
adapted

SIMATIC
S7
Siemens AG 2001. All rights reserved.

Date:
File:

16.8.01
CFC_3e.9

Mixed Programming
Programmed in LAD,
FBD, STL, and SCL

OB1

Part of a CFC chart


Call FC78

Call FB9, DB7

FC78

FB9

CFC generates it.


FC 0
Call FC 0
FFB24
Call FB24, DB69

FC92

According to the
compiler message, this
must be expanded in
LAD, FBD, STL, or SCL!

SIMATIC
S7
Siemens AG 2001. All rights reserved.

Call FC92

Date:
File:

16.8.01
CFC_3e.10

Dont make
any changes
here!

Loading the Program onto the PLC

SIMATIC
S7
Siemens AG 2001. All rights reserved.

Date:
File:

16.8.01
CFC_3e.11

Testing and Starting Up

Monitor and
modifying variables

Dynamic display

SIMATIC
S7
Siemens AG 2001. All rights reserved.

Date:
File:

16.8.01
CFC_3e.12

Test mode

Testing and Starting Up

Test mode
on/off

SIMATIC
S7
Siemens AG 2001. All rights reserved.

Monitor
on

Monitor
off

Date:
File:

16.8.01
CFC_3e.13

Add to watch
list I/O

Remove from
watch list I/O

Testing and Starting Up

Connection logged on for monitoring

Connection not logged on

SIMATIC
S7
Siemens AG 2001. All rights reserved.

Date:
File:

16.8.01
CFC_3e.14

Reading Back
Chart

Block container
Compile

Load

3.) Insert value

SCL source code

1.) Change value

2.) Update changed value (monitored)

SIMATIC
S7
Siemens AG 2001. All rights reserved.

PLC

Date:
File:

16.8.01
CFC_3e.15

CFC

STEP7

SCL

Libraries

Additional CFC Functions

GRAPH

Common project - database

SIMATIC
S7
Siemens AG 2001. All rights reserved.

Date:
File:

16. 8.01
CFC_4e.1

HiGraph

The Run-Time Groups

Change to
the run
sequence

Run-time group

Properties of a
run-time group
Blocks in a
run-time group

SIMATIC
S7
Siemens AG 2001. All rights reserved.

Date:
File:

16. 8.01
CFC_4e.2

The Run-Time Groups

Task
cycle

19

11

t
Run time

Scan rate

Phase offset

Run-time group with scan rate = 8 and phase offset = 3

SIMATIC
S7
Siemens AG 2001. All rights reserved.

Date:
File:

16. 8.01
CFC_4e.3

Explicit Block Import

Explicit
import

Blocks in the block container

SIMATIC
S7
Siemens AG 2001. All rights reserved.

Blocks in the CFC database

Date:
File:

16. 8.01
CFC_4e.4

Deleting Blocks
Remove from the chart.
+
Remove from block
container offline.
Delete a
block
completely

+
Remove from the
symbol table.
+
Remove from
the CFC database.

SIMATIC
S7
Siemens AG 2001. All rights reserved.

Date:
File:

16. 8.01
CFC_4e.5

Copying Charts and Blocks

Charts
Programs

Block(s)
If you want to,
you can also
transfer
connections.
Page to page
Chart to chart
CPU to CPU
Project to project

SIMATIC
S7
Siemens AG 2001. All rights reserved.

CPU to CPU
Project to project

Date:
File:

16. 8.01
CFC_4e.6

Creating a Block (FB) from a Chart

Define inputs and outputs.

Several interconnected blocks


result in a new block.
New block in
the catalog

SIMATIC
S7
Siemens AG 2001. All rights reserved.

Date:
File:

16. 8.01
CFC_4e.7

Chart in Chart
CFC1 chart (higher-level chart)
contains additional (lower-level) charts

This chart was inserted three


times in the CFC1 chart.

Charts for the current S7 program

SIMATIC
S7
Siemens AG 2001. All rights reserved.

Date:
File:

16. 8.01
CFC_4e.8

Attributes

SIMATIC
S7
Siemens AG 2001. All rights reserved.

Date:
File:

16. 8.01
CFC_4e.9

Attributes (Examples)
System attributes for configuring instrumentation and control
S7_blockview
S7_m_c
S7_read_back
S7_tasklist

Display the block in a large or small format.


You can monitor and control the block from an operator control and process
monitoring device.
You can cancel the read back chart" selection for this block in CFC.
Except for cyclical organization blocks, the block is also inserted automatically
into other OBs (such as error or startup OBs).

System attributes for process diagnostics and message configuration


S7_alarm

Event-controlled communication blocks transmit messages.

System attributes for parameters


S7_dynamic
S7_link
S7_m_c
S7_sampletime
S7_server
S7_string_0
S7_string_1
S7_visible

SIMATIC
S7
Siemens AG 2001. All rights reserved.

Parameter in CFC automatically logged on for testing during testing


Parameter can not be interconnected in CFC
Parameter can be monitored and controlled
Parameter SAMPLE_T" contains the cycle time for the OB
Parameter is relevant for configuring messages
This parameter contains the message number.
Text for evaluating binary values is assigned to the parameter
(S7_string_0 for boolean 0)
Parameter is not displayed in CFC

Date:
File:

16. 8.01
CFC_4e.10

Documenting Charts

SIMATIC
S7
Siemens AG 2001. All rights reserved.

Date:
File:

16. 8.01
CFC_4e.11

Documenting Charts

Reference Data Editor

Run
Sequence

CrossReference
of
Operands

SIMATIC
S7
Siemens AG 2001. All rights reserved.

CrossReference
of
Run-Time
Groups

Date:
File:

16. 8.01
CFC_4e.12

CrossReference
of
Block
Types

S7Resource
Allocation

CFC

STEP7

SCL

Libraries

CFC Exercises

GRAPH

Common project - database

SIMATIC
S7
Siemens AG 2001. All rights reserved.

Date:
16.8.01
File No.: CFC_5e.1

HiGraph

Exercise 1: Calculating the Angle and Distance

c
a

The angle in degrees is calculated from:


= 57.296 * atan ( a / b )
Caution!
Integer division cuts off the decimal
places in the result. Therefore, use
real division.

Hypotenuse c is calculated from:


c = square root of (a2 + b2)

SIMATIC
S7
Siemens AG 2001. All rights reserved.

Date:
16.8.01
File No.: CFC_5e.2

Description of Exercises 2 and 3

c
a

Create the a and b random


values.
Save 10 values in the DB.
Calculate c (for all 10 values).
Calculate the areas.
Edge evaluation.
Use the run-time group.
Calculate the mean value of the
areas.

SIMATIC
S7
Siemens AG 2001. All rights reserved.

Date:
16.8.01
File No.: CFC_5e.3

Exercise 2: Calculate the Distance and Sort


Random
generator
for a

Cyclic buffer
for a

(FC)

(FB)

Buffer_a:ARRAY[1 to10] OF INT;

Calculate length
and

a
DB1

sort
b

Random
generator
for b

Cyclic buffer
for b
(FB)

DB2

(FC)

SIMATIC
S7
Siemens AG 2001. All rights reserved.

(FCs)

Date:
16.8.01
File No.: CFC_5e.4

Exercise 3: Additional Calculations

Trigger
identification

I0.0 or
M7.7

DB2

Enable

Run-time group

Calculating
areas

Areas

DB3
Mean

c
Calculating
the mean

SIMATIC
S7
Siemens AG 2001. All rights reserved.

Date:
16.8.01
File No.: CFC_5e.5

Exercise 4: Chart as an FB

Chart from Exercise 1

c
a

b
FB created from the chart

SIMATIC
S7
Siemens AG 2001. All rights reserved.

Date:
16.8.01
File No.: CFC_5e.6

Ex 5: Calculate the Angle and Length with a New FB


Generator
for a

Cyclic buffer
for a

Calculate length

and

DB1
b

Generator
for b

sort

Cyclic buffer
for b
DB2

SIMATIC
S7
Siemens AG 2001. All rights reserved.

Date:
16.8.01
File No.: CFC_5e.7

Exercise 6: Chart in Chart

Chart from Exercise 1

c
a

SIMATIC
S7
Siemens AG 2001. All rights reserved.

Date:
16.8.01
File No.: CFC_5e.8

Exercise 7: SAMPLE_T

Extended pulse
Mode 1
10 seconds

Latching ON delay
Mode 3
7 seconds

SIMATIC
S7
Siemens AG 2001. All rights reserved.

Date:
16.8.01
File No.: CFC_5e.9

Exercise 8: Reference Data

Reference Data Editor

Run
sequence

Crossreferences:

SIMATIC
S7
Siemens AG 2001. All rights reserved.

operands

Crossreferences:

Cross
references:

Run-time
groups

Block
types

Date:
16.8.01
File No.: CFC_5e.10

S7resource
assignment

S-ar putea să vă placă și