S7 Graph SFC Siemens
S7 Graph SFC Siemens
S7 Graph SFC Siemens
Preface, Contents
SIMATIC
S7 Graph V5.1 for S7-300/400
Programming Sequential
Control Systems
Product Overview
Creating a Project
Manual
S7 Graph FB Parameter
Assignment and Call
10
11
12
13
Configuration Instructions
14
Instance DB
15
Glossary, Index
Edition 05/2001
A5E00105265-01
Safety Guidelines
This manual contains notices intended to ensure personal safety, as well as to protect the products and
connected equipment against damage. These notices are highlighted by the symbols shown below and
graded according to severity by the following texts:
Danger
Warning
Caution
indicates that death, severe personal injury or substantial property damage will result if proper
precautions are not taken.
indicates that death, severe personal injury or substantial property damage can result if proper
precautions are not taken.
indicates that minor personal injury can result if proper precautions are not taken.
Caution
indicates that property damage can result if proper precautions are not taken.
Notice
draws your attention to particularly important information on the product, handling the product, or to a
particular part of the documentation.
Qualified Personnel
Only qualified personnel should be allowed to install and work on this equipment. Qualified persons are
defined as persons who are authorized to commission, to ground and to tag circuits, equipment, and
systems in accordance with established safety practices and standards.
Correct Usage
Note the following:
Warning
This device and its components may only be used for the applications described in the catalog or the
technical description, and only in connection with devices or components from other manufacturers
which have been approved or recommended by Siemens.
This product can only function correctly and safely if it is transported, stored, set up, and installed
correctly, and operated and maintained as recommended.
Trademarks
SIMATIC, SIMATIC HMI and SIMATIC NET are registered trademarks of SIEMENS AG.
Third parties using for their own purposes any other names in this document which refer to trademarks might
infringe upon the rights of the trademark owners.
Copyright Siemens AG 2001 All rights reserved
Disclaimer of Liability
Siemens AG
Bereich Automatisierungs- und Antriebstechnik
Geschaeftsgebiet Industrie-Automatisierungssysteme
Postfach 4848, D- 90327 Nuernberg
Siemens AG 2001
Technical data subject to change.
Siemens Aktiengesellschaft
6ES7 811-0CC04-8BA0
05.04.2001
Preface
Purpose of the Manual
This manual provides you with a complete overview of programming with
S7 Graph. It supports you during the installation and setting up of the software. It
includes explanations of how to create a program, the structure of user programs,
and the individual language elements.
The manual is intended for persons with the appropriate qualifications who are
involved in programming, configuration, commissioning, and service of
programmable logic controllers.
We recommend that you familiarize yourself with the example in Chapter 3
"Designing a Sequential Control System Based on the Example of a Drill". This will
help you to get to know S7 Graph quickly.
Required Experience
To understand the manual, you should have general experience of automation
engineering.
You should also be familiar with working on computers or PC-type machines (for
example programming devices with the Windows 95/98/2000 or NT operating
systems. Since S7 Graph uses the STEP 7 platform, you should also be familiar
with working with the standard software described in the "Programming with
STEP 7 V5.1" manual.
iii
05.04.2001
Preface
Purpose
Order Number
6ES7 811-0CC04-8BA0
Basics of STEP 7:
6ES7810-4CA05-8BA0
Converting from S5 to S7
STEP 7 reference:
LAD/FBD/STL manuals
for S7-300/400
iv
05.04.2001
Preface
The Help menu provides numerous menu commands: Contents opens the
contents of the S7 Graph help system. Introduction provides an overview of
programming with S7 Graph. Using Help provides detailed instructions on
working with the online help system.
A brief explanation of the buttons in the toolbar is also displayed if you position
the mouse pointer briefly over a button.
If you prefer to have a printout of the information in the online help system, you can
print individual topics, books or the entire help system.
Training Centers
Siemens offers a number of training courses to familiarize you with the SIMATIC
S7 automation system. Please contact your regional training center or our central
training center in D 90327 Nuremberg, Germany for details:
Telephone: +49 (911) 8953200.
http://www.ad.siemens.de/training
05.04.2001
Preface
vi
05.04.2001
Preface
Nuremberg
Johnson City
Singapore
Worldwide (Nuremberg)
Technical Support
Worldwide (Nuremberg)
Technical Support
(Free Contact)
Phone:
Fax:
E-mail:
GMT:
Fax:
E-mail:
GMT:
+1 423 461-2289
simatic.hotline@
sea.siemens.com
-5:00
+65 740-7000
+65 740-7001
simatic.hotline@
sae.siemens.com.sg
+8:00
German and English are spoken on all the SIMATIC hotlines, French, Italian and Spanish are also spoken on the
authorization hotline.
vii
05.04.2001
Preface
viii
The Knowledge Manager helps you find the documents you need.
Users and specialists from all over the world share information in the forum.
Your local customer service representative for Automation & Drives in our
customer service representative data bank.
Information on field service, repairs, spare parts and more under "Services".
05.04.2001
05.04.01
Contents
1
Product Overview
1.1
Authorization .....................................................................................................2-1
Installing the Authorization ................................................................................2-3
Upgrading the Authorization..............................................................................2-4
Uninstalling the Authorization............................................................................2-5
Rules for Handling Authorizations.....................................................................2-6
Installing S7 Graph............................................................................................2-8
Uninstalling S7 Graph .....................................................................................2-10
ix
05.04.2001
05.04.01
Contents
Creating a Project
5.1
5.2
5.3
5.4
5.5
Actions...............................................................................................................7-3
Standard Actions ...............................................................................................7-4
Event-Dependent Actions .................................................................................7-6
Counters, Timers, and Arithmetic in Actions.....................................................7-9
Conditions .......................................................................................................7-14
Ladder Logic Elements for Programming Conditions .....................................7-18
Logic Operations with Ladder Logic Elements................................................7-20
FBD Elements for Programming Conditions ...................................................7-22
S7 Graph Addresses in Conditions .................................................................7-25
Supervision Errors and Acknowledgment .......................................................7-26
Comment, Extended Name, Number, Name ..................................................7-28
Programming with Symbolic Addresses .........................................................7-29
Editing Variables .............................................................................................7-30
Sequencer - Principle........................................................................................6-2
Structures of a Sequencer ................................................................................6-3
Rules for the Structure of a Sequencer.............................................................6-4
Elements of a Sequencer..................................................................................6-5
Step-Transition Pair and Initial Step..................................................................6-5
Jump..................................................................................................................6-6
Alternative Branch .............................................................................................6-7
Simultaneous Branch ........................................................................................6-8
Branch Stop.......................................................................................................6-9
New Sequencer.................................................................................................6-9
Permanent Instructions ...................................................................................6-10
Block Comment...............................................................................................6-11
05.04.2001
05.04.01
Contents
10
11
12
13
14
Configuration Instructions
14.1
14.2
14.3
xi
05.04.2001
05.04.01
Contents
15
Instance DB
15.1
15.2
15.3
15.4
15.5
15.6
15.7
15.8
15.9
15.10
15.11
15.12
15.13
Glossary
Index
xii
05.04.2001
05.04.01
Product Overview
1-1
05.04.2001
05.04.01
Product Overview
A STEP 7 block (1) in which the S7 Graph FB (function block) is called. This
block can be an organization block (OB), a function (FC), or another FB.
An instance DB (3) that contains data and parameters of the sequential control
system. The instance DB is assigned to the S7 Graph FB and can be created
automatically by the system.
OB/FB/FC
(1)
FB i
(2)
(3)
Comments for...
FC70/71/72
CALL FBi,DBi
INIT_SQ:=
S1
T1
S2
T2
DB i
1-2
05.04.2001
05.04.01
Product Overview
Step1
S1
Step1
Action
Action
Motor
Limit switch
T1
Transition1
Conditions
Step2
S2
Step2
Input1
Action
Input2
Conditions
T2
Transition2
1-3
05.04.2001
05.04.01
Product Overview
1.1
Whats New?
Version 5.1 of the S7 Graph programming software has the following extended
functions and modifications compared with Version 5.0:
Compiler Expansions
1-4
05.04.2001
05.04.01
Product Overview
At the single step display level, one step and its successor transition are
displayed. Here, programming actions and conditions
Addresses used
If elements are not located next to each other, you can select them by
holding down the CTRL key and clicking the required elements one after
the other.
Once you have selected several elements, you can perform actions on all of
them together, for example moving them to a different location with the mouse.
You can now also delete branches of a sequencer as long as they are not
located exclusively in the right branch of a simultaneous or alternative branch.
You can now replace LAD or FBD elements in conditions in the overwrite
mode.
You can now close branches simply with the mouse: Hold down the mouse
button and move the mouse pointer to the location at which you want to close
the branch.
1-5
05.04.2001
05.04.01
Product Overview
1-6
05.04.2001
05.04.01
2.1
Authorization
A product authorization is required to use the S7 Graph software package.
Software protected by this mechanism can only be used when the authorization
required by the program or software package is detected on the hard disk of the
programming device.
Different authorizations are necessary, for example for STEP 7 and for the optional
packages.
Authorization Diskette
To authorize the product, you require the copy-protected authorization diskette
shipped with the package. This contains the actual authorization. The "AuthorsW"
program required to display, install, and uninstall the authorization is on the
installation CD-ROM that also contains S7 Graph.
Number of Authorizations
The number of possible authorizations depends on an authorization counter on the
authorization diskette. When you install an authorization, the counter is
decremented by 1. Once the counter reaches the value 0, there are no more
authorizations on the diskette.
Note
You receive a yellow authorization diskette for the STEP 7 standard software with
a corresponding authorization. You do not need an authorization for STEP 7 Mini.
With each optional software package, you receive a red authorization diskette
containing one authorization.
2-1
05.04.2001
05.04.01
Installation and Authorization
Caution
The restricted period of the emergency authorization begins from the moment you
install it, even if you do not start S7 Graph. You cannot extend this period even by
transferring the authorization back to the diskette.
Installing AuthorsW
The "AuthorsW" program required to display, install, and uninstall the authorization
is on the same CD-ROM as S7 Graph V5.0. You can install this program on your
hard disk and start it there when you want to install and uninstall authorizations.
Note
The default location for the AuthorsW program is the AuthorsW folder and you can
start it from the taskbar (START > SIMATIC > AuthorsW > AuthorsW).
2-2
05.04.2001
05.04.01
Installation and Authorization
2.2
Caution
The authorization is effective in Windows NT only when full access to both hard
disk "C:" and the source drive is possible.
2-3
05.04.2001
05.04.01
Installation and Authorization
2.3
2-4
05.04.2001
05.04.01
Installation and Authorization
2.4
2-5
05.04.2001
05.04.01
Installation and Authorization
2.5
Backup
If a backup of your hard disk contains copies of your authorizations, there is a risk
that the valid, installed authorizations will be overwritten and destroyed when you
write the backup data to the hard disk.
To avoid loss of the authorization by overwriting an authorized system with a
backup:
Defective Sectors
After installing an authorization, a special cluster is created on the hard disk that is
sometimes indicated as "defective". Do not attempt to repair this. Otherwise, you
will destroy the authorization.
2-6
05.04.2001
05.04.01
Installation and Authorization
Permitted Drives
The authorization can only be installed on a hard disk drive. If you have a
compressed drive (for example DBLSPACE), you can install on its host drive.
The authorization tool prevents installation on unsuitable drives.
Location
When you install an authorization, the files are transferred to the protected folder
"AX NF ZZ" with the attributes "system" and "hidden".
The folder must not be moved. Files copied from the folder (authorizations) are
detected as invalid authorizations and cannot be used.
If you do not keep to these rules, the authorization will be irretrievably lost.
The protected folder "AX NF ZZ" is created only once per drive. It contains all the
authorizations installed on the drive. It is created when you first install an
authorization and is deleted when you remove the last authorization from it.
For each authorization, two files with the same name but with different extensions
are created. These files are given the authorization name as the file name.
Number of Authorizations
You can install any number of authorizations on one drive providing there is
enough space; however, only one of each version (for example only one S7 Graph
V4.x and only one S7 Graph V5.x). These authorizations do not affect each other.
Defective Authorization
Defective authorizations on a hard disk can no longer be removed with the
AuthorsW authorization tool. They can even block the installation of new, valid
authorizations. In this case, contact your Siemens distributor or sales office.
2-7
05.04.2001
05.04.01
Installation and Authorization
Authorization Tool
Use the supplied or latest version of the AuthorsW authorization tool and where
possible avoid using older versions.
Caution
Since the supplied version does not recognize all older authorizations, you may
nevertheless need to use an older AUTHORS version (DOS version) < V3.x.
2.6
Installing S7 Graph
S7 Graph contains a Setup program that installs the package automatically.
Prompts on the screen guide you step by step through the entire installation. The
Setup program is started as usual when installing software in Windows.
The essential phases of installation are as follows:
SIMATIC STEP 7 standard package (for the required version, refer to the
Readme.wri file).
Disk space:
For the space required on your hard disk, refer to the "Readme".
2-8
05.04.2001
05.04.01
Installation and Authorization
Cancel the installation (you can then uninstall the old S7 Graph version under
Windows and then start the new installation again) or
Continue the installation and overwrite the old version with the new version.
Notes on Authorization
During the installation, the program checks whether an authorization already exists
on the hard disk. If no authorization is found, a message appears informing you
that the software can only be used with an authorization. You can either install the
authorization immediately or continue the installation and install the authorization
later. If you decide to install immediately, insert the authorization diskette when
prompted to.
2-9
05.04.2001
05.04.01
Installation and Authorization
Not enough space on the disk: You must have enough space on your hard disk
for the type of installation you have selected (see readme).
If you make a mistake: Start the installation again and follow the instructions
carefully.
2.7
Uninstalling S7 Graph
To uninstall the software, use the usual method under Windows:
1. Under Windows, open the dialog for installing/uninstalling programs by doubleclicking the "Add/Remove Programs" icon in the "Control Panel".
2. Select the STEP 7 entry in the list of installed programs. Click the
"Add/Remove" button to uninstall the program.
If the "Remove Released File" dialogs appear, click the "No" button if you are
unsure whether you want to remove the file or not.
Caution
This method does not uninstall the authorization. If you also want to uninstall the
authorization, follow the instructions in the section on Authorization.
2-10
05.04.2001
05.04.01
You first learn how to configure a sequential control system efficiently and will then
be guided step by step through the tasks you need to perform in the SIMATIC
Manager and in S7 Graph so that you can
test it.
3-1
05.04.2001
05.04.01
Designing a Sequential Control System Based on the Example of a Drill
Requirements
To allow you to program and test the "drill" example, you require the following
hardware and software:
yes
Symbolic
programming
Create symbol table
no
Create sequencer:
create and open S7 Graph FB1 in
3-2
05.04.2001
05.04.01
Designing a Sequential Control System Based on the Example of a Drill
3.1
Task
You want to program a sequential control system to automate a drill. The setup of
the drill is shown by a technological drawing and the process sequence in the form
of a function diagram.
Clamping device with feedback signal for selected clamp pressure reached
Carriage
Lower drill
Drill motor
Raise drill
Drill motor on
Feedback signal:
- Drill running
- Drill stopped
Limit switch:
Drill up
Cooling pump on
Feedback signal
Coolant pressure reached
Cooling pump
Limit switch:
Drill down
Clamp device
Feedback signal:
Selected clamping pressure
reached
Start button
Coolant switch
3-3
05.04.2001
05.04.01
Designing a Sequential Control System Based on the Example of a Drill
Initial State
The initial state of the drill is defined as follows:
Start the machine with the start button (drill motor starts up)
Remove work piece, turn off drill motor and cooling pump
Element
State
Start
Clamping On
deviceOff
Motor
Carriage
3-4
running
stopped
up
down
05.04.2001
05.04.01
Designing a Sequential Control System Based on the Example of a Drill
3.2
Dividing the Drilling Process into Individual Steps - Structure of the Sequencer
The drilling process is described by S7 Graph in the form of a sequencer. A
sequencer represents a sequence of single steps and conditions that control how
the process moves on to the next single step. To specify the structure of the
sequencer, follow the steps outlined below:
1. Break down the drilling process into steps and specify the order of the steps
(for example "step S2 follows S1" or "step S3 follows either step S4 or S7").
2. For each step, specify the actions that must be performed in the step (for
example in S1 the action "Drill ready" or in S3 the action "Turn on drill motor").
3. Then decide for every step which conditions must be met so that the process
can move on to the next step (for example for T1 the condition "Drill started start button pressed" or for T5 the condition "Drill in upper position").
3-5
05.04.2001
05.04.01
Designing a Sequential Control System Based on the Example of a Drill
T6
S1
Drill program started (start button
pressed)
Monitor clamping
T1
S2
T2
S3
T3
T7
S7
T8
S4
T4
S5
Drill in upper position
Raise drill
T5
Release work piece, turn off drill motor
and cooling pump
S6
Work piece is released, cooling
pump stopped, drill motor stopped
Waiting time 500 ms
T6
S1
S = step
T = transition
3-6
05.04.2001
05.04.01
Designing a Sequential Control System Based on the Example of a Drill
3.3
Symbolic
addresses
Explanation
Inputs
I 0.0
Dr_mot_running
I 0.1
Dr_mot_stopped
I 0.2
Drill_down
I 0.3
Drill_up
I 0.4
Cl_press_ok
I 0.5
Coolant_sel
I 0.6
Cool_press_ok
I 0.7
Start_button
Outputs
Q 0.0
Dr_mot_on
Q 0.1
Cool_pump_on
Q 0.2
Lower_drill
Q 0.3
Raise_drill
Q 0.4
Clamp_workp
3-7
05.04.2001
05.04.01
Designing a Sequential Control System Based on the Example of a Drill
3.4
Creating a Project
Projects for sequential control systems do not differ from other projects in STEP 7.
To create a new project in the SIMATIC Manager, follow the steps outlined below:
1. Select the menu command File > New.
2. Name the project "Drill".
Inserting an S7 Program
In this example, hardware configuration is unnecessary since the default
addressing of the input/output module in slot 4 is used. You can therefore
immediately insert an S7 program in the project folder in the SIMATIC Manager.
The S7 program serves as a folder for the blocks of the user program, the source
files and the symbols. Follow the steps below:
1. Select the "Drill" project.
2. Select the menu command Insert > Program > S7 Program.
3. Name the S7 program "Drill Program".
The folders for source files, blocks, and symbols are created automatically when
you insert an S7 program. An empty OB1 is also created in the Blocks folder.
3-8
05.04.2001
05.04.01
Designing a Sequential Control System Based on the Example of a Drill
3.5
3-9
05.04.2001
05.04.01
Designing a Sequential Control System Based on the Example of a Drill
3.6
Creating an S7 Graph FB
The S7 Graph FB will contain the sequencer. To create an S7 Graph FB, follow the
steps outlined below:
1. Open the "Blocks" folder in "Drill Program" in the SIMATIC Manager.
2. Select the menu command Insert > S7 Block > Function Block.
3. Set "S7 Graph" as the language in the "Properties" dialog box.
Result: The empty FB with the default number 1 is created in the "Blocks"
folder.
3-10
05.04.2001
05.04.01
Designing a Sequential Control System Based on the Example of a Drill
Programming a Sequencer
After you have started the S7 Graph editor by double-clicking FB1 the system
inserts the first step (initial step) and the first transition. It is advisable to create the
structure at the "Sequencer" display level. To display conditions and actions,
activate the View > Display With > Conditions and Actions menu command.
Using the mouse and the "Sequencer" toolbar at the left-hand edge of the screen,
you can then position all the remaining steps and transitions, the alternative
branch and the jump from the end of the sequencer to the start of the sequencer.
There are two ways of doing this and both are illustrated here.
Method 2: "Drag-and-Drop"
1. Return to the SIMATIC Manager and create function block FB2 in the "Blocks"
folder as described above. Once again select "GRAPH" as the source
language.
2. Start the S7 Graph editor by double-clicking FB2 in the "Blocks" folder.
3. Select the menu command Insert > Drag-and-Drop.
3-11
05.04.2001
05.04.01
Designing a Sequential Control System Based on the Example of a Drill
Note
Before you start to program step actions, close function block FB2. You only
created this FB to try out the second method of creating a sequencer structure.
When you close the FB, answer all prompts with "No". For the rest of the exercise,
you will be working in FB1.
3.7
3-12
05.04.2001
05.04.01
Designing a Sequential Control System Based on the Example of a Drill
An action consists of an instruction and an address. For the drill program, four
different instructions are necessary in the steps:
3.8
Set output
Reset output
N
Non holding: As long as the step is active, the signal state of the
address is 1.
D
Delay: The address is set to 1 after the defined time has elapsed
following activation of the step and is reset when the step is deactivated.
Programming Transitions
The bit logic instructions "normally open contact", "normally closed contact" and
"comparator" are used for the step enabling conditions in the transitions. To
program transitions:
1. Set the "LAD" view and select the appropriate icons in the "LAD/FBD" toolbar
insert normally-open contact
insert normally-closed contact
insert comparator
2. Position the symbols at the appropriate points by clicking the transition lines.
You can exit the insert mode at any time with the ESC key.
3. Enter the addresses. Click the placeholder "??.?" of the required text field.
Then enter an absolute or symbolic address (for example I 0.7, "Start_switch").
4. If you wish, you can also enter a comment for the sequencer. In the
"sequencer" view, the comment field is at the top left and can be opened by
clicking it with the mouse.
3-13
05.04.2001
05.04.01
Designing a Sequential Control System Based on the Example of a Drill
Edit
Insert
PLC
Debug
View Options
Window
Help
Drill
T6
"Start_but
ton"
S1
Dr...
T1
Clamp_pres
s_ok"
S2
Cla...
T2
Drill_ready
Trans1
Clamp_on
S "Clamp_workp"
Trans2
Motor_on
S "Dr_mot_on"
S3
Mo...
"Drill_moto "Coolant_
r_running" sel"
T3
Trans3
"Drill_moto "Coolant_
r_running
"
sel"
T7
Trans7
Coolant_on
S "Cool_pump_on"
S7
Coo...
"Cool_pres
s_ok"
T8
Trans8
"Drill_d
own"
S4
Low...
Lower_drill
N "Lower_drill""
T4
Trans4
S5
Rai...
"Drill_up"
T5
Raise_drill
D
"Raise_drill""
T#500MS
Trans5
S6
Cla...
T6
Term_M_pump_off
R ""Clamp_workp"
R "Dr_mot_on"
R "Cool_pump_on"
Trans6
S1
When programming comparators, you can use the system information for steps as
the addresses. The addresses have the following significance:
3-14
Step_name.U: current or last activation time of the step without the time of a
disturbance
05.04.2001
05.04.01
Designing a Sequential Control System Based on the Example of a Drill
3.9
3-15
05.04.2001
05.04.01
Designing a Sequential Control System Based on the Example of a Drill
3.10
Full code:
The entire code required to execute each S7 Graph FB is included in the FB. If
you have several S7 Graph FBs, this means a considerable increase in
memory requirements.
Standard FC required:
To reduce memory requirements, S7 Graph has the two following alternatives:
You use a standard FC containing the main code sections for all FBs. This FC
is copied to your project automatically when you select this option. The FBs
produced using this method are considerably smaller.
Functionality
FC72
As default, you work with FC72. Remember, that your CPU must be capable of processing
blocks with more than 8 Kbytes.
FC70/FC71
These two FCs are less than 8 Kbytes in size and can therefore be loaded on a smaller
CPU. FC70 uses the diagnostic functionality of SFC17/18 and can only be used on CPUs
that have these functions available. If your CPU does not have these functions, you must
use FC71 and do without diagnostic capability.
If you want to check whether or not your CPU contains these SFCs, select the menu
command PLC > Obtainable Nodes in the SIMATIC Manager or click the corresponding
button in the toolbar. Open the "Blocks" folder in the S7 program.
FC73
This block requires less than 8 Kbytes of memory so that it can be executed on all CPUs.
Using this FC considerably reduces the memory requirements of the S7 Graph FBs. You
must also select the option "Interface Description: Memory minimized" in the block
settings.
The following restrictions, do, however, apply:
The blocks created do not have diagnostic capability
When you monitor the sequential control system, you will see the status display only for
the selected active element.
3-16
05.04.2001
05.04.01
Designing a Sequential Control System Based on the Example of a Drill
3.11
3. To close the sequencer, select the menu command File > Close.
3-17
05.04.2001
05.04.01
Designing a Sequential Control System Based on the Example of a Drill
3.12
Programming OB1
The sequential control program for the drill is called and started in organization
block OB1. You can create OB1 in LAD, FBD, STL or SCL (here it was created in
LAD). Program OB1 as shown in the following diagram. Follow the steps below:
1. Open the "Blocks" folder in the "Drill Program" S7 program in the SIMATIC
Manager.
2. Start the LAD/STL/FBD editor by double-clicking OB1.
3. With the menu command View, select the programming language LAD.
4. Select segment 1 and insert the sequencer call using the program element
catalog by double-clicking FB1 (Seq_drill).
5. Type in the name of the corresponding instance data block (IDB_Seq_drill)
above the LAD box.
6. Select the input parameter INIT_SQ, insert a normally open element using the
"LAD" toolbar and label it M0.0 ("INIT_SQ"). Using this parameter, you can set
the sequencer to the initial step (in the example step 1) in the online mode.
7. Select the menu command File > Save and close the organization block with
the menu command File > Close.
Note
All other block parameters can be ignored for the example.
3-18
05.04.2001
05.04.01
Designing a Sequential Control System Based on the Example of a Drill
3-19
05.04.2001
05.04.01
Designing a Sequential Control System Based on the Example of a Drill
3.13
Caution
It is best to download the S7 Graph block in the STOP mode since following
downloading of the instance DB, the sequencer is automatically set to the initial
state.
You should only download S7 Graph blocks in the RUN-P mode when the
sequencer is in the initial state or in the OFF state. If you download the blocks the
sequencer in a different state, for example when overwriting an old block,
problems may occur in the synchronization of the sequencer with the process.
Caution
A monitoring time is programmed in step 2. If the step activation time exceeds the
configured monitoring time (500 ms) in the supervision condition, the system
recognizes a supervision error and the disturbed step is displayed in red. If a fault
occurs, you must first satisfy the condition for progressing to the next transition.
Using the PG function Debug > Control Sequencer you can then enter an
acknowledgment (see also "Control Sequencer").
This does not apply to the inching mode, since the step enabling condition must
be satisfied and the acknowledgment received within one cycle.
3-20
05.04.2001
05.04.01
Designing a Sequential Control System Based on the Example of a Drill
3.14
Acknowledge
If the "Acknowledge errors" option is clicked, you acknowledge a pending error
message with the "Acknowledge" button. In this way, you can acknowledge a
disturbance caused, for example, by the configured monitoring time in Step 2 being
exceeded.
Note, however, that before you acknowledge the error you must make sure that the
supervision or interlock conditions that led to the error are no longer satisfied.
After an error has occurred, you can enable the next step in the sequencer by
satisfying the step enable condition because the last step enable condition in the
cycle in which you acknowledge has priority over the supervision. You must
nevertheless acknowledge the error.
If the error was caused because the undisturbed activation time Step name.U has
exceeded the configured monitoring time, you can move on the sequencer by
clicking the "Acknowledge" button.
This is possible because the Step name.U variable is set to "0" when you
acknowledge.
Initialize
With the "Initialize" button, you can restart the sequencer completely with the
defined initial step.
3-21
05.04.2001
05.04.01
Designing a Sequential Control System Based on the Example of a Drill
Note that before you activate a step you must first deactivate the currently active
step since only one step can be active at any one time in a linear sequencer. In
other words, you can only activate the required step when you have deactivated
the currently active step.
If you have set a new mode, the original mode is indicated in bold face.
After you have controlled your sequencer in the manual mode, you can return to
the automatic mode and close the "Control Sequencer" dialog box.
3.15
3-22
05.04.2001
05.04.01
Designing a Sequential Control System Based on the Example of a Drill
Include Instance DB
If you have not cleared the system default "Include Instance DB", S7 Graph checks
whether the instance DB has changed since it was last downloaded and whether it
must be updated. The option "Download with Instance DB" is clicked in the
"Download" dialog box.
Otherwise, S7 Graph does not check the instance DB and leaves you to decide
whether or not to download the instance DB again. The option "Download with
Instance DB" is not clicked in the "Download" dialog box.
button.
3-23
05.04.2001
05.04.01
Designing a Sequential Control System Based on the Example of a Drill
3-24
05.04.2001
05.04.01
4.1
Starting S7 Graph
Starting S7 Graph
There are two ways of starting S7 Graph:
Starting in Windows
Start S7 Graph by clicking the "Start" button on the taskbar in Windows.
The S7 Graph entry is under Simatic > STEP 7 > S7 Graph - Programming
Sequential Control Systems.
4-1
05.04.2001
05.04.01
Working with an S7 Graph
4.2
These sections describe the elements of the user interface numbered in the figure.
(1) Toolbars
(2) Work area
(3) Menu bar
(4) Title bar
(5) Overview window
(6) "Details" window
(7) Status bar
4-2
05.04.2001
05.04.01
Working with an S7 Graph
Title Bar
The title bar is at the upper edge of a window. Apart from the standard Windows
buttons, the title bars contain the following information:
Working Area
The working area is a window within S7 Graph in which the sequences of an
S7 Graph FB or an S7 Graph source file are displayed and can be edited.
Within the main window of S7 Graph, you can open up to 10 windows at the same
time. You can cascade or tile these windows.
Menu Bar
Just like other Windows applications, S7 Graph has a menu bar below the title bar
of the main window. The display of the menu commands is context-sensitive. The
menu commands are either active (black) or inactive (gray) depending on whether
or not the command can be applied to the currently selected object.
Toolbars
The toolbars contain buttons with which you can start frequently required and
currently available menu commands.
The names of the toolbars in S7 Graph are visible when the toolbars are positioned
within the main window.
Name
Content
Standard
Contains functions for handling files (opening, saving etc.) and for editing
(copying, pasting etc.).
View
Contains symbols for selecting various views (for example how S7 Graph
FBs are displayed, display of symbolic names etc.).
Sequencer
LAD/FBD
4-3
05.04.2001
05.04.01
Working with an S7 Graph
Overview Window
The overview window is displayed to the left of the working area and contains two
tabs:
Variables Tab
Displays the variable declaration with the sections IN, OUT, IN_OUT, STAT and
TEMP. Further program elements are also displayed: Symbols from the symbol
table, preprogrammed blocks from the block folder, blocks from libraries, and steps
and transitions along with their components used in S7 Graph FBs.
In this tab, you can modify existing parameter sets, system parameters can be
deleted but cannot be edited. It is also possible to extend your own parameters.
If you want to use a parameter or a program element in the sequencer, you can
drag it from the variable declaration window to the sequencer using the mouse and
position it at the required location.
Changes you have made to the parameters in the variable declaration window are
automatically updated in the sequencer so that no inconsistencies can result.
With the F1 key, detailed help is available on declaring variables in the variable
declaration window.
For more detailed information on the declared variables and program elements,
refer to the "Details" window (Variables tab). You can open this window with the
menu command View > Details.
4-4
05.04.2001
05.04.01
Working with an S7 Graph
"Schematic" Tab
In this tab, the entire system structure with all the sequencers contained in the FB
is displayed. Several sequencers are displayed one above the other.
The following elements are displayed:
The arrangement of the steps, transitions and branches - however not their
contents
Permanent Instructions
If you select an area of the structure in the "Schematic" tab, this is displayed in the
working window where you can edit it.
"Details" Window
The "Details" window is displayed at the bottom edge of the screen and includes
the following tabs:
Variables
The content of this tab depends on the selection you made in the "Variables" tab of
the overview window. Depending on the selections made, the following detailed
information can be displayed:
Information on variables
In this tab, you can declare new variables with the menu command Insert >
Declaration Line.
If you want to use a variable, block parameter or a program element in the
sequencer, you can drag it from the variable declaration window to the sequencer
using the mouse and position it at the required location.
S7 Graph for S7-300/400 Programming Sequential Control Systems
A5E00105265-01
4-5
05.04.2001
05.04.01
Working with an S7 Graph
Addresses
This tab contains a list of the addresses used in the block with their locations,
symbols, and data types. During monitoring, the tab displays a further column
when "Single Step" or "Permanent Instructions" is set displaying the current status
value of the address during program execution.
Whether or not this is displayed depends on the setting for the working area.
Setting for the Working Area
Displayed Addresses
Sequencer
Permanent Instructions
Status Bar
The status bar is at the bottom edge of the main window of S7 Graph. By selecting
the menu command View > Status Bar, you can display or hide the status bar.
In the left half of the status bar you will see brief information about the selected
menu command. The right-hand side of the status bar contains the following
information:
The following symbols identify the various connection and operating states:
Symbol
4-6
Display
Description
With
offline
Disconnected
CONNECTED
S7-300
and
S7-400
S7-300
and
S7-400
S7-300
RUN
S7-400
STOP
S7-400
FRCE
S7-400
05.04.2001
05.04.01
Working with an S7 Graph
The following displays are shown on a colored background in the status bar:
Display
Color
FRCE
Yellow
STOP
Red
HALT
Yellow
Disconnected
White
Green bar
Abs/Sym
The address priority set in the properties of the block folder.
The address priority specifies whether the absolute addresses or the symbols are
valid if changes are made in the symbol table.
Ins/OVR/Rd
Insert/Overwrite
Editing mode for input
Read
The block is read-only.
Chg/Chg. Interface
Indicates that the block has been changed and whether the change involves the
interface.
4-7
05.04.2001
05.04.01
Working with an S7 Graph
4.3
Sequencer
Permanent Instructions
Sequencer
At the "Sequencer" display level, one of the sequencers contained in the FB. If
several sequencers exist, you can change from one to the other by selecting the
"Graphic" tab in the overview window.
This display level is ideal for configuring the sequencers. At this level, you can
specify the structure of the sequencers and select the numbers, names and
comments for steps and transitions.
With the menu command View > Display With > Conditions and Actions, you
can display the contents of the configured steps and transitions.
The following elements are displayed:
As an option, you can display the contents of the steps and transitions
Depending on the zoom factor, step and transition names are displayed
At the single step level, only one step-transition pair is displayed. All the detailed
information can be programmed at this display level, as follows:
4-8
05.04.2001
05.04.01
Working with an S7 Graph
Transition: Conditions for enabling the step following the currently displayed
step
step comments
Note
To display a different step without changing the view, you can use the menu
command Edit > Go To.
To change to the next or previous step, use the cursor keys.
Permanent Instructions
At the permanent instructions display level, you can program the following:
4-9
05.04.2001
05.04.01
Working with an S7 Graph
4.4
4-10
05.04.2001
05.04.01
Working with an S7 Graph
To display conditions and actions: View > Display With > Conditions and
Actions
To display a list box for selecting addresses when editing actions: View >
Display With > Symbol List
You can display conditions and actions with View > Display With >
Conditions and Actions.
4-11
05.04.2001
05.04.01
Working with an S7 Graph
Color
You can change the color of the following elements:
Element
Create Mode
Selected element
Selected element
Monitor Mode
Elements
Inactive step
Error
Disturbed step
LAD/FBD satisfied
Satisfied conditions in
transition, supervision,
interlock and permanent
instructions
Non-satisfied conditions in
transitions, supervision,
interlock, and permanent
instructions
Non-executed transitions,
supervision conditions or
interlocks
Synchronization point
Synchronization points
Font
You can change the font for the following elements
Area
Step/transition number
Step/transition name
LAD/FBD
LAD/FBD addresses
Actions
Comments
Lines
You can change the line style (thickness) for the following types of line:
Line Style
4-12
Normal line
Sensitive line
05.04.2001
05.04.01
Working with an S7 Graph
4.5
4.5.1
4-13
05.04.2001
05.04.01
Working with an S7 Graph
4.5.2
In the Drag-and-Drop editing mode, you drag an element button (symbol) from
the toolbar to the required position.
2. Now click the position at which you want to insert the element. If the mouse
pointer takes the shape of a "prohibited sign" (a circle with a diagonal bar), this
indicates that the element cannot be inserted at the selected point. Each click
inserts a further element.
3. After you have inserted all the required elements, click the button in the toolbar
or the menu command from the Insert menu again to complete the action.
4-14
05.04.2001
05.04.01
Working with an S7 Graph
4.5.3
Type: Indicates whether the address is read (R) and/or written (W).
4-15
05.04.2001
05.04.01
Working with an S7 Graph
4-16
05.04.2001
05.04.01
Creating a Project
This chapter explains how you create and open your project. The chapter also
explains criteria with which you can decide whether to work with an S7 Graph FB
or S7 Graph source files.
Create an S7 Graph FB
5.1
5-1
05.04.2001
05.04.01
Creating a Project
5.2
Note
If you find that you cannot program a sequencer in one session, first save the data
as an S7 Graph source file or create an S7 Graph source file in the first place.
5-2
05.04.2001
05.04.01
Creating a Project
5.3
S7 Graph FB
You can create an S7 Graph FB both in the SIMATIC Manager or directly in
S7 Graph, as follows:
In S7 Graph, you create a new function block with the File > New menu
command. This is then created in the S7 Graph language.
In the SIMATIC Manager, you create a new function block with the Insert >
S7 Block > Function Block menu command. In this case set the language to
S7 Graph.
5.4
You can program the sequencer with absolute and symbolic addresses.
offline: The FB is displayed from the hard disk of the programming device
along with the symbols and comments.
online: The FB from the CPU is displayed along with comments and
symbols from the hard disk of the programming device (assuming that
these exist offline).
online without existing project structure: The FB from the CPU is displayed
(view "Accessible Nodes" in the "Open" dialog box) like a STEP 7 FB, in
other words without symbols and comments.
5-3
05.04.2001
05.04.01
Creating a Project
5.5
Note
If you create a new FB in S7 Graph, this is opened directly.
Select the required object in the blocks or source files folder and double-click
to open it.
5-4
05.04.2001
05.04.01
(1)
FB i
Comment for ...
CALL FBi,Dbi
SQ_INIT:=
DB i
(2)
(3)
(4)
S1
T1
S2
T2
(5)
The heart of a sequential control system is made up of the S7 Graph FBs (1).
These contain the following:
The program for step by step execution of the controller in sequencers (4).
Permanent instructions (3)(5) that are valid for all sequencers of the FB (and
are displayed in a separate window)
A block comment (2) with which you can describe the entire block.
Task
Add a comment about the S7 Graph FB in the field for the block comment (optional)
6-1
05.04.2001
05.04.01
Programming the Structure of a Sequencer
6.1
Sequencer - Principle
A sequencer consists of a series of steps and transitions that are activated in a
fixed order depending on the step enabling conditions.
an initial step or
As long as the actions of a step are being executed, this step is active. If several steps are being
executed at the same time, they are all active steps.
An active step is exited when
a branch stop. The sequence of steps stops when the branch stop is reached.
Step
The control task is divided into single steps. Actions are formulated in the steps
that are executed by the controller in a certain status (for example for controlling
the outputs or activating and deactivating steps).
Active Step
An active step is a step whose actions are currently being executed.
A step is activated, as follows:
When the step is defined as an initial step and the sequencer has been
initialized or
Note
Avoid using a jump from a transition to an immediately preceding step.
To make this jump statement possible, insert an empty step and transition without
conditions.
6-2
05.04.2001
05.04.01
Programming the Structure of a Sequencer
6.2
Structures of a Sequencer
The simplest structure of a sequencer is a linear sequence of steps and transitions
without branches.
A linear sequencer starts with a step and finishes with a transition that can be
followed either by a jump to any step or by a branch stop.
The linear sequence can be extended by the following:
(2)
(3)
T4
S1
T1
S2
T2
S3
T3
S4
T4
S1
T4
T11
S1
T1
S2
T2
T4
S1
S7
T5
S5
T6
T8
T1
S8
S2
T2
S3
S3
T3
T5
T3
S5
T6
T9
S9
S6
T7
T10
S10
S4
S4
S6
T4
T11
T4
S1
S7
S1
(1) S7 Graph FB with a linear sequencer
(2) S7 Graph FB with a sequencer with an alternative and simultaneous
(3) S7 Graph FB with two sequencers
6-3
05.04.2001
05.04.01
Programming the Structure of a Sequencer
6.3
at an initial step.
6-4
A branch can only join a path of a branch to the left of the path being closed.
A branch stop can be added after a transition at the end of a path in a branch
and deactivates the execution of the path.
05.04.2001
05.04.01
Programming the Structure of a Sequencer
6.4
Elements of a Sequencer
The following list shows the elements that can make up a sequencer and the
corresponding element buttons in the "Sequencer" toolbar with which you can
create these elements:
Step + Transition
Jump
Open Alternative Branch
Close Alternative Branch
Open Simultaneous Branch
Close Simultaneous Branch
Branch Stop
Insert Sequencer
You program the structure of the sequencer at the "Sequencer" display level.
6.5
Step-Transition Pair
As default, the S7 Graph FB already contains one step-transition pair to which you
can append further step-transition pairs.
Steps and transitions can only be inserted in pairs in a sequencer.
When you insert steps and transitions, they are automatically assigned a number.
To ensure a better overview, you can renumber steps and transitions within a
certain range later so that the numbering is consecutive.
Initial Step
The initial step is the step in a sequencer that becomes active without previously
querying conditions when an S7 Graph FB is first called. The initial step is not
necessarily the first step in a sequencer.
When a sequencer is run through cyclically, this step (just like every other step)
only becomes active when the conditions of the previous transition are satisfied.
The sequencer is initialized by the FB parameter INIT_SQ = 1. In other words the
sequencer starts with the initial step.
6-5
05.04.2001
05.04.01
Programming the Structure of a Sequencer
6.6
Jump
A jump is the change from a transition to any step within the sequencer or within
another sequencer in the same FB.
A jump always follows a transition and closes the sequencer or the path of the
branch at this point.
In contrast to a branch stop, the jump has the effect of repeating the execution of
the sequencer or parts of it.
The jump (1) and the jump destination (2) are displayed graphically as an arrow but
the connection itself is not visible.
T8
T4
S1
T12
S9
T1
T9
S5
S2
S7
T5
T2
S11
T7
S6
S3
T11
S12
S8
T10
S13
T13
S14
T12
T3
T8
T14
S1
S4
S9
T4
1
S1
Caution
A jump to a simultaneous branch should be avoided.
6-6
05.04.2001
05.04.01
Programming the Structure of a Sequencer
6.7
Alternative Branch
An alternative branch consists of two or more parallel sub-branches (a maximum of
125). Each path in an alternative branch begins with a transition. Only the branch
path whose transition switches first is executed. An alternative branch therefore
corresponds to an OR operation in which only one path can be active.
Each path in an alternative branch ends with a transition and can be closed by a
branch stop or a jump.
T5
Tz
S1
T1
T6
Sm
S2
T2
S3
Sx
Tm
Sn
T3
T7
Tn
Tx
Sy
Ty
S4
Tx+1
Sz
Tz
T4
Jump
S5
T5
: Alternative sub-branch 1
: Alternative sub-branch 2
: Alternative sub-branch 3 with a
further alternative branch
Jump
6-7
05.04.2001
05.04.01
Programming the Structure of a Sequencer
6.8
Simultaneous Branch
A simultaneous branch consists of more than one parallel path (a maximum of 249)
each of which starts with a step. The path are executed simultaneously. A
simultaneous branch corresponds to an AND branch.
The transition before the simultaneous branch (in the figure T1 and T7) activates
the first steps of the individual simultaneous branch paths.
Every path in a simultaneous branch ends with a step and is completed by a
successor transition.
If more than one simultaneous branch path joins to a transition, this transition only
enables the next step when all active simultaneous branch paths have been
executed.
T5
1
S1
T1
S6
S2
T2
S3
S7
Tm
T7
Sm
Sx
Sz
T3
Tx
S4
Sy
T4
S5
T5
6-8
: Simultaneous sub-branch 1
: Simultaneous sub-branch 2
: Simultaneous sub-branch 3 with a
further simultaneous branch
05.04.2001
05.04.01
Programming the Structure of a Sequencer
6.9
Branch Stop
A branch stop at the end of a linear sequencer (1) or at the end of a path of an
alternative branch (2) terminates the sequencer. The sequencer is not executed
cyclically.
A branch stop at the end of a branch path of a simultaneous branch (3) terminates
only this branch path. The execution of the other paths in the simultaneous branch
continues.
A branch stop always follows a transition.
1
T3
S1
S1
T1
S2
T1
T4
T1
S2
S2
T2
S3
T3
S1
S4
T2
S3
T3
T5
S4
T4
T2
S3
S5
S5
T5
T3
T3
T6
S1
S1
Caution
If all the paths of a sequencer are completed with a branch stop, the sequencer
can only be restarted by the parameter INIT_SQ.
6.10
New Sequencer
An S7 Graph FB can consist of several sequencers.
Each sequencer can
1. be executed independent of the other sequencers and therefore at the same
time.
2. be used with a jump to continue it or connect it as the branch of another
sequencer. This allows you to represent technically complicated functions in
one block providing you with a clearer structure for the program.
In every sequencer, an initial step can identify the first active step.
6-9
05.04.2001
05.04.01
Programming the Structure of a Sequencer
6.11
Permanent Instructions
Permanent instructions are conditions (1) and block calls (2) located before or after
the sequencer. These are executed once per scan cycle regardless of the state of
the sequencer.
You can program any number of permanent instructions in an S7 Graph FB. Each
permanent instruction is assigned a number.
You program permanent conditions in the "permanent instructions" view.
1
(1)
E2.3
E0.0
M2.0
E2.5
2
CALL
(2)
Permanent Condition
Conditions that must be satisfied at more than one point in the sequencers can be
programmed once centrally as permanent conditions. You can use the Ladder
Logic elements: normally-open contact, normally-closed contact, and comparator
or the FBD elements AND box, OR box, and comparator. A maximum of 32
Ladder Logic/FBD elements can be programmed per permanent condition.
The result of combining the conditions is stored in a ladder coil or in an FBD
assignment with which the functions set and reset are available. The address used
(for example a memory bit) can be queried in a transition, interlock, and
supervision.
6-10
05.04.2001
05.04.01
Programming the Structure of a Sequencer
6.12
Functions (FC) and function blocks (FB) programmed in STL, LAD, FBD or
SCL and
The blocks must already exist in the "Blocks" folder of the S7 program before
they are called.
The names of the blocks can be specified in absolute form (for example FC1)
or, if they are declared in the symbol table, symbolically (for example Motor 1).
When the blocks are called, you must supply the formal parameters of the
called block with actual values.
Block Comment
Every S7 Graph FB can include a block comment. The block comment can be a
maximum of 2048 characters long. It has no influence on the execution of the
program.
Block comments are displayed only in the "Sequencer" view.
6-11
05.04.2001
05.04.01
Programming the Structure of a Sequencer
6-12
05.04.2001
05.04.01
Actions with their categories and components and how to make them
dependent on events
Step comment
Interlock
(2)
Supervision
(3)
S1
S1
T1
(4)
T2
(5)
Step1
(6)
Step1
S2
T1
Address
(1)
(2)
(3)
(4)
(7)
Trans1
Symbol
(5)
(6)
(7)
(8)
Type
Comment
(8)
7-1
05.04.2001
05.04.01
Programming Actions and Conditions
7-2
Step
Task
Editing the numbers and names of steps and transitions or entering a step
comment
Editing the section of the STEP 7 symbol table for this step
05.04.2001
05.04.01
Programming Actions and Conditions
7.1
Actions
In the steps, you program actions that, for example, control the inputs, outputs and
memory bits, activate or deactivate the steps of the sequencer or call blocks. This
means that actions contain instructions for process control. These actions are
executed in order from "top" to "bottom" when the step is active.
You program the step contents in the action table at the "single step" display level.
You can also select the "Sequencer" display level and display the actions with the
menu command View > Display With > Conditions and Actions.
Components of an Action
An action consists of the following:
(1): An optional event (for example S1) and an instruction (for example N) and
(2): An address (for example M4.3) or an assignment (for example A:=B+C).
Step is active
S4
Step4
Order of
execution
Step4
N
M 4.2
S0 R Q 4.4
S1 N M 4.3
1
Categories of Actions
Actions are divided into the following categories:
Standard actions
-
Event-dependent actions
-
7-3
05.04.2001
05.04.01
Programming Actions and Conditions
7.2
Standard Actions
Address
Identifier
Address
Location
Meaning:
N[C]
Q,I,M,D
m.n
S[C]
Q,I,M,D
m.n
R[C]
Q,I,M,D
m.n
D[C]
Q,I,M,D
m.n
T#<const>
L[C]
Q,I,M,D
Time constant
m.n
T#<const>
CALL[C]
FB, FC,
SFB,
SFC
Time constant
Block
number
7-4
05.04.2001
05.04.01
Programming Actions and Conditions
Time Constant
All actions that contain the instructions D or L require a time to be specified. Times
are programmed as constants with the syntax T#<const> and can be combined as
required.
<const>= nD (n days), nH (n hours), nM (n minutes), nS (n seconds), nMS (n
milliseconds), where n = a number (integer)
Example: T#2D3H: time constant = 2 days and 3 hours
S4
Step4
(1)
(2)
Step4
N
A1.0
D
A1.1
T#1M20S
(1): As long as the step is active, the signal at output Q1.0 is set to 1.
(2): 1 minute and 20 seconds after step activation and providing the step is still
active, the signal at output Q1.1 is set to 1. If the step is no longer active, the signal
at Q1.1 is 0.
7-5
05.04.2001
05.04.01
Programming Actions and Conditions
7.3
Event-Dependent Actions
Events
An action can be logically combined with an event. An event is the change in the
signal state of a step, a supervision or an interlock or the acknowledgment of a
message or a registration is set.
If an action is logically combined with an event, the signal state of the event is
recognized by edge detection. This means that the instructions can only be
executed in the cycle in which the event took place.
1
S1
S0
Supervision
1
V1
V0
Interlock
1
L1
0
L0
[C = 0]
t
1
0
7-6
A1=1
05.04.2001
05.04.01
Programming Actions and Conditions
Instruction
Address
Identifier
Address
Location
Meaning:
Q,I,M,D,
m.n
CALL[C]
block
number
N, R, S,
Q,I,M,D
m.n
CALL
block
number
7-7
05.04.2001
05.04.01
Programming Actions and Conditions
Instruction
Address
Identifier
Address
Location
Meaning:
ON[C], OFF[C]
S1, V1
OFF[C]
S_ALL
ON, OFF
L1
OFF
S_ALL
i: step number
Note
If a step is both activated and deactivated in one cycle, deactivating has higher
priority.
S4
Step 4
1
2
3
Step 4
S1 RC
A1.0
V1 OFF S_ALL
L0 CALL FC10
(1): As soon as the step is active and the interlock is satisfied, output Q1.0 is set to
0 and remains set to 0.
(2): As soon as the supervision error occurs, all active steps are deactivated,
except for step S4 in which the action is located.
(3): As soon as the interlock condition is satisfied, the specified block (FC10) is
called.
7-8
05.04.2001
05.04.01
Programming Actions and Conditions
7.4
Counters in Actions
All counters in actions are always dependent on an event, in other words the event
determines the time at which the instruction is activated. You also have the option
of combining counters with an interlock. The count instructions combined with the
interlock are only executed when the conditions of the interlock are satisfied (letter
C added) as well as the event occurring. Counters without an interlock are
executed when the event occurs.
The counters in actions behave like the counters in other S7 programming
languages: There is no overflow and no underflow and with a counter reading of 0,
the counter bit is also 0, otherwise it is 1.
Event
Instruction
Address
Identifier
Address
Location
Meaning:
CS[C]
<initial counter
value>
CU[C]
CD[C]
CR[C]
7-9
Timers in Actions
All timers in actions are always dependent on an event, in other words the event
determines the time at which the instruction is activated. You also have the option
of combining timers with an interlock. The timer instructions combined with an
interlock are only executed when the conditions of the interlock are satisfied in
addition to the event occurring (additional letter C). Timers without an interlock are
executed when the event occurs.
Event
Instruction
Address
Identifier
Address
Location
Meaning:
TL[C]
<time>
S1, S0, L1,
L0, V1, V0,
A1, R1
TD[C]
time
X
<time>
S1, S0, L1,
L0, V1, V0,
A1, R1
TR[C]
7-10
05.04.2001
05.04.01
Programming Actions and Conditions
Time (duration)
All actions containing one of the TL or TD instructions require a time (duration) to
be specified. The time is programmed with the following syntax:
<time> = IWy, QWy, MWy, LWy, DBWy, DIWy; variable of the type S5TIME,
WORD; S5T#time_cnstant
Y = 0 ... 65534
Arithmetic in Actions
You can provide statements with simple arithmetic expressions in actions. There
are assignments in the form A:=B, A:=func(B) and A:=B<operator>C. An action
containing an arithmetic expression requires the N instruction. The action can be
dependent on an event. This means that the assignment can either be executed
only when the relevant event occurs or in each cycle in which the step is active. As
an option, the action can also be combined with an interlock (letter C added).
Event
Instruction
Assignment
Meaning
--
N[C]
A:=B
A:=func(B)
A:=B<operator>C
S0, S1, V0,
V1, L0, L1,
A1, R1
N[C]
A:=B
A:=func(B)
A:=B<operator>C
Direct Assignments
You can enter direct assignments with the syntax A:=B. The following data types
can be used for a direct assignment:
The following table is an overview of all the permitted types of assignment. You can
assign not only addresses of the same type but also addresses with different data
types with the same length and addresses of different lengths to each other:
7-11
05.04.2001
05.04.01
Programming Actions and Conditions
8 Bits
BYTE :=
CHAR :=
16 Bits WORD :=
INT :=
DATE :=
S5TIME :=
32 Bits DWORD :=
8 Bits
16 Bits
BYTE CHAR
WORD
INT
DATE S5TIME
32 Bits
TIME :=
TIME_OF_
DAY :=
DINT
REAL TIME
TIME_
OF_
DAY
DINT :=
REAL :=
DWORD
Comment
Conversion functions:
A := BCD_TO_NUM(B)
A := NUM_TO_BCD(B)
A := INT_TO_DINT(B)
A := DINT_TO_REAL(B)
A := ROUND(B)
A := TRUNC(B)
Math functions:
7-12
A := NEGR(B)
REAL negation
A := ABS(B)
A := SQR(B)
REAL square
A := SQRT(B)
A := LN(B)
A := EXP(B)
A := SIN(B)
REAL sine
A := ASIN(B)
A := COS(B)
REAL cosine
A := ACOS(B)
A := TAN(B)
REAL tangent
S7 Graph for S7-300/400 Programming Sequential Control Systems
A5E00105265-01
05.04.2001
05.04.01
Programming Actions and Conditions
Assignment with
Built-in Function
Comment
A := ATAN(B)
A := NEG(B)
Other Functions:
A := NOT(B)
A := SWAP(B)
A := RLDA(B)
A := RRDA(B)
Comment
A := B + C
+I, +D, +R
A := B - C
-I, -D, -R
A := B C
I, D, R
A := B / C
/I, /D, /R
When necessary, the operator can be supplemented by
+D/+R in the basic math functions.
A := B MOD C
A := B AND C
A := B OR C
A := B XOR C
A := B SHL C
A := B SHR C
A := B SSR C
A := B ROL C
A := B ROR C
7-13
05.04.2001
05.04.01
Programming Actions and Conditions
S4
Step 4
1
2
Z23
A:=A+1
7.5
Conditions
Conditions are binary states of the process that are combined with each other as
LAD or FBD elements (normally-open contact, normally-closed contact, AND box,
OR box, comparator) in the LAD diagram or in the function block diagram
according to Boolean logic. The result of the logic operation (RLO) can influence
individual actions of a step, the entire step, the enabling of the next step or the
entire sequencer. Logic operations are programmed in Ladder Logic or FBD.
Conditions are :
7-14
Interlock
Supervision
Permanent instructions (conditions and block calls at the start and/or at the end
of the sequencer)
05.04.2001
05.04.01
Programming Actions and Conditions
Transition
In a transition, you program conditions that control how the sequencer passes
control from one step to the next.
Interlock
C
Supervision
V
E2.3
S1
Step1
Step1
S1 RC
A1.0
V1 OFF
S_ALL
L0 CALL
FC10
T1
Trans1
E2.5
A transition is displayed and programmed at the single step display level. You can
also select the "Sequencer" display level and display the transitions with the menu
command View > Display With > Conditions and Actions.
The transition passes control to the next step of the sequencer when the logic
operation of the conditions is satisfied, in other words when the network produces
the result 1. The step following the transition becomes active.
The transition does not pass control to the next step of the sequencer if the logic
operation of the conditions is not satisfied; in other words, when the network
produces the result 0. The active step remains active.
Empty Transition
Transitions without programmed conditions are empty transitions. This does not
affect the execution of the sequencer. The active step is run through only once.
The following step becomes valid.
Skipping Steps
If both the transition before a step and the transition after a step are valid at the
same time, the step does not become active.
In the "Compile/Save" tab of the "Block Settings" dialog box (menu command
Options > Block Settings), the option "Skip Steps" must be selected.
7-15
05.04.2001
05.04.01
Programming Actions and Conditions
Interlock
An interlock is a programmable condition for interlocking the step that influences
the execution of individual actions.
E2.3
E2.5 Interlock
C
Supervision
V
C
S1
Step1
Step1
S1 RC
A1.0
V1 OFF
S_ALL
L0 CALL
FC10
T1
Trans1
If the logic operation of the conditions is satisfied, the actions combined with
interlocks are executed.
If the logic operation of the conditions is not satisfied, there is a disturbance:
You program an interlock at the single step display level. A maximum of 32 Ladder
Logic/FBD elements can be programmed per interlock. The result of the operation
is managed automatically by the system.
A programmed interlock is indicated by the letter C following the step at all display
levels.
Caution
If you program an interlock this is only used in the actions when their instructions
have been extended by the letter C.
Empty Interlock
An interlock without a condition (in other words without Ladder Logic or FBD
elements) behaves like a satisfied interlock.
7-16
05.04.2001
05.04.01
Programming Actions and Conditions
Supervision
A supervision is a programmable condition for monitoring a step that influences the
way in which the sequencer passes control from one step to the next.
Interlock
C
Supervision
IN1
IN2
CMP
== I
S1
Step1
Step1
V
T1
Trans1
S1 RC
A1.0
V1 OFF
S_ALL
L0 CALL
FC10
A programmed supervision is indicated by the letter V to the left of the step at all
display levels.
You program supervisions at the single step display level. A maximum of 32
Ladder Logic/FBD elements can be programmed per supervision. The result is
managed automatically by the system.
If the logic operation of the conditions is satisfied, there is a disturbance and the
event V1 is signaled. The sequencer does not pass control to the next step. The
current step, however, remains active. The step activation time Si.U is stopped as
soon as the condition is satisfied.
If the logic operation of the conditions is not satisfied, there is no disturbance. If the
successor transition is satisfied, the sequencer passes control to the next step.
Permanent Instructions
You program permanent instructions with the familiar Ladder Logic/FBD elements.
For more detailed information, refer to the "Permanent Instructions" section in
"Programming the Structure of a Sequencer".
7-17
05.04.2001
05.04.01
Programming Actions and Conditions
7.6
Address
Data type
<Operand> BOOL,
TIMER,
COUNTER
Memory
Area
Description
Coil (output)
<Operand> BOOL
<Operand>
-----(=)
Coil
Set output
<Operand>
-----(S)
<Operand> BOOL
7-18
05.04.2001
05.04.01
Programming Actions and Conditions
Address
Data type
Coil
Reset output
<Operand> BOOL
<Operand>
-----(R)
Memory
Area
Description
Each branch in a Ladder Logic network must contain at least one Ladder Logic
element.
Insert > Direct In this mode, you first select the position in the sequencer at
which you want to insert an element and then select the element to be
inserted.
Insert > Drag and Drop In this mode, you first select the element you want to
insert and then select the position at which the element will be inserted using
the mouse pointer. This mode is particularly suitable when you want to insert
the same element at more than one position in the sequencer.
Entering Addresses
There are two ways of entering addresses:
Click the placeholder "??.?" of the required text field. Then enter an absolute or
symbolic address (for example I1.0, "limit_switch"). You can use both the
German mnemonics (E, A) and the English mnemonics (I, O) for addresses.
Set the mnemonics you require in the SIMATIC Manager.
Select the address and then select an absolute or symbolic address from the
drop-down list box (for example I1.0, "Limit switch"). The address is then
entered.
7-19
05.04.2001
05.04.01
Programming Actions and Conditions
7.7
Logic operation
AND
OR
E0.1
E0.0
a transition
The condition is satisfied when
the signal state at input I 0.0 is
"1" AND and the signal state at
input I 0.1 is "0".
The condition is satisfied when
CMP
== I
IN1
IN2
7-20
05.04.2001
05.04.01
Programming Actions and Conditions
Ladder Logic
Element
Addresses
Compare box
Data
Memory Area
Description
I, Q, M, data
(double) word
CMP
==
IN1
IN2
==
>
<
>=
INT
DINT
REAL
<=
<>
IN1: First
comparison value
I, Q, M, data
(double) word
Note:
When you enter the
comparator you only
need to specify the
data type D/R/I
explicitly when you
enter the 32 bit
values without
specifying a type
(for example when
accessing absolute
addresses in the
double word area).
Otherwise the data
type is detected by
the system so that
the specification can
be omitted.
7-21
05.04.2001
05.04.01
Programming Actions and Conditions
7.8
FBD Elements
An FBD program follows the signal flow of a logic string. The individual FBD
elements carry binary information: Signal state "0" (current not flowing) or "1"
(current flowing).
FBD Element
Address
Data type
<Operand> BOOL
Memory
Area
Description
I, Q, M, T,
C, D, L
<Address>
None:
--
--
Output
Assign output
<Operand> BOOL
<Operand> BOOL
<Address>
=
Set output
<Address>
S
Reset output
<Address>
R
<Operand> BOOL,
TIMER,
COUNTER
I, Q, M, T,
C, D, L
7-22
05.04.2001
05.04.01
Programming Actions and Conditions
Each branch in an FBD network must contain at least one FBD element.
Insert > Direct In this mode, you first select the position in the sequencer at
which you want to insert an element and then select the element to be
inserted.
Insert > Drag and Drop In this mode, you first select the element you want to
insert and then select the position at which the element will be inserted using
the mouse pointer. This mode is particularly suitable when you want to insert
the same element at more than one position in the sequencer.
Entering Addresses
There are two ways of entering addresses:
Click the placeholder "??.?" of the required text field. Then enter an absolute or
symbolic address (for example I1.0, "limit_switch"). You can use both the
German mnemonics (E, A) and the English mnemonics (I, O) for addresses.
Set the mnemonics you require in the SIMATIC Manager.
Select the address and then select an absolute or symbolic address from the
drop-down list box (for example I1.0, "Limit switch"). The address is then
entered.
7-23
05.04.2001
05.04.01
Programming Actions and Conditions
Address
AND operation
<Operand> BOOL
<Address>
<Address>
Data type
Memory
Area
Description
I, Q, M, T,
C, D, L
&
<Operand> BOOL
I, Q, M, T,
C, D, L
>=1
Compare box
CMP
==
IN1: First
INT/ DINT/
comparison REAL
value
I, Q, M, D,
L, constant
IN1
IN2
==
>
<
INT
DINT
> = REAL
<=
<>
IN2:
INT / DINT / I, Q, M, D,
Second
REAL
L, constant
comparison
value
7-24
Note:
When you enter the comparator
you only need to specify the data
type D/R/I explicitly when you enter
the 32 bit values without specifying
a type (for example when
accessing absolute addresses in
the double word area). Otherwise
the data type is detected by the
system so that the specification
can be omitted.
05.04.2001
05.04.01
Programming Actions and Conditions
7.9
Address
Meaning
Used in
Si.T
Comparator, assignment
Si.U
Comparator, assignment
Si.X
Normally open
contact/normally closed
contact
Transi.TT
Transition i is satisfied
Check whether all conditions of transition i are satisfied
Normally open
contact/normally closed
contact
You can use S7 Graph-specific addresses just like all other addresses in LAD and
FBD or in actions.
Valve
CMP
>=D
Step activity
Time constant
S003.U
IN1
T#5s
IN2
7-25
05.04.2001
05.04.01
Programming Actions and Conditions
7.10
No disturbance
V1
V0
t
1
Whether or not an error must be acknowledged can be set as "definable" not only
in the settings in the dialog box but alternatively also using the relevant parameter
(EN_ACKREQ) in the parameter set.
7-26
05.04.2001
05.04.01
Programming Actions and Conditions
Yes
Compilation
setting:
Acknowledge
No
Ackn. signal or
SV not true?
No
Yes
No
Ackn. signal?
Ackn. signal?
No
Yes
Yes
Si.U:=0
Step enabling
condition true?
Si.U:=0
Yes
Yes
Step enabling
condition true?
No
No
No
SV not true?
Yes
Supervision error
leaves state
Event V0 enters
Sequencer switches
No
SV not true?
Yes
Supervision error
leaves state
Event V0 enters
Supervision error
leaves state
Event V0 enters
End
7-27
05.04.2001
05.04.01
Programming Actions and Conditions
7.11
Step Comment
A step comment can contain a maximum of 2048 characters. It has no influence on
the execution of the program.
Step comments are displayed only at the single step display level. If you do not
enter an extended step name, the step name is displayed instead.
Step Number (for example S1) and Step Name (for example Step1)
The step name and step number must be unique and can be adapted at any of the
display levels.
7-28
05.04.2001
05.04.01
Programming Actions and Conditions
Transition Number (for example T1) and Transition Name (for example Trans1)
The transition name and transition number must be unique and can be adapted
later in all three programming language representations.
7.12
7-29
05.04.2001
05.04.01
Programming Actions and Conditions
7.13
Instead of the absolute block identifier FB11, use the symbolic name
Seq_drill".
Editing Variables
You can edit variables in the "Variables" tab in S7 Graph. This tab is displayed in
the "Overview" window to the left of the working area. You can toggle the display
on or off with the View > Overviews menu command.
You can modify existing parameter sets in the "Variables" tab. You can also define
your own parameters and variables. You can delete, but not edit system
parameters.
In most cases, you only require the information that is displayed in the "Variables"
tab of the overview window. You can obtain more detailed information on the
variables in the "Details" window. This window also contains a "Variables" tab in
which you can see information about addresses, initial values, and comments on
the variables.
You can display detailed help on declaring variables in the "Variables" tab by
pressing the F1 key.
7-30
05.04.2001
05.04.01
Correction of errors
Source file is saved
Error messages
Syntax check
Trigger: Compile a
source file
Yes
Error?
No
FB is created
Instance DB is created
8.1
Each FB has an instance DB that can be understood as the memory of the FB.
This contains all the data and parameters required to execute the FB. The
instance DB can be created either automatically during compilation or later
using a menu command.
The size of the instance DB depends on the number of programmed steps and
transitions but is a minimum of 300 bytes.
8-1
05.04.2001
05.04.01
Saving and Compiling
8.2
8.3
8-2
Before saving the S7 Graph FB or S7 Graph source file, you can start a
consistency check.
-
Errors and warnings during the compilation of an S7 Graph source file can
but do not need to be corrected.
If you want to download several sequencers to the PLC at the same time, it is
often better to include the system functionality in one of the supplied standard
blocks. This reduces the size of every S7 Graph block by approximately 5000
bytes. The requirement of the standard block must, however, be added to this
(once) (FC70 approx. 8200 bytes, FC71 approx. 7750 bytes, FC72 approx.
10700 bytes, FC73 approx. 8150 bytes).
Only error-free S7 Graph FBs can be saved and transferred to the CPU, in
other words errors must be eliminated before the FB can be saved. Less
significant errors that cause warnings do not need to be eliminated, in other
words it is possible to Save" or Save As" FBs with warnings.
When you save an FB, S7 Graph implicitly compiles it, in other words the
sequencer you have created is checked for syntax errors. Following this, the
S7 Graph FB does not need to be compiled.
A detailed window in the "Compile/Decompile Messages" tab displays errors
that have occurred (for example jump destination not defined) and/or warnings
(for example action without content) as compilation messages.
The block created after compilation is saved in the Blocks folder of the same
S7 program.
Source files are saved in the Source Files folder in the same S7 program.
05.04.2001
05.04.01
Saving and Compiling
Note
If your S7 Graph source file is error-free, you can then create an S7 Graph FB
with File > Compile.
8.4
Select the menu command Options > Block Settings. The dialog has three
tabs that are relevant for saving and compiling.
-
The "Compile / Save" tab defines the structure and content of the FB and
the corresponding DB, some properties of the sequencers and the display
of warnings during compilation.
The "Process Diagnostics" tab decides the blocks for which process
diagnostics is used.
Select the menu command Options > Application Settings. The dialog has a
further tab that is relevant for saving and compiling.
-
The "General" tab determines, among other things, the data to be created
when you save your program.
8-3
05.04.2001
05.04.01
Saving and Compiling
8.4.1
Here you set the display level at which S7 Graph will open a block: Sequencer,
single step or permanent instructions.
Component
Meaning
Comments
A field in which you can enter the block comment or (at the single
step level) the step comment.
Symbols
Conditions and
Actions
Reference data
On Saving
The settings decide which data are created when you save your program.
8-4
05.04.2001
05.04.01
Saving and Compiling
Absolute
Select this option to access the addresses in absolute format.
Symbolic
Select this option to access the addresses in symbolic format. The symbols
used must be defined in the symbol table.
If you select this option, when you double-click a step it is displayed at the
single-step level in a separate window.
If you select this option, the settings are saved when you exit the editor and will
be displayed again next time you start an editor session.
You can specify the maximum number of status jobs that will be used by
S7 Graph.
All the settings that you make in this tab selected with the menu command
Options > Application Settings apply to the currently open block.
IEC-compliant
S7 Graph V5.1 complies with the PLCopen Basis Level for sequential control
systems as stipulated in the DIN EN 61131-3 standard.
If you have a sequential control system that conforms with the standard, you can
now import it into the STEP 7 data management as an ASCII file using the
SIMATIC Manager and then edit it in S7 Graph.
To create sequential control systems conforming with the standard, select the
"IEC-compliant" option. This setting has the following effects:
All sequential control systems must contain an initial step. Otherwise, an error
is indicated during compilation and no block is created.
Direct identifiers in source files and blocks (for example M0.0) are preceded by
the
% character (%M0.0)
Compare instructions are displayed without a data type specification if the data
type of the address is unambiguous.
8-5
05.04.2001
05.04.01
Saving and Compiling
To ensure that the source files comply with the PLCopen Standard, the following
modifications are made automatically:
8.4.2
Minimum: The FB contains only the start parameter INIT_SQ which can be
supplied with a value. Only the automatic mode is possible.
Standard: The FB contains the standard parameters that can be supplied with
values. All modes are possible.
Maximum: The FB contains all the parameters that can be supplied with
values. All modes are possible.
Definable: With this option, you can define your own parameter set in the
"Variables" tab in the overview or details window.
Caution
If you edit a user-defined parameter set and then select a standard parameter set
later in this tab, you will lose the self-defined parameters.
8-6
05.04.2001
05.04.01
Saving and Compiling
8.4.3
Full code:
The entire code required to execute each S7 Graph FB is included in the FB. If
you have several S7 Graph FBs, this means a considerable increase in
memory requirements.
Standard FC required:
To reduce memory requirements, S7 Graph has the two following alternatives:
You use a standard FC containing the main code sections for all FBs. This FC
is copied to your project automatically when you select this option. The FBs
produced using this method are considerably smaller.
To optimize your memory requirements, it is advisable to use the second
method with the standard FC if you have two or more S7 Graph FBs.
You have the choice between the following standard FCs:
-
FC70/FC71
These two FCs are less than 8 Kbytes in size and can therefore be loaded
on a smaller CPU.
Remember that FC70 and FC71 only support the functionality of S7 Graph
V4.0. You cannot, for example, program user-defined parameters for the
FB, however you can use arithmetic functions, timers, or counters in your
program from S7 Graph V5.1 onwards.
FC70 uses the diagnostic functionality of SFC17/18 and can only be used
on CPUs that have these functions available. If this is not the case with
your CPU, you must use FC71 and do without the diagnostic capability or
select "Full Code".
FC72
FC72 provides the entire system functionality but can only be loaded on
larger CPUs since it is 11 Kbytes in size.
FC73
Due to its size of less than 8 Kbytes, FC73 can also be processed by
smaller CPUs. If you use this FC, you can considerably reduce the
memory requirements of the S7 Graph FBs in the same dialog by selecting
the "Interface Description: Memory minimized" in the block settings.
FC73 provides the functionality of S7 Graph V5.x. However, the following
restrictions apply: The blocks created are not capable of diagnostics and
only include status displays when you monitor the sequential control
system if you click on the area of the permanent instructions or on the
currently active transition.
8-7
05.04.2001
05.04.01
Saving and Compiling
8.4.4
8-8
Memory minimized
The interface descriptions are stored in the instance DB as structures. A
separate structure with detailed information is created for each step and each
transition of the sequencer.
This option reduces the memory requirements of your S7 Graph FB
considerably. The blocks created are, however, not capable of diagnostics and
only include status displays when you monitor the sequential control system if
you click on the area of the permanent instructions or on the currently active
transition.
If you use this option, you must use the supplied FC75 standard block.
Structure arrays:
The step and transition descriptions are stored in the instance DB as arrays.
This option reduces the memory requirements of your S7 Graph FB. The step
names are, however, not stored. Symbolic addressing of other blocks is not
possible in this case.
Individual structures:
The interface descriptions are stored in the instance DB as structures
(STRUCT). These contain extremely detailed information about the steps and
transitions.
The blocks created have all the monitoring and diagnostic functions.
The interface descriptions also include information about the step names so
that you have the option of internal and external access using symbolic names.
The instance DB can be evaluated both using direct access to the data or
using the step and transition names.
The structures increase the size of the instance DB but do not affect the
performance when executing the sequencer.
05.04.2001
05.04.01
Saving and Compiling
8.4.5
Skip Steps
If both the transition before a step and the transition after the step are valid at
the same time, the step does not become active and is skipped.
Acknowledge Errors
If a supervision error occurs during operation (conditions of a supervision
satisfied), this must be acknowledged with the input parameter "ACK_EF" to
allow the controller to continue operation. This option is not available if you
have selected the options "FB Parameters: Minimum".
8-9
05.04.2001
05.04.01
Saving and Compiling
8.4.6
8.4.7
All: All warnings occurring during compilation are displayed in the message
window.
If you click this tab with the Options > Application Settings menu command,
the settings apply to all newly created blocks.
If you click this tab with the Options > Block Settings menu command, the
settings apply to the currently open block.
None:
Messages are not generated.
The following entries are possible only in the "Application Settings" dialog box.
They do, however, also apply to the current block.
8-10
05.04.2001
05.04.01
Saving and Compiling
8.5
Interlock:
An interlock message can be created as an event message or as an alarm
message. Write a message text in the text field. This message text is entered
in the OP project along with the diagnostic data. The text is extended
dynamically by S7 Graph with current information.
Supervision conditions:
A supervision message can be created as an event message or alarm
message. Write a message text in the text field. This message text is entered
in the OP project along with the diagnostic data. The text is extended
dynamically by S7 Graph with current information.
Saving
The "with criteria analysis data" option is not selected in the "Compile" tab.
Each step contains an average of 1.2 transitions, 1.5 actions and 0.8 time
monitoring functions.
8-11
05.04.2001
05.04.01
Saving and Compiling
When monitoring the sequential control system, you do not receive a status
display for all processed conditions, but only for the selected condition.
With the following formula, you can estimate how much space is required for an
S7 Graph FB and instance DB in the work memory (n = number of steps).
FB = 150 Byte + n * 16 Byte
DB = 236 Byte + n * 26 Byte
Each programmed condition requires an additional 2-4 bytes, each action requires
6-8 bytes.
8-12
05.04.2001
05.04.01
Saving and Compiling
Memory
requirements
Approx. 7750
bytes
Approx. 10700
bytes
Approx. 8150
bytes
Restrictions in terms
of the task
No restriction
No user-defined
parameters,
No restriction
no messages can
be sent and
therefore no
connection to
process
diagnostics
arithm.
functions,
timers, and
counters can
only be used
with S7 Graph
V5.1 and higher
arithm. functions,
timers, and
counters can only
be used with
S7 Graph V5.1
and higher, no
messages with
SFC17/SFC18
no step activation
time (.U)
"Skip Steps"
option not
possible
however
messages can be
sent with SFC52
Restrictions in terms
of the CPU
less than 8
Kbytes and
can be loaded
on smaller
CPUs.
particularly
suitable for
small
applications
(for example
30 steps)
CPU
Can only be
No restriction
loaded on
CPUs that have
SFC17 and
SFC18
(ALARM_S and
ALARM_SQ).
no special
Can only be
No restriction
requirements loaded on
CPUs that have
The 8 Kbyte
limit must be SFC17 and
SFC18
adhered to
(ALARM_S and
both for the
ALARM_SQ).
FB and for
(all S7-400
the DB.
CPUs and all
newer S7-300
CPUs)
No user-specific
step and
transition
numbering
possible
Due to the 8
Kbyte limit,
cannot be
loaded on the
following:
no restrictions
8-13
05.04.2001
05.04.01
Saving and Compiling
The following options are available when you save an open object (block or source
file):
1. Select the menu command File > Save or click the "Save" button in the
toolbar. The object is saved under its present name.
2. If you require a copy of the current object, select the menu command File >
Save As. The "Save As" dialog appears which you can specify the object
name and path of the copy.
3. If you select the menu command File > Close, the Close button or the menu
command File > Exit and the modified object has not yet been saved, you will
be prompted to decide whether or not you want to save or discard the
modifications or cancel the Close command.
Caution
If the sequencer still contains errors, it cannot be saved as an FB. As an
alternative, you can save it as an S7 Graph source file in which you can continue
to work. This allows you to eliminate the errors at a later point in time.
8.6
Compiling
Compiling produces a program that can be understood by the CPU. During
compilation, the syntax of the program is checked, the S7 Graph FB is created and,
if required, the instance DB.
Requirements
Before an FB can be compiled, all the errors must be eliminated. You can have
S7 Graph check your blocks as follows:
8-14
05.04.2001
05.04.01
Saving and Compiling
Caution
If errors are indicated, S7 Graph has not created an FB. You must eliminate the
errors before the S7 Graph FB can be saved.
Caution
If errors are indicated, S7 Graph has not created an FB. You must first eliminate
the errors before you can compile the file into an FB.
8-15
05.04.2001
05.04.01
Saving and Compiling
8-16
05.04.2001
05.04.01
9.1
(1)
FB i
(2)
DB i
(3)
S1
T1
9-1
05.04.2001
05.04.01
S7 Graph FB Parameter Assignment and Call
9.2
Note
You only need to assign values to the parameters of the FB that you actually
require during operation.
9-2
BOOL
EN
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
INT
BOOL
BOOL
BOOL
OFF_SQ
INIT_SQ
ACK_EF
S_PREV
S_NEXT
SW_AUTO
SW_TAP
SW_MAN
S_SEL
S_ON
S_OFF
T_PUSH
ENO
BOOL
S_NO
S_MORE
S_ACTIVE
ERR_FLT
AUTO_ON
TAP_ON
MAN_ON
INT
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
05.04.2001
05.04.01
S7 Graph FB Parameter Assignment and Call
9.3
parameter set
Minimum
Standard
Definable/Maximum
(V5)
You can also modify existing parameter sets in the variable declaration window.
You can, for example, delete unnecessary parameters from a standard parameter
set. System parameters cannot be modified however you can define user-specific
parameters to meet your requirements.
Caution
Defined parameter names must not be used as step names (and vice-versa).
Caution
If you edit a user-defined parameter set and then select a standard parameter set
later in this tab, you will lose the self-defined parameters.
9-3
05.04.2001
05.04.01
S7 Graph FB Parameter Assignment and Call
9.4
Minimum
Standard
DB Sequencer
FB Sequencer
9-4
BOOL
EN
BOOL
INIT_SQ
FB Sequencer
ENO
BOOL
BOOL
EN
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
INT
BOOL
BOOL
BOOL
OFF_SQ
INIT_SQ
ACK_EF
S_PREV
S_NEXT
SW_AUTO
SW_TAP
SW_MAN
S_SEL
S_ON
S_OFF
T_PUSH
ENO
BOOL
S_NO
S_MORE
S_ACTIVE
ERR_FLT
AUTO_ON
TAP_ON
MAN_ON
INT
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
05.04.2001
05.04.01
S7 Graph FB Parameter Assignment and Call
Maximum <= V4
DB Sequencer
FB Sequencer
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
INT
BOOL
BOOL
BOOL
EN
DB Sequencer
FB Sequencer
ENO
S_NO
OFF_SQ
S_MORE
INIT_SQ
S_ACTIVE
ACK_EF
ERR_FLT
HALT_SQ
HALT_TM
SQ_HALTED
ZERO_OP TM_HALTED
EN_IL
OP_ZEROED
EN_SV
IL_ENABLED
S_PREV SV_ENABLED
S_NEXT
AUTO_ON
SW_AUTO
TAP_ON
SW_TAP
MAN_ON
SW_MAN
S_SEL
S_ON
S_OFF
T_PUSH
BOOL
BOOL
INT
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
(*) BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
INT
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
EN
ENO
OFF_SQ
S_NO
INIT_SQ
S_MORE
ACK_EF
S_ACTIVE
REG_EF
S_TIME
ACK_S
S_TIMEOK
REG_S
S_CRITLOC
HALT_SQ
S_CRITLOCERR
HALT_TM
S_CRITSUP
ZERO_OP
S_STATE
EN_IL
T_NO
EN_SV
T_MORE
EN_ACKREQ
T_CRIT
EN_SSKIP
T_CRITOLD
DISP_SACT
T_CRITFLT
L
DISP_SEF
ERROR
DISP_SALL
FAULT
S_PREV
ERR_FLT
S_NEXT
SQ_ISOFF
SW_AUTO
SQ_HALTED
SW_TAP
TM_HALTED
SW_TOP
OP_ZEROED
SW_MAN
IL_ENABLED
S_SEL
SV_ENABLED
S_SELOK
ACKREQ_ENABLED
S_ON
SSKIP_ENABLED
S_OFF
SACT_DISP
T_PREV
SEF_DISP
T_NEXT
SALL_DISP
T_PUSH
AUTO_ON
TAP_ON
TOP_ON
MAN_ON
BOOL
INT
BOOL
BOOL
TIME
TIME (*)
DWORD (*)
DWORD (*)
WORD
INT
BOOL
DWORD (*)
DWORD (*)
DWORD (*)
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL (*)
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
Note: The parameters marked with (*) are not available for FC73
9-5
05.04.2001
05.04.01
S7 Graph FB Parameter Assignment and Call
9.5
Parameter
Data
Type
Description
Min.
Std.
Max. Userdef.
EN
BOOL
OFF_SQ
BOOL
OFF_SEQUENCE:
BOOL
INIT_SEQUENCE:
BOOL
ACKNOWLEDGE_ERROR_FAULT:
BOOL
REGISTRATE_ERROR_FAULT:
BOOL
ACKNOWLEDGE_STEP:
BOOL
REGISTRATE_STEP:
BOOL
HALT_SEQUENCE:
Stop/reactivate sequencer
HALT_TM
BOOL
HALT_TIMES:
BOOL
ZERO_OPERANDS:
BOOL
ENABLE_INTERLOCKS:
BOOL
ENABLE_SUPERVISIONS:
BOOL
ENABLE_ACKNOWLEDGE_REQUIRED:
BOOL
DISPLAY_ACTIVE_STEPS:
BOOL
DISPLAY_STEPS_WITH_ERROR_OR_FAULT:
BOOL
DISPLAY_ALL_STEPS:
9-6
05.04.2001
05.04.01
S7 Graph FB Parameter Assignment and Call
Parameter
Data
Type
Description
S_PREV
BOOL
PREVIOUS_STEP:
Min.
Std.
Max. Userdef.
BOOL
NEXT_STEP:
BOOL
SWITCH_MODE_AUTOMATIC:
Mode change:
Automatic mode:
SW_TAP
BOOL
SWITCH_MODE_TRANSITION_AND_PUSH:
Mode change:
Inching mode ("semi-automatic")
SW_TOP
BOOL
SWITCH_MODE_TRANSITION_OR_PUSH:
Mode change:
Automatic or switch to next
SW_MAN
BOOL
SWITCH_MODE_MANUAL:
Mode change:
Manual mode (automatic execution is not
triggered)
S_SEL
INT
STEP_SELECT:
BOOL
STEP_SELECT_OK:
BOOL
STEP_ON:
BOOL
STEP_OFF:
BOOL
PREVIOUS_TRANSITION:
BOOL
NEXT_TRANSITION:
9-7
05.04.2001
05.04.01
S7 Graph FB Parameter Assignment and Call
Parameter
Data
Type
Description
Min.
T_PUSH
BOOL
PUSH_TRANSITION:
Std.
Max. Userdef.
BOOL
ENABLE_STEP _SKIPPING:
9-8
05.04.2001
05.04.01
S7 Graph FB Parameter Assignment and Call
9.6
Parameter
Data Type
Description
Min.
Std.
Max. Userdef.
ENO
BOOL
S_NO
INT
STEP_NUMBER
BOOL
MORE_STEPS:
BOOL
STEP_ACTIVE
TIME
STEP_TIME
Step activation time
S_TIMEOK
TIME
STEP_TIME_OK:
DWORD
STEP_CRITERIA
DWORD
S_CRITERIA_IL_LAST_ERROR:
STEP_CRITERIA
WORD
STEP_STATE:
Step state bits
T_NO
INT
TRANSITION_NUMBER:
BOOL
MORE_TRANSITIONS:
DWORD
TRANSITION_CRITERIA:
DWORD
T_CRITERIA_LAST_CYCLE:
DWORD
T_CRITERIA_LAST_FAULT:
BOOL
INTERLOCK_ERROR:
BOOL
SUPERVISION_FAULT:
BOOL
IL_ERROR_OR_SV_FAULT:
Group disturbance
SQ_ISOFF
BOOL
SEQUENCE_IS_OFF:
BOOL
SEQUENCE_IS_HALTED:
Sequencer stopped
TM_HALTED
BOOL
TIMES_ARE_HALTED:
Timers stopped
OP_ZEROED
BOOL
OPERANDS_ARE_ZEROED:
Addresses reset
9-9
05.04.2001
05.04.01
S7 Graph FB Parameter Assignment and Call
Parameter
Data Type
Description
Min.
IL_ENABLED
BOOL
INTERLOCK_IS_ENABLED:
Std.
Max. Userdef.
Interlock enabled
SV_ENABLED
BOOL
SUPERVISION_IS_ENABLED:
Supervision enabled
ACKREQ_EN
ABLED
BOOL
SSKIP_EN
ABLED
SACT_DISP
BOOL
ACKNOWLEDGE_REQUIRED_IS_
ENABLED:
STEP_SKIPPING_IS_ENABLED:
ACTIVE_STEPS _WERE_DISPLAYED:
BOOL
STEPS_WITH_ERROR_FAULT_WERE_
DISPLAYED:
BOOL
ALL_STEPS_WERE_DISPLAYED:
BOOL
AUTOMATIC_IS_ON:
BOOL
T_AND_PUSH_IS_ON:
BOOL
T_OR_PUSH_IS_ON:
BOOL
MANUAL_IS_ON:
9.7
9-10
Automatic Mode:
In the automatic mode control passes to the next step when a transition is
satisfied.
Manual mode:
In contrast to the automatic mode, in the manual mode, the next step in not
enabled when the transition is satisfied. The steps are selected and deselected
manually.
Inching mode:
The inching mode corresponds to the automatic mode with an additional step
enabling condition. Not only must the transition be satisfied, but there must
also be a rising edge at the T_PUSH parameter before control passes to the
next step.
05.04.2001
05.04.01
S7 Graph FB Parameter Assignment and Call
Selecting Modes
You select one of the four modes using the input parameters of the FB. Apply a
rising edge to one of the following parameters to activate the corresponding mode.
9.7.1
Data
Description
OFF_SQ
INIT_SQ
ACK_EF
S_PREV
BOOL
BOOL
BOOL
BOOL
S_NEXT
BOOL
SW_TAP
SW_MAN
SW_TOP
BOOL
BOOL
BOOL
9-11
05.04.2001
05.04.01
S7 Graph FB Parameter Assignment and Call
9.7.2
Parameter
Data
Description
S_NO
INT
S_MORE
BOOL
S_ACTIVE
BOOL
ERR_FLT
BOOL
Error/disturbance occurred
AUTO_ON
BOOL
TAP_ON
BOOL
MAN_ON
BOOL
TOP_ON
BOOL
9-12
Parameter
Data
Description
OFF_SQ
BOOL
INIT_SQ
BOOL
ACK_EF
BOOL
Acknowledgment of a disturbance
S_PREV
BOOL
S_NEXT
BOOL
SW_AUTO
BOOL
SW_TAP
BOOL
SW_TOP
BOOL
S_SEL
INT
S_ON
BOOL
S_OFF
BOOL
05.04.2001
05.04.01
S7 Graph FB Parameter Assignment and Call
Data
Description
S_NO
INT
S_MORE
BOOL
S_ACTIVE
BOOL
ERR_FLT
BOOL
Error/disturbance occurred
AUTO_ON
BOOL
TAP_ON
BOOL
MAN_ON
BOOL
TOP_ON
BOOL
Caution
The input parameters DISP_SACT, DISP_SEF, DISP_SALL influence the number
of steps displayed at the S_NO parameter.
In the manual mode, an unsuitable parameter assignment can mean that no step
is displayed.
If you want to display all the steps, set the DISP_SALL parameter to TRUE or
delete the three input parameters DISP_SACT, DISP_SEF, DISP_SALL.
9.7.3
The sequencer passes control when the transition is satisfied and there is an
edge change from 0 to 1 at the parameter T_PUSH.
Data
Description
OFF_SQ
BOOL
INIT_SQ
ACK_EF
S_PREV
S_NEXT
SW_AUTO
SW_MAN
SW_TOP
T_PUSH
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
9-13
05.04.2001
05.04.01
S7 Graph FB Parameter Assignment and Call
9.7.4
Parameter
Data
Description
S_NO
INT
S_MORE
BOOL
S_ACTIVE
BOOL
ERR_FLT
BOOL
Error/disturbance occurred
AUTO_ON
BOOL
TAP_ON
BOOL
MAN_ON
BOOL
TOP_ON
BOOL
9-14
Parameter
Data
Description
OFF_SQ
BOOL
INIT_SQ
BOOL
ACK_EF
BOOL
Acknowledgment of a disturbance
S_PREV
BOOL
As for automatic
S_NEXT
BOOL
As for automatic
SW_AUTO
BOOL
SW_MAN
BOOL
SW_TAP
BOOL
T_PUSH
BOOL
05.04.2001
05.04.01
S7 Graph FB Parameter Assignment and Call
9.7.5
Parameter
Data
Description
S_NO
INT
S_MORE
BOOL
S_ACTIVE
BOOL
ERR_FLT
BOOL
Error/disturbance occurred
AUTO_ON
BOOL
TAP_ON
BOOL
MAN_ON
BOOL
TOP_ON
BOOL
9.7.6
select a previous step (lower step number) with the input parameter
S_PREV,
select a later step (higher step number) with the input parameter S_NEXT.
2. Activate the selected step with the input parameter S_ON (edge change from 0
to 1).
Note
Remember that this procedure can lead to somewhat longer reaction times.
9-15
05.04.2001
05.04.01
S7 Graph FB Parameter Assignment and Call
9.7.7
Caution
If the block is Version V4 (or earlier), the first valid transition switches.
If the block is Version V5 and if the input parameter T_NO is specified, the
transition whose number is displayed switches. If there is no T_NO input
parameter, the first valid transition switches.
9-16
05.04.2001
05.04.01
10.1
The sequential control system consisting of the FB, instance DB and, for
example, OB1 has been created.
-
Whenever possible, download the S7 Graph block in the STOP mode since
following downloading of the instance DB, the sequencer is automatically set to
the initial state.
10-1
05.04.2001
05.04.01
Downloading the S7 Graph-FB and Instance-DB
If you have not clicked "Include instance DB", you yourself must decide
whether or not the instance DB is downloaded as well.
If the FB requires a standard FC, you can specify whether or not this FC is
downloaded as well. If the FC already exists online, this option is
deactivated.
3. If the blocks already exist on the CPU, confirm the prompt to overwrite the
blocks.
Caution
You should only download S7 Graph blocks in the RUN mode when the
sequencer is in the initial state or in the OFF state. If you download the blocks the
sequencer in a different state, when overwriting an old block, problems may occur
in the synchronization of the sequencer with the process. For example, both
latching and non-latching actions of the steps active at the time of downloading
are not reset.
If it is not possible to change the sequencer to the initial state or to the OFF state,
deactivate all steps (for example using the "Control Sequencer" function) before
you download the blocks to the CPU.
10-2
05.04.2001
05.04.01
Downloading the S7 Graph-FB and Instance-DB
10.2
10-3
05.04.2001
05.04.01
Downloading the S7 Graph-FB and Instance-DB
10-4
05.04.2001
05.04.01
Logical errors in the program structure, in other words the program steps and
conditions do not match the actual process sequence you require.
Synchronization
Synchronization is an S7 Graph function with which the sequencer can be
matched to the process.
11-1
05.04.2001
05.04.01
Monitoring and Testing the Sequential Control System
11.1
11.1.1
11-2
05.04.2001
05.04.01
Monitoring and Testing the Sequential Control System
The display indicates whether the entire transition (T), interlock (C) or
supervision (V) is satisfied.
Cond.1
Cond.2
The transition is not satisfied and does not
Not satisfied
Cond.1
satisfied
satisfied
Cond.2
satisfied
Step is active
Signal state
S4
N
A 4.2
S1 S
A 4.3
S0 R
A 4.4
1
1
0
Sequence of execution
11-3
05.04.2001
05.04.01
Monitoring and Testing the Sequential Control System
11.1.2
Control Sequencer
Control Sequencer is a test function with which you can test the sequencer with
S7 Graph in all modes. All the settings and entries for the dialog box have the
same effect as the corresponding FB parameters.
The entries in the "Sequencer Control" dialog box can be different from the settings
you used to compile the sequencers. The dialog box settings have priority.
11.1.3
Synchronization
S7 Graph helps you to locate possible synchronization points between the process
and sequencer.
A process is no longer synchronized when it is changed to a different
statusGlossStatus manually. This can, for example, be the result when you
change to the manual mode in which you can activate any step even if the previous
transition is not satisfied. To be able to continue the process automatically and to
locate possible synchronization points, you can start the Synchronization function.
S7 Graph indicates all steps that meet the following conditions:
The transition before the step is satisfied and the transition following the step is not
satisfied.
Requirements
11-4
The block is compiled with the option "Synchronization". You can find this
option in the tab "Compile / Save" (menu command Options > Block
settings).
05.04.2001
05.04.01
Monitoring and Testing the Sequential Control System
Starting Synchronization
To start synchronization:
1. Select the menu command Debug > Synchronization.
S7 Graph now searches for all steps that meet the synchronization condition
(transition before the step is satisfied and transition after the step is not
satisfied). All steps found are marked yellow.
2. Select one or more of these steps to be selected using the mouse pointer that
changes to a crosshair. You can also select other steps that are not marked
yellow.
Caution
In a simultaneous branch, each path must contain a step to be activated.
11.2
These functions provide you with further methods of debugging and supply
important information about the use of blocks and addresses. You can also select
these test functions directly in the SIMATIC Manager.
Note
If you require more detailed information about these topics, display the help texts
relating to the menu commands in the SIMATIC Manager.
11-5
05.04.2001
05.04.01
Monitoring and Testing the Sequential Control System
From the detailed information about the message, you can found out where the
error occurred.
Details of event: 4 of 100
11-6
05.04.2001
05.04.01
Monitoring and Testing the Sequential Control System
When you save the FB, reference data are created if you have selected this
function in the "General" tab which you can display with the menu command
Options > Application Settings. The "Generate Reference Data" option must
be selected.
With the menu command Options > Reference Data, the reference data are
created when required. Following this, S7 Graph calls the STEP 7 dialog box to
display the reference data.
Cross-reference
Program structure
Reference list
Overview of all the symbols found in the symbol table but not
used in the parts
of the user program for which reference data exist.
11-7
05.04.2001
05.04.01
Monitoring and Testing the Sequential Control System
11-8
05.04.2001
05.04.01
Page format
Current View: The view of the FB as selected in the working area is transferred
to the printer.
According to Settings: Regardless of the current display, the settings you made
in the "Print" tab of the "Application Settings" dialog box are used.
12-1
05.04.2001
05.04.01
Printing the Sequencer
Step view with / without address List, step comment and cross references
Addresses
Block properties
Compiler options
Variables
A dialog box is then opened in which you can select various print options such as
the printer and number of copies.
Confirm with OK to send the document to the printer.
12-2
05.04.2001
05.04.01
13.1
Action
Event
Explanation
Address
range
Instruction
Address
Location Time
Constant
Q, I, M,
D
m.n
0.0 to
65535.7
Q, I, M,
D
m.n
0.0 to
65535.7
Q, I, M,
D
m.n
0.0 to
65535.7
Q, I, M,
D
m.n
Q, I, M,
D
m.n
CALL
FB, FC,
SFB,
SFC
Block
number
NC
Q, I, M,
D
m.n
SC
Q, I, M,
D
m.n
RC
Q, I, M,
D
m.n
0.0 to
65535.7
13-1
05.04.2001
05.04.01
Overview of all Actions
Action
Event
Explanation
Address
range
Instruction
Address
Location Time
Constant
DC
Q, I, M,
D
m.n
LC
Q, I, M,
D
m.n
CALL
C
FB, FC,
SFB,
SFC
Block
number
13.2
Explanation
Address
range
Event
InAddress
struction
S1
Q, I, M, D m.n
0.0 to
65535.7
S1
Q, I, M, D
m.n
0.0 to
65535.7
S1
Q, I, M, D m.n
0.0 to
65535.7
S1
Block
number
S1
ON
i = step
number
S1
OFF
i = step
number
13-2
Location
05.04.2001
05.04.01
Overview of all Actions
Action
Explanation
Location
Address
range
Event
InAddress
struction
S1
OFF
S_ALL
S1
NC
Q,I,M,D
S1
SC
S1
RC
S1
Block
number
S1
ONC
i = step
number
S1
OFFC S
i = step
number
S1
OFFC S_ALL
0.0 to
65535.7
Q, I, M, D m.n
0.0 to
65535.7
Q, I, M, D m.n
0.0 to
65535.7
13-3
05.04.2001
05.04.01
Overview of all Actions
Explanation
Location
Address
range
Event
Address
Instruction
S0
Q, I, M, D m.n
S0
Q, I, M, D m.n
0.0 to
65535.7
S0
Q, I, M, D m.n
0.0 to
65535.7
S0
Block
number
S0
ON
i = step
number
S0
OFF
i = step
number
Explanation
Address
range
m.n
0.0 to
65535.7
Q,I,M,D
m.n
Q,I,M,D
m.n
Block
number
V1
ON
0.0 to
65535.7
V1
OFF
0.0 to
65535.7
Event
InAddress
struction
Location
V1
Q,I,M,D
V1
V1
V1
13-4
05.04.2001
05.04.01
Overview of all Actions
Action
Explanation
Address
range
0.0 to
65535.7
Event
InAddress
struction
Location
V1
OFF
S_ALL
V1
NC
Q,I,M,D
Mn
0.0 to
65535.7
V1
SC
Q,I,M,D
m.n
0.0 to
65535.7
V1
RC
Q,I,M,D
m.n
0.0 to
65535.7
V1
Block
number
V1
ONC
0.0 to
65535.7
V1
OFFC S
0.0 to
65535.7
V1
OFFC S_ALL
0.0 to
65535.7
13-5
05.04.2001
05.04.01
Overview of all Actions
V0
Address Location
Instruction
N
Q,I,M,D m.n
V0
Q,I,M,D
m.n
V0
Q,I,M,D
m.n
V0
V0
CALL FB,
FC,
SFB,
SFC
ON
S
V0
OFF
Event
Explanation
Address
range
0.0 to
65535.7
i = step
number
i = step
number
0.0 to
65535.7
0.0 to
65535.7
L0
Address
Instruction
N
Q,I,M,D
m.n
L0
Q,I,M,D
m.n
L0
Q,I,M,D
m.n
L0
L0
L0
OFF
Event
13-6
Explanation
Address
range
0.0 to
65535.7
Location
Block
number
0.0 to
65535.7
0.0 to
65535.7
i = step
number
i = step
number
05.04.2001
05.04.01
Overview of all Actions
Explanation
Address
range
0.0 to
65535.7
Event
Address
Instruction
Location
L1
Q,I,M,D
m.n
L1
Q,I,M,D
m.n
L1
Q,I,M,D
m.n
L1
Block
number
L1
ON
L1
OFF
L1
OFF
S_ALL
13-7
05.04.2001
05.04.01
Overview of all Actions
A1
Address
Instruction
N
Q,I,M,D
m.n
A1
Q,I,M,D
m.n
A1
Q,I,M,D
m.n
A1
Block
number
A1
A1
OFF
A1
NC
Q,I,M,D
m.n
A1
SC
Q,I,M,D
m.n
A1
RC
Q,I,M,D
m.n
A1
Block
number
A1
A1
OFFC S
Event
Explanation
Address
range
0.0 to
65535.7
0.0 to
65535.7
0.0 to
65535.7
i = step
number
i = step
number
0.0 to
65535.7
Location
0.0 to
65535.7
0.0 to
65535.7
i = step
number
i = step
number
InAddress
struction
N
Q,I,M,D
m.n
R1
Q,I,M,D
m.n
R1
Q,I,M,D
m.n
R1
13-8
Explanation
Address
range
0.0 to
65535.7
0.0 to
65535.7
0.0 to
65535.7
Location
Block
number
05.04.2001
05.04.01
Overview of all Actions
Action
Event
Explanation
Address
range
i = step
number
i = step
number
0.0 to
65535.7
R1
InAddress
struction
ON
S
Location
R1
OFF
R1
NC
Q,I,M,D
m.n
R1
SC
Q,I,M,D
m.n
R1
RC
Q,I,M,D
m.n
R1
Block
number
R1
R1
OFFC S
0.0 to
65535.7
0.0 to
65535.7
i = step
number
i = step
number
13-9
05.04.2001
05.04.01
Overview of all Actions
13.3
Counters in Actions
These actions are executed once when the event occurs and the corresponding
step is active. When the sequencer is run through after this, an event-dependent
action is executed again only if the event reoccurs.
Explanation
Address
range
Event
Instruction
Address
Location
S1
CS
x=
counter
number
<initial
counter
value>
S1
CU
x=
counter
number
S1
CD
x=
counter
number
S1
CR
x=
counter
number
S1
CSC
x=
counter
number
<initial
counter
value>
S1
CUC
S1
CDC
S1
CRC
13-10
05.04.2001
05.04.01
Overview of all Actions
Explanation
Address
range
Event
Instruction
Address
Location
S0
CS
x=
counter
number
<initial
counter
value>
S0
CU
x=
counter
number
S0
CD
x=
counter
number
S0
CR
x=
counter
number
Explanation
Address
range
Event
Instruction
Address
Location
L1
CS
<initial
counter
value>
L1
CU
L1
CD
L1
CR
13-11
05.04.2001
05.04.01
Overview of all Actions
Explanation
Address
range
Event
Instruction
Address
Location
L0
CS
x=
counter
number
<initial
counter
value>
L0
CU
x=
counter
number
L0
CD
x=
counter
number
L0
CR
Explanation
Address
range
Event
Instruction
Address
Location
V1
CS
x=
counter
number
<initial
counter
value>
V1
CU
x=
counter
number
V1
CD
x=
counter
number
V1
CR
x=
counter
number
V1
CSC
x=
counter
number
<initial
counter
value>
13-12
05.04.2001
05.04.01
Overview of all Actions
Action
Explanation
Address
range
Event
Instruction
Address
Location
V1
CUC
x=
counter
number
V1
CDC
x=
counter
number
V1
CRC
Explanation
Address
range
Event
Instruction
Address
Location
V0
CS
x=
counter
number
<initial
counter
value>
V0
CU
x=
counter
number
V0
CD
x=
counter
number
V0
CR
13-13
05.04.2001
05.04.01
Overview of all Actions
Explanation
Address
range
Event
Instruction
Address
Location
A1
CS
<initial
counter
value>
A1
CU
x=
counter
number
A1
CD
x=
counter
number
A1
CR
x=
counter
number
A1
CSC
x=
counter
number
<initial
counter
value>
A1
CUC
x=
counter
number
A1
CDC
x=
counter
number
A1
CRC
Explanation
Address
range
Event
Instruction
Address
Location
R1
CS
x=
counter
number
<initial
counter
value>
R1
CU
x=
counter
number
R1
CD
x=
counter
number
13-14
05.04.2001
05.04.01
Overview of all Actions
Action
Explanation
Address
range
Event
Instruction
Address
Location
R1
CR
R1
CSC
x=
counter
number
<initial
counter
value>
R1
CUC
x=
counter
number
R1
CDC
x=
counter
number
R1
CRC
x=
counter
number
13-15
05.04.2001
05.04.01
Overview of all Actions
13.4
Timers in Actions
These actions are executed once when the event occurs and the corresponding
step is active. When the sequencer is run through after this, an event-dependent
action is executed again only if the event reoccurs.
Explanation
Address
range
Event
Instruction
Address
Location
S1
TL
x = no.
of timer
x = no.
of timer
x = no.
of timer
<time>
S1
TD
T
<time>
S1
TR
S1
TLC
<time>
S1
TDC
T
<time>
S1
13-16
TRC
05.04.2001
05.04.01
Overview of all Actions
Explanation
Address
range
Event
Instruction
Address
Location
S0
TL
x = no.
of timer
x = no.
of timer
x = no.
of timer
<time>
S0
TD
T
<time>
S0
TR
Explanation
Address
range
Event
Instruction
Address
Location
L1
TL
<time>
L1
TD
T
<time>
L1
TR
x = no.
of timer
13-17
05.04.2001
05.04.01
Overview of all Actions
Explanation
Address
range
Event
Instruction
Address
Location
L0
TL
<time>
L0
TD
T
<time>
L0
13-18
TR
x = no.
of timer
05.04.2001
05.04.01
Overview of all Actions
Explanation
Address
range
Event
Instruction
Address
Location
V1
TL
x = no.
of timer
x = no.
of timer
<time>
V1
TD
T
<time>
V1
TR
x = no.
of timer
V1
TLC
x = no.
of timer
x = no.
of timer
<time>
V1
TDC
T
<time>
V1
TRC
13-19
05.04.2001
05.04.01
Overview of all Actions
Explanation
Address
range
Event
Instruction
Address
Location
V0
TL
<time>
V0
TD
T
<time>
V0
TR
Explanation
Address
range
Event
Instruction
Address
Location
A1
TL
x = no.
of timer
x = no.
of timer
<time>
A1
TD
T
<time>
A1
TR
x = no.
of timer
A1
TLC
x = no.
of timer
<time>
13-20
05.04.2001
05.04.01
Overview of all Actions
Action
Explanation
Address
range
x = no.
of timer
Event
Instruction
Address
Location
A1
TDC
T
<time>
A1
TRC
Explanation
Address
range
Event
Instruction
Address
Location
R1
TL
x = no.
of timer
x = no.
of timer
<time>
R1
TD
T
<time>
R1
TR
R1
TLC
<time>
R1
TDC
T
<time>
R1
TRC
13-21
05.04.2001
05.04.01
Overview of all Actions
13.5
Arithmetic in Actions
These actions are either executed in every cycle in which the relevant step is active
or once when the relevant event occurs.
Action
Explanation
Event
Instruction
Assignment
--
A:=B
A:=func(B)
A:=B<operator>C
--
NC
A:=B
A:=func(B)
A:=B<operator>C
Explanation
Event
Instruction
Assignment
S1
A:=B
A:=func(B)
A:=B<operator>C
S1
NC
A:=B
A:=func(B)
A:=B<operator>C
13-22
05.04.2001
05.04.01
Overview of all Actions
Explanation
Event
Instruction
Assignment
S0
A:=B
A:=func(B)
A:=B<operator>C
Explanation
Event
Instruction
Assignment
L1
A:=B
A:=func(B)
A:=B<operator>C
Explanation
Event
InAssignment
struction
L0
A:=B
A:=func(B)
A:=B<operator>C
Explanation
Event
InAssignment
struction
V1
A:=B
A:=func(B)
A:=B<operator>C
V1
NC
A:=B
A:=func(B)
A:=B<operator>C
13-23
05.04.2001
05.04.01
Overview of all Actions
Explanation
Event
Instruction
Assignment
V0
A:=B
A:=func(B)
A:=B<operator>C
Explanation
Event
Instruction
A1
Assignment
A:=B
A:=func(B)
A:=B<operator>C
A1
NC
A:=B
A:=func(B)
A:=B<operator>C
Explanation
Event
Instruction
R1
Assignment
A:=B
A:=func(B)
A:=B<operator>C
R1
NC
A:=B
A:=func(B)
A:=B<operator>C
13-24
05.04.2001
05.04.01
14 Configuration Instructions
Introduction
To automate your sequential control system with S7 Graph, in addition to the
functions for the automatic mode, a range of further functions is also available.
Before you can use the S7 Graph functions, you must make sure that certain
conditions are met. To make it easier for you to get used to S7 Graph, the most
important points are summarized in this chapter in the form of brief configuration
instructions.
The following aspects are dealt with:
Which general structures exist and how do these affect the program structure
of the sequencer?
14-1
05.04.2001
05.04.01
Configuration Instructions
14.1
General
Cell level
Enable
operation
Modes
Station 1: Insert
Coordination
level
Station n: Save
Turn
Save,
remove
Insert,
weld
Utilities
Turntable
Function or
unit level
Pneumatics
Hydraulics
Centere
r
Clamp
Coolant
Motor memory
Conveyor belt
14-2
Cell level
The cell level encompasses functions with a central or wider reaching
significance, for example preparations for enabling operation and modes.
The blocks at the cell level provide signals that are relevant for all blocks of the
coordination and unit level in this cell.
Coordination level
The coordination level includes various coordination functions, for example for
the automatic mode and retraction following a break in operation. For each
station, at least one sequencer is required for coordination at this level.
Unit level
The unit level includes functions for activating individual units of equipment, for
example motors and valves. This includes all the lower-level functions, for
example interlocks and supervision conditions independent of the sequencer
and direct manual intervention in the operation of the units.
05.04.2001
05.04.01
Configuration Instructions
OB 1
(cyclic)
Modes
General
functions
Release operation
Station n Save
Sequencers
Station 1 Turn
Station 1
Insert, weld
Unit station n
Unit station 1
Manual mode,
Interlocks
Hydraulics
Pneumatics
Poss. robot
interface
The various functions at the individual levels are executed cyclically in the order in
which they are called:
The sequencers are preceded by the central, higher-level functions of the cell
level.
The program sections for manual mode, the interlocks and permanent
monitoring functions for the units follow the sequencers.
If the manufacturing cell includes robots, program sections for supplying and
clearing robot interface are also required.
14-3
05.04.2001
05.04.01
Configuration Instructions
Enabling Operation
In production facilities, utilities such as hydraulic and pneumatic systems are often
required and the functions of all other units depend on them being available. It
therefore makes sense to turn on the hydraulic and pneumatic systems centrally
after turning on the machinery and to generate ready signals for the other blocks.
The following diagram is an example of how general operation of the system can
be enabled in S7 Graph.
Init
R "Unit_ready"
R "Process_enabled"
S1
Init
"Controlpow_ok"
CMP
Init.U
T1
Trans1
>=D
T5
T6
MD6
"Hydraulic_ok" "Pneumatic_ok"
S2
Con...
Controller_on
N "Controller_on"
T2
Trans2
S3
Uni...
Unit_ready
N "Unit_ready"
"Central_start"
T3
Trans3
Process_enabled
N "Unit_ready"
N "Process_enabled"
S4
Pro...
"Emer_off"
T4
"Door_
closed"
Trans4
S5
Pro...
"Acknowledge"
No_Process_enabled
T5
Trans5
S2
"Hydraulic_ok"
T6
"Pneumatic_ok"
Trans6
S2
14-4
After turning on the controller, step 1 (initial step) is activated using the
INIT_SQ parameter and the signals Unit_ready and Process_enabled are
reset.
After a specified minimum waiting time, step 2 turns on the hydraulic and
pneumatic units dependent on the signal Controlpow_ok (control voltage OK)
using the Controller_on action.
05.04.2001
05.04.01
Configuration Instructions
After the feedback indicating that the hydraulic and pneumatic systems are OK,
step 3 outputs the message Unit_ready (to various recipients including the
central controller).
If a step enabling condition from one of the power systems is canceled while
the Process_enabled (step 4) is active, the enable signals are also canceled
with the change to step 2. Once the step enabling conditions ("OK_Signal") of
the power systems are present again, Central_start can return the unit to the
enabled state again.
The "Unit_ready" signal also enables the mode selection in the mode block.
Handling Modes
Depending on the situation, the user requires different modes for the system and
machinery. In unlinked manufacturing cells, for example in body work assembly,
these are the modes:
Automatic
Inching, in other words a variant of the automatic mode with a stop after each
process step
14-5
05.04.2001
05.04.01
Configuration Instructions
The modes, however, do not have the same effects at all levels. The following
overview lists the modes and their effects at the coordination level and unit level
(motors, valves etc.).
Mode
Automatic
Inching
Automatic or
step
by step mode
Manual or
setup
FB sequencer n
Seq_Auto
SW_AUTO
SW_TAP
SW_MAN
Seq_Inch
FB sequencer 1
Mode setting
Process
enable
Autom.
&
Inching
&
&
Manual
>1
_
&
Seq_Man
SW_AUTO
SW_TAP
SW_MAN
Unit_Hand
>1
_
Unit_Auto
FB unit group n
Automatic
Manual
FB unit group 1
Automatic
manual
The modes selected at the console are passed on to the sequencers when
Process_enabled is active. If Process_enabled is not set, the modes of the
sequencers are switched to SW_MAN and step enabling is suppressed.
14-6
05.04.2001
05.04.01
Configuration Instructions
In the automatic or inching modes, the automatic mode is set for the unit functions.
The manual mode is passed on directly. If there is no process_enabled, both
modes are reset and the process is stopped. The functions of the unit groups are
represented in an FB created with LAD/FBD or STL.
FB sequencer
S4
Spind_on
S
S5
Mot_on
Execute
S
KM_on
Carr_fwd
FB interlock/manual control
Cnd1
Cnd2
Cnd3
Cnd4
&
Carr_fwd
Autom.
&
Man
Btn_fwd
Enable_fwd
( )
_>1
&
Valve1_fwd
&
( )
Enable_fwd
The permanent monitoring functions required for the units can be programmed with
S7 PDIAG. Depending on the requirements, the supervision conditions can be
formulated so that they are effective both in the automatic and manual modes or
specific supervision conditions are programmed for the automatic mode and for the
manual mode.
14-7
05.04.2001
05.04.01
Configuration Instructions
14.2
Initialization
The sequencer is initialized using the INIT_SQ parameter. If this changes to "1", all
steps marked as initial steps are activated. All other steps are deactivated.
After turning on the controller, the sequencer is in the same mode as it was when
the controller was turned off, in other words if the controller was in the SW_AUTO
mode before it was turned off, it will be in this mode when it is turned on again. If
you want to avoid this, the sequencer must be set to the required mode (for
example SW_MAN) explicitly when it is turned on, for example using the
initialization signal.
If the status of the process (system or machine) does not correspond to the initial
state of the sequencer, you can deal with this in two ways:
The process is, for example, changed to the initial state by a command.
If you want to change the process to the initial state, it is usually advisable to
create a separate sequencer for this purpose.
The sequencer must be synchronized with the process state using the
synchronize function, in other words, the sequencer must be set to the current
part of the process.
Interlocks
In S7 Graph, interlocks can be defined for each step. All actions that are executed
depending on a condition are only activated when the interlock conditions are
satisfied.
If the interlock conditions are not satisfied when the step is active, an error
message is sent to the console (for example operator panel). The error is cleared
when the interlock conditions are satisfied.
Supervisions
In S7 Graph, monitoring conditions can be defined in the form of supervisions for
each step. The most common supervision condition is the execution time of the
actions. If the supervision condition is satisfied, in other words an error has
occurred, an error message is sent to the console (for example operator panel).
Such errors are acknowledged via the ACK_EF parameter.
The compilation settings (menu command Options > Block Settings) decide
whether an acknowledgment is be required when an S7 Graph FB is created.
14-8
05.04.2001
05.04.01
Configuration Instructions
Caution
If the step enabling condition is satisfied during the acknowledgment cycle, the
next step is enabled.
Please remember that the supervisions defined in the sequencer are specific to a
particular step and only monitor the execute time of the relevant actions. If, for
example, a motor is turned on in step 1, the run-up time can be monitored in step
1. Once this step is deactivated, the motor is no longer monitored in the
sequencer. If you want the motor to be monitored permanently and independent of
the sequencer, this must implemented at the underlying unit level.
Abort Situations
Abort situations occur when an "immediate stop" or "emergency off" is set due to a
critical situation or when a fault occurs in units. In these situations, the following
operations are carried out:
At the unit level, the output signals are deactivated by resetting the automatic
enable.
Synchronization
Synchronization of the sequencer with the state of the process or machine is
required at least in the following situations:
Case 1: A program change in the installation and startup phase meant that the
instance DB had to be regenerated.
Case 2: In the manual mode, units were controlled manually so that the state
of the sequencer no longer corresponds to the state of the process or machine.
Following a manual intervention, and depending on the process, the automatic
mode must be resumed starting at the current state of the system or machine;
in other words, the current position of the sequencer must be adapted to the
process (synchronized).
In Case 1, the menu command Debug > Control Sequencer can be used in the
manual mode to set and reset steps directly when working on the programming
device so that the state that existed before the program change can be set.
14-9
05.04.2001
05.04.01
Configuration Instructions
Caution
With the menu command Debug > Control Sequencer, you can change the
mode of the sequencer directly in S7 Graph. If the sequencer and underlying
monitoring/manual functions are supplied with parameters as described in
Handling Modes, this means that the mode of the sequencer no longer matches
the underlying function. If you want to prevent this, the mode change triggered on
the programming device can be disabled. The following diagram illustrates the
principle.
14-10
05.04.2001
05.04.01
Configuration Instructions
FB sequencer
Autom.
&
Inch
&
Man
&
SW_AUTO
SW_TAP
SW_MAN
AUTO_ON
TAP_ON
MAN_ON
With this logic, the sequencer is reset to the state set by the signals
automatic/inching/manual after one cycle.
14-11
05.04.2001
05.04.01
Configuration Instructions
14.3
PG
S7 Graph
OP
FB sequencer
S4
Spind_On
S Mot_Ein
Execute
S KM_on
N Carr_fwd
S5
ProTool
with
ProAgent
OP
project
Diagnostic
data
FB/DB
PLC
FB/DB
SFC 17/18
Message
memory
Message frame
Message no., step no.
14-12
05.04.2001
Configuration Instructions
Display of the current state of the sequencer with current sequencer names
and step names
If you have modified addresses in the SIMATIC manager using the Rewire menu
command, and the addresses are also used by the sequencer, the corresponding
diagnostic data are only updated when you open the corresponding S7 Graph FB
again and save it.
Creating Messages
To display disturbances on, for example, an operator panel, you must click the
option "Message with ALARM_SQ/ALARM_S (SFC17/SFC18) in the "Messages"
tab that you can display with the menu command Options > Block Settings. If this
option is selected, a message is entered in the message memory of the CPU by
the selected SFC and automatically transferred to the operator panels. The
message frame contains not only the automatically assigned message number but
also the current step number so that the operator panel can display the
corresponding texts and depending on the display, the corresponding conditions.
Apart from the message, a group error bit is also set that is displayed on the
operator panel depending on the display.
The following displays are available on the operator panel for the sequencer:
Overview level
All units are displayed with their current step. Each sequencer block represents
such a unit. If a sequencer has a disturbance, this line is marked by . I f this
line is selected, you can change directly to the detailed display level with a
function key.
14-13
05.04.2001
05.04.01
Configuration Instructions
Detailed display
The network affected is displayed in Ladder Logic or statement list
representation and the missing conditions are marked. In the display, you also
have the option of displaying the entire network or the reduced network
containing only the conditions affected. This is particularly useful with more
extensive logic operations.
Note
If you use the standard FC71, you do not require the SFC17/SFC18 blocks.
Messages are, however, processed using SFC52 ("WR_USMSG").
If you use the standard FC73, no messages are generated due to the
minimized memory configuration.
14-14
05.04.2001
05.04.01
15 Instance DB
Each S7 Graph FB is assigned an instance data block that can be understood as
representing the memory of the FB. It contains the data belonging to the
sequencer, in other words all the data and parameters required to execute the FB:
step-transition description (for example current or last activation time of a step with
and without disturbance times; indicator whether or not a step is active).
The data are entered automatically.
15.1
Include Instance DB
To create the instance DB automatically after compiling an error-free FB, click the
option "Include Instance DB" in the "General" tab (menu command Options >
Application Settings). If you select this option, whenever you compile or
download the block, S7 Graph checks whether it is necessary to create or update
the instance DB and takes whatever action is necessary.
Interface Description
In the "Save/Compile" tab, there are three possible settings for the interface
description of the instance DB:
Structure Arrays
The interface descriptions are stored in the instance DB as fields (ARRAYs).
This option optimizes the memory requirements of your S7 Graph function
block. The step names are, however, not stored. Symbolic addressing of other
blocks is not possible in this case.
15-1
05.04.2001
05.04.01
Instance DB
15.2
Individual Structures
The interface descriptions are stored in the instance DB as structures
(STRUCT). A separate structure with detailed information is created for each
step and each transition of the sequencer. This is a convenient method
allowing internal and external access using symbolic names. The instance DB
can be evaluated both using direct access to the data or using the step and
transition names. The structures increase the size of the instance DB but do
not affect the performance when executing the sequencer.
Select the menu command File > Modify/Adapt Instance DB Number and
enter a new DB name in the dialog box that is opened. An instance DB
matching the FB is created.
15-2
05.04.2001
05.04.01
Instance DB
15.3
Program the S7 Graph FB and select the menu command File > Save.
Result: The S7 Graph FB is saved and the instance DB is created.
Caution
The data block must not be created manually or deleted if you have set the option
"message with ALARM_SQ / ALARM_S (SFC17 / SFC18)" in the "Messages" tab
(menu command Options > Block Settings) otherwise messages can be lost.
The instance data block is then included automatically.
15.4
15.5
15-3
05.04.2001
05.04.01
Instance DB
15.6
15.7
Structure of an Instance DB
The structure of the instance DB depends on the settings you make in the
"Compile / Save" tab (menu command Options > Block Settings ). The following
factors affect the content and the size.
1. The parameter set selected for the FB
2. The interface description for the data belonging to steps and transitions
(memory minimized/structure arrays/individual structures). The data are
entered automatically.
3. The option of entering criteria analysis data.
4. Number and size of user-defined variables
15.8
Area
Identifier
Length
FB parameters
G7T_0
16 bytes
Transitions
G7S_0
32 bytes
Steps
Sequencer status
15-4
05.04.2001
05.04.01
Instance DB
15.9
FB Parameters
The FB parameters are located in the instance DB. The space required by the FB
parameters depends on the setting (minimum, standard, maximum or user-defined
parameter set) made in the "Compile / Save" tab selected with the menu command
Options > Block Settings. (If, for example, the minimum parameter set is
selected, INIT_SQ is the only parameter displayed).
The following table shows the maximum parameter set V5 (definable).
Parameter
Description
Data
Type
Read
int.
Write int.
Read
Ext.
Write Ext.
OFF_SQ
OFF_SEQUENCE:
BOOL
yes
no
yes
no
BOOL
yes
no
yes
no
BOOL
yes
no
yes
no
BOOL
yes
no
yes
no
BOOL
yes
no
yes
no
BOOL
yes
no
yes
no
BOOL
yes
no
yes
no
BOOL
yes
no
yes
no
BOOL
yes
no
yes
no
BOOL
yes
no
yes
no
BOOL
yes
no
yes
no
BOOL
yes
no
yes
no
BOOL
yes
no
yes
no
BOOL
yes
no
yes
no
INIT_SEQUENCE:
Initialize sequencer
ACK_EF
ACKNOWLEDGE_ERROR_FAULT:
REGISTRATE_ERROR_FAULT:
ACKNOWLEDGE_STEP
REGISTRATE_STEP
HALT_SEQUENCE
Stop/reactivate sequencer
HALT_TM
HALT_TIMES:
ZERO_OPERANDS:
ENABLE_INTERLOCKS:
Deactivate/reactivate interlocks
EN_SV
ENABLE_SUPERVISIONS:
Deactivate/reactivate supervisions
EN_ACKREQ
ENABLE_ACKNOWLEDGE_
REQUIRED:
Activate mandatory
acknowledgment
EN_SSKIP
ENABLE_STEP _SKIPPING:
DISPLAY_ACTIVE_STEPS:
15-5
05.04.2001
05.04.01
Instance DB
Parameter
Description
Data
Type
Read
int.
Write int.
Read
Ext.
Write Ext.
DISP_SEF
DISPLAY_STEPS_WITH_ERROR_
OR_FAULT:
BOOL
yes
no
yes
no
BOOL
yes
no
yes
no
BOOL
yes
no
yes
no
BOOL
yes
no
yes
no
BOOL
yes
no
yes
no
BOOL
yes
no
yes
no
SWITCH_MODE_TRANSITION_OR_PU BOOL
SH:
yes
no
yes
no
BOOL
yes
no
yes
no
INT
yes
no
yes
no
BOOL
yes
no
yes
no
BOOL
yes
no
yes
no
BOOL
yes
no
yes
no
BOOL
yes
no
yes
no
BOOL
yes
no
yes
no
DISPLAY_ALL_STEPS:
PREVIOUS_STEP:
NEXT_STEP:
SWITCH_MODE_AUTOMATIC:
SWITCH_MODE_TRANSITION_AND
_PUSH:
Mode change:
Automatic or switch to next
SW_MAN
SWITCH_MODE_MANUAL:
STEP_SELECT:
STEP_SELECT_OK:
STEP_ON:
STEP_OFF:
PREVIOUS_TRANSITION:
NEXT_TRANSITION:
15-6
05.04.2001
05.04.01
Instance DB
Parameter
Description
Data
Type
Read
int.
Write int.
Read
Ext.
Write Ext.
T_PUSH
PUSH_TRANSITION:
BOOL
yes
no
yes
no
INT
yes
no
yes
no
BOOL
yes
no
yes
no
BOOL
yes
no
yes
no
STEP_NUMBER
MORE_STEPS:
STEP_ACTIVE
STEP_TIME
Step activation time
TIME
yes
no
yes
no
S_TIMEOK
STEP_TIME_OK:
TIME
yes
no
yes
no
DWOR yes
D
no
yes
no
DWOR yes
D
no
yes
no
DWOR yes
D
no
yes
no
STEP_CRITERIA_INTERLOCK:
S_CRITERIA_IL_LAST_ERROR:
S_CRITSUP
STEP_CRITERIA_SUPERVISION:
S_STATE
STEP_STATE:
Step state bits
WORD yes
no
yes
no
T_NO
TRANSITION_NUMBER:
INT
yes
no
yes
no
BOOL
yes
no
yes
no
DWOR yes
D
no
yes
no
DWOR yes
D
no
yes
no
DWOR yes
D
no
yes
no
BOOL
yes
no
yes
no
BOOL
yes
no
yes
no
BOOL
yes
no
yes
no
BOOL
yes
no
yes
no
BOOL
yes
no
yes
no
BOOL
yes
no
yes
no
MORE_TRANSITIONS:
TRANSITION_CRITERIA:
T_CRITERIA_LAST_CYCLE:
T_CRITERIA_LAST_FAULT:
SUPERVISION_FAULT:
IL_ERROR_OR_SV_FAULT:
Group disturbance
SQ_ISOFF
SEQUENCE_IS_OFF:
Sequencer off
SQ_HALTED
SEQUENCE_IS_HALTED:
Sequencer stopped
TM_HALTED
TIMES_ARE_HALTED:
Timers stopped
15-7
05.04.2001
05.04.01
Instance DB
Parameter
Description
Data
Type
Read
int.
Write int.
Read
Ext.
Write Ext.
OP_ZEROED
OPERANDS_ARE_ZEROED:
BOOL
yes
no
yes
no
BOOL
yes
no
yes
no
BOOL
yes
no
yes
no
BOOL
yes
no
yes
no
BOOL
yes
no
yes
no
BOOL
yes
no
yes
no
BOOL
yes
no
yes
no
BOOL
yes
no
yes
no
BOOL
yes
no
yes
no
BOOL
yes
no
yes
no
BOOL
yes
no
yes
no
BOOL
yes
no
yes
no
Addresses reset
IL_ENABLED
INTERLOCK_IS_ENABLED:
SUPERVISION_IS_ENABLED:
ACKNOWLEDGE_REQUIRED_IS_
ENABLED:
Mandatory acknowledgment
activated
SSKIP_EN
ABLED
STEP_SKIPPING_IS_ENABLED:
SACT_DISP
ACTIVE_STEPS_WERE_DISPLAYED
SEF_DISP
STEPS_WITH_ERROR_FAULT_WERE
_
DISPLAYED:
ALL_STEPS_WERE_DISPLAYED:
AUTOMATIC_IS_ON:
T_AND_PUSH_IS_ON:
T_OR_PUSH_IS_ON:
MANUAL_IS_ON:
15-8
05.04.2001
05.04.01
Instance DB
Description
Data
Type
Read
int.
Write int.
Read
Ext.
Write Ext.
TV
Transition is valid
BOOL
yes
no
yes
no
TT
Transition is satisfied
BOOL
yes
no
yes
no
TS
Transition switches
BOOL
yes
no
yes
no
CF_IV
BOOL
yes
no
yes
no
TNO
no
no
yes
no
CRIT
no
yes
no
CRIT_OLD
no
yes
no
CRIT_FLT
no
yes
no
DWORD yes
Length in Bytes
G7T
(number of transitions) 16
Internal access uses the transition number followed by the name of the structural
element.
This means that the following access is possible in conditions or actions:
T003.TT
T017.CRIT
15-9
05.04.2001
05.04.01
Instance DB
External access uses only the array element followed by the name of the structural
element.
Caution: The array index is the internal transition number and not the number
assigned by the user.
G7T[1].TT
G7T[3].CRIT
Length in Bytes
<Aktionen_Transition>
16
...
<ASCII_Transition>
16
Internal access uses the transition number or the transition name followed by the
name of the structural element.
This means that the following access is possible in conditions or actions:
T003.TT
T017.CRIT
VALVE_ON.TT
External access uses only the transition name (structure name) followed by the
name of the structural element.
15-10
VALVE_ON.TT
VALVE_ON.CRIT
05.04.2001
05.04.01
Instance DB
Data
Type
Read
int.
Write int.
Read
Ext.
Write Ext.
S1
Step is activated
BOOL
yes
no
yes
no
L1
BOOL
yes
no
yes
no
V1
BOOL
yes
no
yes
no
R1
Reserved
BOOL
no
no
no
no
A1
Error is acknowledged
BOOL
yes
no
yes
no
S0
Step is deactivated
BOOL
yes
no
yes
no
L0
BOOL
yes
no
yes
no
V0
BOOL
yes
no
yes
no
Step is active
BOOL
yes
no
yes
no
LA
BOOL
yes
no
yes
no
VA
Supervision active
BOOL
yes
no
yes
no
RA
Reserved
BOOL
no
no
no
no
AA
Reserved
BOOL
no
no
no
no
SS
System-internal
BOOL
no
no
no
no
LS
BOOL
yes
no
yes
no
VS
BOOL
yes
no
yes
no
SNO
INT
no
no
yes
no
TIME
yes
no
yes
no
TIME
yes
no
yes
no
CRIT_LOC
yes
no
yes
no
DWORD
yes
no
yes
no
yes
no
yes
no
SM
System-internal
BOOL
no
no
no
no
LP
System-internal
BOOL
no
no
no
no
LN
System-internal
BOOL
no
no
no
no
VP
System-internal
BOOL
no
no
no
no
VN
System-internal
BOOL
no
no
no
no
H_IL_ERR
System-internal
BYTE
no
no
no
no
H_SV_FLT
System-internal
RESERVED Reserve
BYTE
no
no
no
no
DWORD
no
no
no
no
15-11
05.04.2001
05.04.01
Instance DB
Length in Bytes
G7S
(number of steps) 32
Internal access uses the step number followed by the name of the structural
element.
This means that the following access is possible in conditions or actions:
S003.X
S017.T
External access uses only the array element followed by the name of the structural
element.
Caution: The array index is the internal step number and not the number assigned
by the user.
G7S[1].X
G7S[3].T
Length in Bytes
<Step1>
32
...
<Stepn>
32
Internal access uses the step number or the step name followed by the name of
the structural element.
15-12
05.04.2001
05.04.01
Instance DB
S003.X
S017.T
DRY.X
External access uses only the step name (structure name) followed by the name of
the structural element, as follows:
DRY.X
DRY.T
Permanent Instructions
This component of the sequencer status area describes the permanent instructions
that can be programmed before or after the sequencer. The component is omitted
if no permanent instructions are programmed.
Name
Description
Data
type
Length Read
int.
Write int.
Read
Ext.
Write Ext.
PRE_CRIT
DWORD
0-n
no
no
yes
no
POST_CRIT
DWORD
0-n
no
no
yes
no
PRE_CNT
Number of permanent
WORD
instructions preceding the
sequencer
no
no
yes
no
POST_CNT
Number of permanent
instructions after the
sequencer
no
no
yes
no
WORD
15-13
05.04.2001
05.04.01
Instance DB
Index Arrays
The first component of the sequencer status area contains the index arrays for
managing the internal step and transition numbers.
Index Name
Description
Data
Type
Length in Read
Bytes
int.
Write
Ext.
TVX
BYTE
<intern>
no
no
yes
no
TTX
BYTE
<intern>
no
no
yes
no
TSX
BYTE
<intern>
no
no
yes
no
S00X
Array of steps to be
deactivated (second last
cycle)
BYTE
<intern>
no
no
no
no
SOFFX
BYTE
<intern>
no
no
no
no
SONX
BYTE
<intern>
no
no
no
no
SAX
BYTE
<intern>
no
no
yes
no
SERRX
BYTE
S_CNT+2 no
no
yes
no
SMX
BYTE
S_CNT+2 no
no
no
no
S0X
BYTE
S_CNT+2 no
no
no
no
S1X
BYTE
S_CNT+2 no
no
no
no
S_DISPLAY
INT
yes
no
yes
no
S_SEL_OLD
System-internal
INT
no
no
no
no
S_DISPIDX
System-internal
BYTE
no
no
no
no
T_DISPIDX
System-internal
BYTE
no
no
no
no
Array[1] - Array[n-2]
Entries
Array[n-1]
New entries are added at the end. When entries are removed, the array is shifted
together. This means that, for example, in the array of active steps (SAX), the step
that is active longest has the lowest index.
15-14
05.04.2001
05.04.01
Instance DB
Modes
The next component in the sequencer status area describes the modes, in other
words the state or mode change and codes.
A structure with the following elements is created:
Name
Description
Data
Type
Read
int.
Write int.
Read
Ext.
Write Ext.
AUTO
BOOL
yes
yes
yes
yes
MAN
BOOL
yes
yes
yes
yes
TAP
BOOL
yes
yes
yes
yes
TOP
BOOL
yes
yes
yes
yes
ACK_S
Reserved
BOOL
no
no
no
no
REG_S
Reserved
BOOL
no
no
no
no
T_PREV
Reserved
BOOL
no
no
no
no
T_NEXT
Reserved
BOOL
no
no
no
no
LOCK
Activate/deactivate interlock
processing
BOOL
yes
yes
yes
yes
SUP
Activate/deactivate supervision
processing
BOOL
yes
yes
yes
yes
ACKREQ
Reserved
BOOL
no
no
no
no
SSKIP
Reserved
BOOL
no
no
no
no
OFF
Deactivate sequencer
BOOL
yes
yes
yes
yes
INIT
BOOL
yes
yes
yes
yes
HALT
Stop/continue sequencer
BOOL
yes
yes
yes
yes
TMS_HALT
Stop/continue timers
BOOL
yes
yes
yes
yes
OPS_ZERO
Deactivate/activate actions
BOOL
yes
yes
yes
yes
SACT_DISP
Reserved
BOOL
no
no
no
no
SEF_DISP
Reserved
BOOL
no
no
no
no
SALL_DISP
Reserved
BOOL
no
no
no
no
S_PREV
BOOL
yes
yes
yes
yes
BOOL
yes
yes
yes
yes
S_SELOK
Reserved
BOOL
no
no
no
no
S_ON
BOOL
yes
yes
yes
yes
S_OFF
BOOL
yes
yes
yes
yes
15-15
05.04.2001
05.04.01
Instance DB
Name
Description
Data
Type
Read
int.
Write int.
Read
Ext.
Write Ext.
T_PUSH
Mode: Inching
BOOL
yes
yes
yes
yes
Reserved
BOOL
no
no
no
no
ACK
Acknowledgment of a disturbance
BOOL
yes
yes
yes
yes
IL_PERM
BOOL
yes
yes
yes
yes
T_PERM
BOOL
yes
yes
yes
yes
ILP_MAN
BOOL
yes
yes
yes
yes
Description
Length in
Bytes
MOPEDGE
System-internal
MOP
Example:
By setting MOP.MAN once, the mode changes to MANUAL. This can be set either
controlled by the program (for example action in the sequencer) or by the PG
function "Modify Variable" or using an operator panel.
Activation Time
The following component consists of a structure containing information about the
activation time calculation. This is only evaluated internally by the system.
15-16
Structure
Name
Description
Length in
Bytes
TICKS
System-internal
12
05.04.2001
05.04.01
Instance DB
Group Bits
The last component of a sequencer status area contains group bits that monitor the
internal sequencer status. A structure is created as follows for these group bits:
Name
Description
Data
Type
Read
int.
Write Int.
Read
Ext.
Write Ext.
ERR_FLT
Group disturbance
BOOL
yes
no
yes
no
ERROR
interlock error
BOOL
yes
no
yes
no
FAULT
Supervision error
BOOL
yes
no
yes
no
RT_FAIL
Group indication:
Runtime error
BOOL
yes
no
yes
no
NO_SNO
BOOL
yes
no
yes
no
NF_OFL
BOOL
yes
no
yes
no
SA_OFL
BOOL
yes
no
yes
no
TV_OFL
BOOL
yes
no
yes
no
MSG_OFL
BOOL
yes
no
yes
no
NO_SWI
Reserved
BOOL
no
no
no
no
CYC_OP
System-internal
BOOL
no
no
no
no
AS_MSG
System-internal
BOOL
no
no
no
no
AS_SEND
System-internal
BOOL
no
no
no
no
SQ_BUSY
System-internal
BOOL
no
no
no
no
SA_BUSY
System-internal
BOOL
no
no
no
no
AS_SIG
System-internal
BOOL
no
no
no
no
Type
Description
Length in
Bytes
SQ_FLAGS
t_sq_flags
Group bits
15-17
05.04.2001
05.04.01
Instance DB
Data
Length
Variable
Variable
Condition Descriptions
These data are only entered when you select the option "With Data".
Address
Description
Data
ADR_LOG_T[]:
Descriptions for all transitions with content; the
start addresses are in the field ADR_LOG_T[]; a
0 is entered here for empty transitions and there
is no description.
Length
BYTE[]
BYTE[]
...
BYTE[]
LOG_Ti[]
LOG_Tj[]
...
LOG_Tk[]
This is possibly followed by padding bytes with
the value 0 at the end of LOG_Tx so that the
following fields start at an even address.
ADR_LOG_L[]:
Descriptions of all interlock conditions with
contents; the start addresses are in the field
ADR_LOG_L[]; here, a 0 is entered for empty
interlocks and there is no description.
BYTE[]
BYTE[]
...
BYTE[]
LOG_Lp[]
LOG_Lq[]
...
LOG_Lr[]
This is possibly followed by padding bytes with
the value 0 at the end of LOG_Ly, so that the
following fields start with an even address
15-18
c
S_CNT-2
T_CNT
ADR_LOG_T:
Addresses of the transition descriptions LOG_Tx
ADR_LOG_T[0...T_CNT]
WORD[]
(T_CNT+1)2
c+2
T_CNT+2
ADR_LOG_L:
Addresses of the interlocks LOG_Ly
ADR_LOG_L[0...S_CNT]
WORD[]
(S_CNT+1)2
c+2
T_CNT+2
S_CNT+4
ADR_T1_CRITFLT:
Address of disturbed transition criteria of T1
ADR_T1_CRITFLT ==
address(G7T[1].CRIT_FLT)
WORD
05.04.2001
05.04.01
Instance DB
Address
Description
Data
Length
c+2
T_CNT+2
S_CNT+6
ADR_S1_CRITERR:
Address of the disturbed interlock criteria of S1
ADR_S1_CRITERR ==
address(G7S[1].CRIT_ERR)
WORD
c+2
T_CNT+2
S_CNT+8
ADR_SERRX:
Address of the array of disturbed steps SERRX[]
ADR_SERRX == address(SERRX[0]) == e
WORD
Data
Variable
Length
Variable
Description
Data
n-36
ADR_COND:
Address for the end of the condition
descriptions
ADR_COND ==
Address(ADR_LOG_T[0]) == c
WORD
n-34
MAX_TVAL:
Max. number of simultaneously valid
transitions
BYTE
n-33
MAX_SACT:
Max. number of simultaneously active
steps
BYTE
n-32
MAX_CRIT:
Max. number of criteria per condition
BYTE
n-31
T_CNT
Number of transitions
BYTE
n-30
SUP_CNT:
Number of supervisions
BYTE
n-29
LOCK_CNT:
Number of interlocks
BYTE
n-28
S_CNT
Number of steps
BYTE
n-27
SQ_CNT:
Number of branch paths
BYTE
n-26
PRS_INPAR:
Range of input parameters
DWORD
n-22
PRS_OUTPAR:
Range of output parameters
DWORD
n-18
SQ_FLAGS
Compiler flags part 1
WORD
Length
15-19
05.04.2001
05.04.01
Instance DB
Address
Description
Data
Length
n-6
SQ_FLAGS
Compiler flags part 2
BYTE
SQ_FLAGS
Compiler flags part 3
BYTE
n-4
G7_FBMARK:
Compatibility FB criteria analysis
BYTE
(010 == 1.0)
n-3
G7_RELEASE:
Graph version number (010 == 1.0)
BYTE
n-2
G7_ID2:
Graph ID ("7")
BYTE
n-1
G7_ID1:
Graph ID ("G")
BYTE
15-20
05.04.2001
05.04.01
Glossary
--A-Action
An action is an instruction to execute a function in an active step.
--C-Checkpoint
A checkpoint is a point in the program cycle at which plant or process states can be
influenced or queried. There are various checkpoints, for example
System checkpoint
User checkpoint
Criteria analysis
Criteria analysis is a software program for S7 Graph, consisting of a criteria FB and
extended instance DB. Criteria analysis detects and influences plant and process
states of S7 Graph sequential control systems.
--D-Deactivate
Deactivating means that the step is terminated by the relevant transition or by
another step.
Glossary-1
05.04.2001
05.04.01
Glossary
--E-Edge evaluation
Edge evaluation is required to detect and evaluate the change in a signal state.
The term edge is used when a signal state (for example of an input) changes. A
rising edge means that the signal changes from state "0" to state "1". In the
opposite situation, there is a falling edge.
Execution time
The execution time of an instruction is the time during which the instruction is
active; in other words, executed.
--I-Interlock
An interlock is a programmed condition within a step. An interlock influences the
execution of individual actions.
--L-LAD branch
The LAD branch corresponds to an OR logic operation on elements in a transition,
interlock, or supervision.
Glossary-2
The normally-closed contact switches when the Boolean address is not set.
05.04.2001
05.04.01
Glossary
Process image
A memory area on the CPU in which the status of the inputs and outputs is
entered.
1. Process image input table (PII): PII
2. Process image output table (PIQ): PIQ.
Processing time
The processing time is the time taken by the CPU to process an instruction (action,
condition) and is usually in the ms range per instruction.
--S-Sequencers
A sequencer is the heart of a sequential control system. Here, the program for
sequential control is created and processed.
The sequencer consists of a series of steps whose execution is started in a
specified dependent on step enabling conditions.
Step
The control task is divided into single steps. Actions are formulated in the steps
that are executed by the controller in a certain status (for example for controlling
the outputs or activating and deactivating steps).
Step comment
The step comment is a text in a step with a maximum of 2048 characters.
Start point
The start point is the defined start of the program cycle. When the program starts,
the process image input table (PII) is read, effectively querying the plant or process
state.
S7 Graph for S7-300/400 Programming Sequential Control Systems
A5E00105265-01
Glossary-3
05.04.2001
05.04.01
Glossary
Status
The status is the signal state of the bits of an address on the PLC.
Status display
The status display is the display of the signal state of an address on the monitor of
a programming device/PC connected online with the PLC.
Structural element
Structural elements are jumps and transitions in a sequencer.
Supervision
A supervision is a programmable condition within a step. A supervision influences
the way in which control passes from one step to the next.
System checkpoint
The system checkpoint is the interface between the system and the user program.
At the system control point, you can monitor or modify the signal states of the
process variables and set the signal states at outputs from the programming
device.
--T-Transition
A transition is the part of the sequencer that contains the conditions for passing
control from one step to its successor step.
A valid transition is a transition whose predecessor step or steps are active.
When a transition is valid and its step enabling conditions are satisfied, control
passes to the successor step. The predecessor step is then deactivated and the
successor step is activated.
Glossary-4
05.04.2001
05.04.01
Glossary
--U-User checkpoint
The user checkpoint is a selectable point in the user program for displaying the
signal states of variables.
User program
The user program contains all the blocks and instructions of the program.
Glossary-5
05.04.2001
05.04.01
Glossary
Glossary-6
05.04.2001
05.04.01
Index
A
Abort situations ............................................14-9
Accessing the instance DB...........................15-4
Actions ........................ 7-3, 13-10, 13-11, 13-12,
.................. 13-13, 13-14, 13-22, 13-23, 13-24
components ..............................................7-3
overview of arithmetic.............................13-22
overview of counters ..............................13-10
overview of timers ..................................13-16
Activation time............................................15-16
Activation time of steps ................................7-25
Active step......................................................6-2
Alternative branch ..........................................6-7
Areas.....................................................7-1, 7-14
for actions and conditions...........................7-1
for conditions ............................................7-14
Arithmetic in actions ..........................7-11, 13-22
Assignment of instance DB and
S7 Graph FB ............................................15-2
Assignments with Built-in function ................7-12
Assignments with operator ...........................7-13
Authorization ...........................................2-1, 2-2
loss ............................................................2-2
Automatic creation of the instance DB
on saving..................................................15-3
Automatic mode ...........................................9-10
Automatic mode (SW_AUTO) ......................9-11
Automatic mode or switch to next.................9-10
Automatic or switch to next mode
(SW_TOP)................................................9-14
Automatically compiling on saving an
S7 Graph FB ............................................8-15
B
Bit logic operations .......................................7-20
Block ......................................... 10-1, 10-2, 10-3
from PG....................................................10-1
uplading to the PG from the CPU .............10-3
Block comment.............................................6-11
Branch stop ....................................................6-9
C
Calling the S7 Graph FB .........................9-1, 9-2
Comment......................................................7-28
Compiling .....................................................8-15
compiling an S7 Graph source file............8-15
saving and compiling..................................8-1
sequencers ....................................8-14, 8-15
D
Default setting of a display level .................... 4-9
Defining the system signals ........................... 3-7
Details window............................................... 4-5
Direct assignments ...................................... 7-11
Direct editing mode...................................... 4-14
Display and position of the toolbars ............. 4-13
Displaying and printing the content of the
instance DB ............................................. 15-3
Displaying reference data ............................ 11-7
Downloading blocks from the programming
device to the CPU.................................... 10-1
Downloading the program to the CPU and
testing the sequencer .............................. 3-20
Drag-and-Drop editing mode ....................... 4-14
E
Editing the sequencer with the toolbars ....... 4-14
Editing variables .......................................... 7-30
Elements of a sequencer ............................... 6-5
Eliminating Errors after Compilation
or after the Consistency Check................ 8-16
Empty interlock ............................................ 7-16
Empty steps ................................................. 7-3
Empty transition ........................................... 7-15
Enabling operation....................................... 14-4
Entering FBD elements................................ 7-23
Index-1
05.04.2001
05.04.01
Index
G
Generating and updating diagnostic data .... 11-7
Group bits .................................................. 15-17
H
Handling modes ........................................... 14-5
Handling supervision errors ......................... 7-26
Handling the interlocks and manual
control in the manual mode...................... 14-7
I
Inching mode ............................................... 9-10
Inching mode (SW_TAP) ............................. 9-13
Including the sequencer in the
STEP 7 program ...................................... 3-18
Index arrays ............................................... 15-14
Indicating the modes.................................. 15-16
Individual structures ..................................... 15-1
Initial counter value ........................................ 7-9
Initial step....................................................... 6-5
Initialization .................................................. 14-8
Input parameters of the S7 Graph FB ............ 9-6
Insert mode.................................................. 7-19
direct ........................................................ 7-19
drag-and-drop .......................................... 7-19
Installation............................................. 2-9, 2-10
Installation requirements................................ 2-8
Installing S7 Graph ........................................ 2-8
Installing the authorization ......................... 2-3
Instance DB ............10-1, 10-2, 15-1, 15-2, 15-3,
...........15-4, 15-9, 15-10, 15-11, 15-12, 15-13,
..............................15-15, 15-18, 15-19, 15-20
accessing................................................. 15-4
automatic ................................................. 10-1
displaying contents .................................. 15-3
Index-2
Jump...............................................................6-6
L
LAD elements..................................... 7-19, 7-20
inserting ..................................................7-19
logic operations ........................................7-20
Ladder Logic elements .................................7-18
Ladder Logic elements for programming
conditions .................................................7-18
Length of the index arrays ..........................15-14
Level structure based on the example of a
manufacturing cell ....................................14-2
Linking to operator control and monitoring
systems ..................................................14-12
Logic operations with FBD elements ............7-24
Logic operations with Ladder Logic
elements...................................................7-20
M
Mandatory acknowledgment.........................7-26
Manual mode............................. 9-10, 9-12, 9-13
Manual mode (SW_MAN).............................9-12
Maximum parameter set...............................15-5
memory requirements......................... 8-11, 8-12
Menu bar ........................................................4-3
Mode ..........................................................15-15
automatic or switch to next ...................9-15
in the instance DB ..................................15-15
inching ............................................ 9-13, 9-14
manual............................................ 9-12, 9-13
sequential control system .........................9-10
Modes........... 9-10, 9-11, 9-12, 9-13, 9-14, 15-15
automatic........................................ 9-11, 9-12
Modifications during installation and
commissioning........................................14-10
Modifying the sequencer ..............................3-22
Monitoring.....................................................11-6
Monitoring and modifying variables ..............11-6
Monitoring and testing the sequential
control system ..........................................11-1
Monitoring functions .....................................3-15
05.04.2001
05.04.01
Index
programming ............................................3-15
Monitoring the status information .................11-2
N
Name...................................................7-28, 7-29
Navigating in the sequencer.........................4-15
New sequencer ..............................................6-9
Number ...............................................7-28, 7-29
S
O
OB1 ..............................................................3-18
Opening an S7 Graph FB or an S7 Graph
source file...................................................5-4
Operating mode
selecting ..........................................9-10, 9-11
Outline of the structure of the instance DB...15-4
Output parameters of the S7 Graph FB..........9-9
Overview of S7 Graph ....................................1-1
Overview window ...........................................4-4
P
Parameter sets of the FB ...............................9-4
Parameters..........................................7-30, 15-5
inserting in a sequencer ...........................7-30
of the S7 Graph FB ..................................15-5
Permanent instructions................ 4-9, 6-10, 7-17
Permanent Instructions ..............................15-13
Printing the sequencer .................................12-1
Printout.........................................................12-1
Procedure for creating a sequential
control system ............................................3-2
Programming actions and cnditions ...............7-1
Programming conditions and actions .............7-1
Programming monitoring functions...............3-15
Programming step actions............................3-12
Programming the structure of a sequencer ....6-1
Programming transitions ..............................3-13
Programming with symbolic addresses ........7-29
Progressing ..................................................9-16
progressing with T_PUSH ........................9-16
Project ............................................................5-1
creating in the SIMATIC Manager ..............5-1
Q
Querying module information and the
operating mode ........................................11-6
R
Representing the mode in the sequencer.....14-6
Requirements ........................................3-2, 7-26
for signaling and acknowledging ..............7-26
Right of use ....................................................2-1
Rules
for creating an S7 Graph FB ......................5-3
for creating an S7 Graph source file...........5-3
S7 Graph
installing..................................................... 2-8
starting...................................................... 4-1
uninstalling............................................... 2-10
user interface ............................................. 4-2
S7 Graph addresses in conditions ............... 7-25
S7 Graph FB
creating.......................................... 3-10, 3-12
input parameters........................................ 9-6
output parameters...................................... 9-9
S7 Graph FB.............................................. 5-3
S7 Graph FB or S7 Graph source file? .......... 5-2
S7 Graph source file ...................................... 5-3
Saving...................................3-17, 8-2, 8-3, 8-14
calculating memory requirements ............ 8-11
saving an S7 Graph FB or an S7 Graph
source file ............................................ 8-14
saving and closing the sequencer............ 3-17
saving and compiling ................................. 8-1
settings for saving and compiling............... 8-3
Search function............................................ 4-15
Selecting a step with S_PREV or S_NEXT:. 9-15
Selecting a step with S_SEL:....................... 9-15
Selecting an FB parameter set ...................... 9-3
Selecting the structure of the sequencer ....... 3-5
Sequencer ................3-5, 3-10, 3-11, 3-12, 3-17,
................ 3-18, 3-20, 3-22, 3-23, 6-2, 6-3, 6-5
creating .................................................... 3-10
including in the STEP 7 program ............. 3-18
modifying................................................ 3-22
navigating ................................................ 4-15
principle ..................................................... 6-2
saving and closing ................................... 3-17
selecting the structure................................ 3-5
structures ................................................. 6-3
testing ..................................................... 3-20
Sequencer status...... 15-13, 15-14, 15-15, 15-16
activation time........................................ 15-16
index arrays ........................................... 15-14
modes .................................................... 15-15
permanent instructions .......................... 15-13
Sequential control system............................ 9-10
automatic mode ....................................... 9-10
inching mode ........................................... 9-10
manual mode ........................................... 9-10
normal mode............................................ 9-10
Setting a display level .................................... 4-9
Settings for printing...................................... 12-1
Settings for the instance DB ........................ 15-1
Settings for the mnemonics ......................... 13-1
Index-3
05.04.2001
Index
Index-4
defining .....................................................3-7
T
Technological task and functional diagram.....3-3
Test function.................................................3-21
control sequencer .....................................3-21
Test functions ............................ 11-1, 11-2, 11-5
in STEP 7 .................................................11-5
Monitoring and testing the sequential
control system ......................................11-1
The modes of the sequential
control system ..........................................9-10
Time constant.................................................7-5
Timers ..........................................................7-25
actions ................. 13-16, 13-17, 13-18, 13-19,
................................................13-20, 13-21
activation time of steps .............................7-25
in actions ..................................................7-10
timers in Actions .....................................13-16
timers in conditions...................................7-25
Title bar ..........................................................4-3
Toolbars ............................................... 4-3, 4-13
displaying................................................4-13
position .....................................................4-13
Transition.............................................. 3-13, 6-5
description in the instance DB ..................15-9
programming ............................................3-14
Step-transition pair and initial step .............6-5
Transition structure.......................................15-9
U
Uninstalling S7 Graph ..................................2-10
Uninstalling the authorization ................. 2-3, 2-5
Upgrading the authorization ...........................2-4
Uploading blocks from the CPU to the
programming device .................................10-3
User interface .................................................4-2
Using standard function blocks FC70 FC71
FC72 and FC73........................................8-13
V
Variables ......................................................7-30
W
Whats new? ...................................................1-4
Work area.......................................................4-8
Working area ..................................................4-3
Z
Zoom ............................................................4-10