Uploaded by David Jimenez

21626316 weckalarm doku v30 e

advertisement
Tool on Control Technology
Influence of the Communication on the Interval
of Watchdog Interrupts of a SIMATIC S7-CPU.
Watchdog Interrupts OB35
Warranty, Liability and Support
Any claims against us - based on whatever legal reason - resulting
from the use of the examples, information, programs, engineering
and performance data etc., described in this document shall be
excluded. Such an exclusion shall not apply in the case of
mandatory liability, e.g. under the German Product Liability Act
(“Produkthaftungsgesetz”), in case of intent, gross negligence, or
injury of life, body or health, guarantee for the quality of a product,
fraudulent concealment of a deficiency or breach of a condition
which goes to the root of the contract (“wesentliche
Vertragspflichten”). However, claims arising from a breach of a
condition which goes to the root of the contract shall be limited to
the foreseeable damage which is intrinsic to the contract, unless
caused by intent or gross negligence or based on mandatory
liability for injury of life, body or health. The above provisions does
not imply a change in the burden of proof to your detriment.
A&D AS CS3 KM
Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc
We do not accept any liability for the information contained in this
document.
The Application Examples are not binding and do not claim to be
complete regarding the circuits shown, equipping and any
eventuality. They do not represent customer-specific solutions.
They are only intended to provide support for typical applications.
You are responsible in ensuring that the described products are
correctly used. These Application Examples do not relieve you of
the responsibility in safely and professionally using, installing,
operating and servicing equipment. When using these Application
Examples, you recognize that Siemens cannot be made liable for
any damage/claims beyond the liability clause described above.
We reserve the right to make changes to these Application
Examples at any time without prior notice. If there are any
deviations between the recommendations provided in these
Application Examples and other Siemens publications - e.g.
Catalogs - then the contents of the other documents have priority.
Copyright© 2005 Siemens A&D. It is not permissible to
transfer or copy these Application Examples or excerpts of
them without first having prior authorization from Siemens
A&D in writing.
For questions about this document please use the following
e-mail-address:
csweb@ad.siemens.de
Rev. V3.0 - Endgültig 08.06.2004
2/50
Watchdog Interrupts OB35
A&D AS CS3 KM
Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc
Content
1
Preliminary Remarks ................................................................................. 5
1.1
Field of application of the simulation ............................................................ 5
1.2
Scope of validity ........................................................................................... 6
1.3
Overview of the downloads .......................................................................... 7
1.4
History of the documentation ....................................................................... 7
1.5
Difference previous measurement / repeated measurement ....................... 8
1.6
Guide through the document........................................................................ 9
2
Overview of the Measurement ................................................................ 10
2.1
Measuring setup......................................................................................... 11
2.2
Configurations ............................................................................................ 13
2.3
Measured variables.................................................................................... 14
2.4
Technical data............................................................................................ 15
3
Overview of the Simulator....................................................................... 16
3.1
The user interface ...................................................................................... 16
3.2
The tables .................................................................................................. 20
4
Diagrams................................................................................................... 22
4.1
Overview diagram: CPU314C-2DP............................................................ 25
4.2
Overview diagram: CPU315-2DP .............................................................. 25
4.3
Overview diagram: CPU317-2DP .............................................................. 26
4.4
Overview diagram: CPU318-2DP .............................................................. 26
4.5
Overview diagram: CPU416-2DP .............................................................. 27
4.6
Manager diagram ....................................................................................... 28
5
Background Knowledge and Tips for Optimization.............................. 29
5.1
Why is the call of the watchdog interrupt OB delayed?.............................. 29
5.2
Why does the communication influence the watchdog interrupt? .............. 31
5.3
Which influence does a PG at the MPI interface have?............................. 31
5.4
What happens if you use a different S7-CPU? .......................................... 32
5.5
Where do you find interesting information on the topic? ............................ 33
6
The Measurement in Detail...................................................................... 34
6.1
General boundary conditions for the measuring setup .............................. 34
6.2
Photograph of the measuring setup ........................................................... 34
6.3
Properties of the hardware components .................................................... 35
6.4
Properties of the software applications ...................................................... 36
Rev. V3.0 - Endgültig 08.06.2004
3/50
6.5
Configuration of the components ............................................................... 36
6.6
6.6.1
6.6.2
6.6.3
Programming the components ................................................................... 38
STEP7 program of the test CPU ................................................................ 38
STEP7 program of the load CPUs ............................................................. 41
Communication between test CPU and load CPUs ................................... 41
6.7
6.7.1
6.7.2
6.7.3
6.7.4
Measuring procedure ................................................................................. 42
Measuring environments............................................................................ 42
Performance: Recording interval between watchdog interrupts................. 42
Performance: Recording OB1 cycle time ................................................... 43
Example of a series of measurements....................................................... 44
6.8
6.8.1
6.8.2
Determining the measured variables ......................................................... 45
Interval between two watchdog interrupts.................................................. 45
OB1 cycle time ........................................................................................... 48
6.9
Overview of the components (MLFB, versions) ......................................... 49
7
Appendix................................................................................................... 50
7.1
Abbreviations ............................................................................................. 50
7.2
Definitions .................................................................................................. 50
A&D AS CS3 KM
Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc
Watchdog Interrupts OB35
Rev. V3.0 - Endgültig 08.06.2004
4/50
Watchdog Interrupts OB35
1
Preliminary Remarks
1.1
Field of application of the simulation
Problem
Controls are required in many areas of automation technology. Numerous
control tasks can be realized cost-effectively in the user program of the S7CPU.
For this requirement, S7-CPUs make the mechanism of watchdog interrupt
processing (watchdog interrupt OB) available. The watchdog interrupt OB is
called continuously in a configurable interval.
The precondition for an ideal control is the fact that the interval between the
watchdog interrupts is exactly identical. The following important question
occurs during designing such configurations:
A&D AS CS3 KM
Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc
• How exactly is the configured interval between two watchdog interrupts
kept to?
Nowadays, an S7-CPU has to manage various communication tasks aside
from control tasks. An S7-CPU often communicates simultaneously with a
programming device, operating modules and other S7-CPUs via PB
subnets or IE subnets.
Depending on the type of the S7-CPU and the scope of the communication
load, the interval between two watchdog interrupts varies. This raises the
following questions:
• In which way does the communication influence the watchdog interrupts
and the cycle time?
• Are there differences in the S7-CPUs?
Our solution
To answer the questions listed above, extensive measurements were
performed on typical configurations.
The results can be downloaded:
• Simulator (Excel file)
• Documentation (PDF file on hand).
Rev. V3.0 - Endgültig 08.06.2004
5/50
Watchdog Interrupts OB35
Simulator
With the simulator, the interval between two watchdog interrupts for typical
configurations can be estimated with a high degree of accuracy.
In order to determine the measured values quickly, the simulator features
an interactive user interface.
By clicking the mouse, you can select different configurations and compare
them directly.
In a simple and playful manner, the simulator shows you the watchdog
interrupt reaction time to be expected in practice:
• Load the simulator on your PC, start it and you’re ready to go!
• The most important points on the measurement are covered by the
integrated description!
If you are more interested in trends and magnitudes, please refer to the
diagrams in the documentation.
You will find a concise summary of the measuring results, valuable
background information, tips for optimizing your configuration and a
detailed description of the measurement.
A&D AS CS3 KM
Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc
Documentation
1.2
Scope of validity
Only current components from the SIMATIC delivery scope were used for
the measurements:
• As at August 2003
Rev. V3.0 - Endgültig 08.06.2004
6/50
Watchdog Interrupts OB35
1.3
Overview of the downloads
As previously described, these measurements have produced two
downloads. The table provides an overview.
Table 1-1
Downloads
Download
File type
Version
Simulator
EXCEL 2000 V3.0
Content
• Interactive user interface for selecting the
configurations and display of the measured
values
• Integrated description containing the most
important information on the measurement
• All measured values in clear tables
Documentation
PDF file
V3.0
• Description of measurement and simulator
• Evaluation of the measured values in diagrams
The download “Documentation“ is available to you with this document.
A&D AS CS3 KM
Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc
• Background knowledge
1.4
History of the documentation
Here, you find an overview of the different versions of the document on
hand.
If you already have an older version of the documentation, the table below
gives you a quick overview of the changes that have been made.
Table 1-2
History of the documentation
Version
documentation
Date of
release
Version
measurement
Measuring
setup status
Change
V1.0
04/27/01
V1.0
Jan. 2001
First creation
V2.0
10/01/01
V2.0
Oct. 2001
CPU 314C measured
additionally
V2.1
02/25/02
V3.0
Oct. 2003
Rev. V3.0 - Endgültig 08.06.2004
Editing for the Shop
V3.0
Aug. 2003
Repeated
measurement
7/50
Watchdog Interrupts OB35
1.5
Difference previous measurement / repeated measurement
The measurement on hand is the repetition of an already existing
performance measurement.
Overview of the differences
The table below summarizes the changes of the repeated measurement in
comparison with the previous measurement:
Table 1-3
Differences between previous and repeated measurement
Previous measurement:
Repeated measurement
Changed components
S7-CPUs:
S7-CPU:
• As at January 2001
• With current firmware and hardware revision levels:
As at August 2003
Line-oriented operator panel:
OP7
Windows-CE operator panel:
OP170B
Additional measured variable
OB1 cycle time
A&D AS CS3 KM
Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc
• Added: CPU317-2DP
Rev. V3.0 - Endgültig 08.06.2004
8/50
Watchdog Interrupts OB35
1.6
Guide through the document
This table allows you to decide quickly which chapter you want to read.
Table 1-4
Overview of the contents of the document
Chapter
Content
Provides information on
Chapter 1:
Preliminary Remarks
Field of application
cause, aims and application
field of the measurement.
Overview of the downloads
History of the documentation
Differences of the measurements
Chapter 2:
Overview of the Measurement
Measuring setup
the most important details
Measured variables
for a quick start.
A&D AS CS3 KM
Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc
Technical data
Chapter 3:
Overview of the Simulator
User interface
Chapter 4:
Diagrams
Diagrams
Chapter 5:
Background Knowledge and
Tips for Optimization
Factors influencing interval
Chapter 6:
The Measurement in Detail
Tables
the evaluation
for quick comprehension.
Use of other S7-CPUs
Sources of information
interesting and valuable
aspects on the subject of the
measurement.
Tips for optimization.
Properties of the components
all details
Measuring procedure
required to understand and
reproduce the measurement.
Determination of the measured
variables
Overview of MLFB
Chapter 7:
Appendix
Rev. V3.0 - Endgültig 08.06.2004
Abbreviations
Definitions
important abbreviations and
definitions for orientation.
9/50
Watchdog Interrupts OB35
2
Overview of the Measurement
This chapter gives you important information on the measurement:
• How is the measuring setup designed?
• Which configurations are measured?
• Which measured variables are determined?
• What are the “technical data” of the measurement?
If you are interested all the details of the measurement, please refer to
chapter 7 “The Measurement in Detail”. It provides a detailed description of
the components and the measuring method.
Note on the name:
• Test CPU:
This S7-CPU processes the watchdog interrupt OB (OB35). The
performance data are measured for this S7-CPU.
A&D AS CS3 KM
Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc
In order to distinguish the S7-CPUs, the names listed below are used:
• Load CPU:
The load-CPU communicates with the test CPU via a PB subnet or an IE
subnet.
Rev. V3.0 - Endgültig 08.06.2004
10/50
Watchdog Interrupts OB35
2.1
Measuring setup
Different S7-CPUs (test CPUs) are loaded as heavily as possible with
different communication tasks.
The interval between two calls of the watchdog interrupt OB (OB35) and
the cycle time are measured.
In order to be as practice-relevant as possible, the measurement was
performed under the following boundary conditions:
• A typical STEP7 user program which is interrupted by the watchdog
interrupt OB every 10 ms is processed in the test CPU.
Mechanical and electrical setup
All components are set up according to the setup guidelines in the following
SIMATIC manuals:
A&D AS CS3 KM
Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc
• 32 ET200 stations are connected at the integrated DP interface of the
test CPU.
• Automation system S7-300, Setup, CPU data
• Automation systems S7-400, M7-400, Setup
• Device manual TP170A, TP170B, OP170B, Installation
Reference potential (M) is grounded. All racks are connected with the
station ground.
Measuring setup principle
Basically, the measuring setup consists of three parts:
• S7 station with S7-CPU (test CPU)
• ET200 stations
• Communication load.
Rev. V3.0 - Endgültig 08.06.2004
11/50
Watchdog Interrupts OB35
The figure below shows the basic measuring setup.
S7-CPU (test CPU)
DO
t
A&D AS CS3 KM
Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc
PB-CP IE-CP
OB 1
Measuring
point
of the
cycle time
DP
1,5 Mbit
DI
MPI
187,5 kbit
A I0.0
S M 20.1
.
.
.OB35
.UC SFB xy
.T MW 400
.BE
.
.
.
.
.OB35
.UC SFB xy
.T MW 400
.BE
.
.
BE
PB
IE
Profibus-DP
Measuring point for the interval
between two watchdog interrupts
CPUnn
CPU
32 ET200
Communication load
Profibus
Industrial
Ethernet
MPI
CPU n
CPU
3 / 15n
PG
Fig. 2-1
OP170B
CPUnn
4CPU
load
CPUs
CPUnn
4CPU
load
CPUs
Basic measuring setup
Rev. V3.0 - Endgültig 08.06.2004
12/50
Watchdog Interrupts OB35
2.2
Configurations
The series of measurements are performed for different configurations
(measuring setups).
The configurations differ in the following characteristics (parameters):
Variations of the test CPU:
• Type of the S7-CPU
• Value of the parameter: “Cycle load due to communication”
• User program with or without call of
communication blocks
• Type of communication load.
The following specifications (constants) apply to all configurations:
• Length of the user program
• Call interval of the watchdog interrupt (OB35)
A&D AS CS3 KM
Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc
Constants of the test CPU:
• Baud rate of the integrated MPI interface
• Baud rate of the integrated DP interface.
Other constants of the measurement:
• Number of ET200 stations at the integrated DP interface
• Number and configuration of the operating modules (OP) at the
integrated MPI
• Online function of the programming device (PG) at the integrated MPI.
Rev. V3.0 - Endgültig 08.06.2004
13/50
Watchdog Interrupts OB35
2.3
Measured variables
The following measured variables are determined for all configurations:
• Interval between watchdog interrupts
• OB1 cycle time.
Each measured variable is measured several times for each configuration.
The following values are determined from these measured values:
• Minimum value (smallest value from all measured values)
• Typical value (arithmetic mean value from all measured values)
• Maximum value (largest value from all measured values).
This is the time between event 1 and event 2:
A&D AS CS3 KM
Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc
Interval between watchdog interrupts:
Event 1:
Call OB35, execution of first STEP7 instruction in OB35
Event 2:
Following call of OB35, execution of the first STEP7 instruction in OB35.
OB1 cycle time
This is the time between event 1 and event 2:
Event 1:
Process image update in the S7-CPU
Event 2:
Following process image update in the S7-CPU.
Rev. V3.0 - Endgültig 08.06.2004
14/50
Watchdog Interrupts OB35
2.4
Technical data
Here, the properties of the measurement are summarized concisely in a
table.
Table 2-1
Simulator
Outputs:
Measured variable:
Interval between
watchdog interrupts
Cycle time
Watchdog interrupts
Measured values
Maximum, typical,
minimum value
Maximum, typical,
minimum value
Unit
ms, 2 numbers of places
after the decimal point
ms, no number of places
after the decimal point
Comments
Interval of two OB35 calls
Feature
Type
Measuring parameters
314C-2DP
315-2DP
317-2DP
318-2DP
416-2DP
5% / 10%
20%
Yes
Comments
S7-300 CPU with integrated I/O
S7-300 CPU
S7-300 CPU
S7-300 CPU
S7-400 CPU
Smallest value possible (S7-400: 5%, S7-300: 10%)
Default value
Communication blocks in test CPU and load CPUs:
Communication SFC calls in OB1
Communication blocks only in load CPUs:
PUT, GET; test CPU is server
No communication load on the test CPU
PG on MPI. Online function “Status Variable”
3/15 OP on MPI. Acquisition cycle 200ms.
Four 400-CPUs communicate with test CPU via PB-CP
Four 400-CPUs communicate with test CPU via IE-CP
All above loads act simultaneously on the
test CPU and “Call communication block” = “Yes”
Cycle load due to
communication
Call of
communication blocks in
OB1 of the test CPU
A&D AS CS3 KM
Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc
Inputs:
Component:
S7-CPU
(test CPU)
Technical data of the measurement
Constant:
Component
Test CPU
ET200 on DP
Subnet
OP
Information:
Component
Test CPU
No
Communication load
Without load
PG on MPI
OPs on MPI
Load CPUs via PB-CP
Load CPUs via IE-CP
All loads
Feature
Baud rate DP
Baud rate MPI
Run time user program in
the test object
Interval OB35
Type
Number of stations
Configuration
Range of values
1,5MBit/s
187,5kBit/s
20ms
OB1 cycle time of the S7-CPU
Comments
Applies to “Communication load” = “Without” (“no-load”)
Length user program in OB35: 100 instructions
Simulated with SIMIT simulator
PB
IE
Type
10ms
ET200M
32
16 byte DI
16 byte DO
12MBit/s
100MBit/s
OP 170B
Display
Cycle time without c-load
Interval OB35
Number of OPs
Number of load CPUs
Range of values
20ms
10ms
3 / 15
4
Comments
Value is set via a load program.
Fixed set
Number of OPs connected to selected test CPU
Number of CPUs connected via subnet
Rev. V3.0 - Endgültig 08.06.2004
15/50
Watchdog Interrupts OB35
3
Overview of the Simulator
The simulator (Excel file) includes the following elements:
• An interactive user interface for convenient access to the measured
values
• All measured values in clear tables for usage as reference books.
Both elements are briefly described in this chapter.
3.1
The user interface
How to activate the user interface:
• Download the Excel file
• If prompted “Enable macros“
• Select the ”Simulation“ tab.
A&D AS CS3 KM
Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc
• Open the Excel file
Note
If the macros cannot be activated, the safety settings in “Tools/Macros/Safety”
must be set to medium.
The setup of the user interface is explained below.
Rev. V3.0 - Endgültig 08.06.2004
16/50
Watchdog Interrupts OB35
Setup of the user interface (“SIMULATION” tab)
Selectable tabs:
Integrated description
Yellow boxes:
Purple boxes:
Configuration 1
Configuration 2
Tab
selection
A&D AS CS3 KM
Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc
Functional
model
Operation
Input section:
Information section:
Output section:
Configuration of
the S7- CPU
Display of important
constants
Performance data watchdog
interrupts
Fig. 3-1
Simulator user interface
Rev. V3.0 - Endgültig 08.06.2004
17/50
Watchdog Interrupts OB35
Explanation on the user interface (“SIMULATION” tab)
The user interface is divided into the following sections:
Tab selection: Top of the “SIMULATION” tab
You find a summary of the most important information on the
measurement. Simply click the tab with the topic on which you need
information.
Functional model: Top half of the “SIMULATION” tab
Here you find the functional model on the measuring setup. It contains the
most important components of the measurement, measured variables and
measuring locations.
Operation: Bottom half of the “SIMULATION” tab
• Input section (shaded green):
Contains the input boxes for selecting a configuration.
A&D AS CS3 KM
Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc
All inputs and outputs of the simulator are made here. Inputs and outputs of
a component are summarized. The following elements exist for each
component:
• Output section (shaded orange):
Contains the output boxes for displaying the performance data.
• Information section (shaded gray):
Contains the output boxes for important information.
All input and output boxes are doubled in order to enable simultaneous
viewing of two configurations:
• Configuration 1: Shaded yellow
• Configuration 2: Shaded purple.
Summary of the color coding
Input section
Input box for configuration 1
Selection: x
Input box for configuration 2
Selection: y
Output section
Output box for configuration 1
Output: x (measured)
Figure 3-2
Output box for configuration 2
Output: y (measured)
Color coding in the user interface
Rev. V3.0 - Endgültig 08.06.2004
18/50
Watchdog Interrupts OB35
Application example
A simple example illustrates the possibilities of using the simulator:
Given
• We are dealing with a CPU 315-2DP
• The “cycle load due to communication” is 10%
• OPs are operated at the integrated MPI interface of the S7-CPU.
Required
The application requires a high degree of accuracy during actual value
acquisition. The maximum fluctuation for an interval between two watchdog
interrupts is ± 0,5ms.
Application of the simulator
Proceed as follows:
A&D AS CS3 KM
Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc
Can the CPU 315-2DP meet these requirements?
In a first step, select two identical configurations (“yellow“ and ”purple“
configuration) in the user interface (“SIMULATION” tab):
• Type: CPU 315-2DP
• “Cycle load due to communication”: 10%
• Communication load: OPs on MPI.
You can read immediately whether the watchdog interrupts are within the
required tolerance.
In order to determine how the watchdog interrupts react under a different
communication load with regard to time, you can change the
“communication load” in the “purple” configuration.
• Communication load: PGs on MPI.
The influence can now be seen in the “yellow” and “purple” output boxes.
You can also do this similarly for other measuring parameters.
Rev. V3.0 - Endgültig 08.06.2004
19/50
Watchdog Interrupts OB35
3.2
The tables
In the simulator, all measured values are filed in clear tables. There are two
different ways to access these tables:
First option
• Download the Excel file
• Open the Excel file
• If prompted “Do not enable macros“
Second option
• Download the Excel file
• If prompted "Enable macros"
the user interface of the simulator appears on the screen
A&D AS CS3 KM
Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc
• Open the Excel file
• Close the user interface of the simulator:
The standard Excel user interface appears. The tables are available in
the Excel sheets.
The following tables are contained in the Excel file:
Table 3-1 Overview of the tables in the Excel file
No.
Name of the Excel sheet
1
CPU314C-2DP
2
CPU315-2DP
3
CPU317-2DP
4
CPU318-2DP
5
CPU416-2DP
Thus, one Excel sheet exists for every S7-CPU.
Rev. V3.0 - Endgültig 08.06.2004
20/50
Watchdog Interrupts OB35
All tables have the same structure:
• The configurations can be found in the left part of the table
• The measuring results can be found in the right part of the table.
Detailed structure of the table:
• Column A-C: Configuration
• Column D-I: Measuring results.
Below, a section of a table is shown as an example.
Measuring results
(performance data)
A&D AS CS3 KM
Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc
Configurations
Series of measurements
example:
CPU TYPE: CPU315-2DP
Load: 4 CPUs on PB
Cycle load due to communication: 10%
CPU TYPE
Fig. 3-3
with communication (send/receive)
Table section from the Excel file
Rev. V3.0 - Endgültig 08.06.2004
21/50
Watchdog Interrupts OB35
4
Diagrams
This chapter displays the measured values in clear diagrams. Using these
diagrams, you quickly see magnitudes and trends of the measured values.
You will receive answers to the following interesting questions:
• Which influence does the type of the S7-CPU have on the interval of the
watchdog interrupts?
• Which influence do the communication loads have in this process?
You find two different types of diagrams in this chapter:
Overview diagram
There is one overview diagram for every test CPU:
The following is plotted on the y-axis:
depending on
• communication load
A&D AS CS3 KM
Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc
• Minimum, typical and maximum interval between watchdog interrupts
• cycle load due to communication.
Manager diagram
The overview diagrams are summarized in the manager diagram:
The following is plotted on the y-axis:
• Minimum, typical and maximum interval between watchdog interrupts
depending on
• communication load
• type of the test CPU.
Overview of the diagrams:
The table provides an overview of all diagrams.
Table 4-1
Overview of all diagrams
S7-CPU
Overview diagram
(test object)
Chapter
314C-2DP
315-2DP
317-2DP
318-2DP
416-2DP
Rev. V3.0 - Endgültig 08.06.2004
4.1
4.2
4.3
4.4
4.5
Manager diagram
Summarization of Chapter
x
x
x
x
x
4.6
22/50
Watchdog Interrupts OB35
Structure of the overview diagrams
For each measured S7-CPU there is a diagram with the following structure:
y-axis:
Interval between watchdog
interrupts in ms
S7-CPU type
A&D AS CS3 KM
Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc
Description
of a diagram
bar
Cycle load due to
communication:
5%/10% or 20%
Communication blocks:
send/receive or put/get
Type of the communication load:
Without load, PG on MPI, OPs on
MPI, load CPUs on PB, load
CPUs on IE or all loads
x-axis:
Parameters of the configuration
Rev. V3.0 - Endgültig 08.06.2004
23/50
Watchdog Interrupts OB35
Structure of the manager diagram
In the manager diagram, the overview diagrams are summarized in one
diagram. That way, one single diagram provides an overview of the entire
measurement.
The two bars per communication load from an overview diagram (one bar
for each value “cycle load due to communication”) are blended into one
single bar in the manager diagram.
• The upper end of a bar in the manager diagram is then the largest value
measured –considered via all measured values irrespective of the “Cycle
load due to communication” setting.
• Accordingly, the lower end is the smallest value measured –considered
via all measured values irrespective of the “Cycle load due to
communication” setting.
A&D AS CS3 KM
Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc
Thus, the entire fluctuation range of the measured values is displayed.
Rev. V3.0 - Endgültig 08.06.2004
24/50
A&D AS CS3 KM
Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc
Watchdog Interrupts OB35
4.1
Overview diagram: CPU314C-2DP
4.2
Overview diagram: CPU315-2DP
Rev. V3.0 - Endgültig 08.06.2004
25/50
A&D AS CS3 KM
Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc
Watchdog Interrupts OB35
4.3
Overview diagram: CPU317-2DP
4.4
Overview diagram: CPU318-2DP
Rev. V3.0 - Endgültig 08.06.2004
26/50
A&D AS CS3 KM
Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc
Watchdog Interrupts OB35
4.5
Overview diagram: CPU416-2DP
Rev. V3.0 - Endgültig 08.06.2004
27/50
Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc
A&D AS CS3 KM
Watchdog Interrupts OB35
4.6
Manager diagram
Rev. V3.0 - Endgültig 08.06.2004
28/50
Watchdog Interrupts
5
Background Knowledge and Tips for Optimization
This chapter provides valuable information in a concise form. You find
answers to important questions regarding “watchdog interrupts”.
This helps you to understand the relations and puts you in a position to
optimize your configuration.
The topics of this chapter:
• Why is the call of the watchdog interrupt OB delayed?
• Why does the communication influence the watchdog interrupt call?
• Which influence does a PG at the MPI interface of the S7-CPU have?
• What happens if you use an S7-CPU different from the one measured?
5.1
A&D AS CS3 KM
Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc
• Where is interesting information on the topic available?
Why is the call of the watchdog interrupt OB delayed?
OB1 is cyclically called and processed by the S7-CPU. Watchdog interrupts
interrupt OB1 in a configurable interval. The processing of the watchdog
interrupt OB is put in:
Interruption of the OB1 user program by the watchdog interrupt OB:
OB1
OB35
10ms
A certain period of time passes from the occurrence of the watchdog
interrupt until processing of the first STEP7 instruction in the watchdog
interrupt OB. The reasons for this are listed below:
• In each interruption of OB1, the operating system of the S7-CPU
saves the contents of the accumulators.
• Operating system routines which are not interruptible at the moment are
active in the S7-CPU.
Rev. V3.0 - Endgültig 08.06.2004
29/50
Watchdog Interrupts
If a call of the watchdog interrupt OB is delayed, the operating system of
the S7-CPU takes countermeasures and reduces the time until the next call
of the watchdog interrupt OB. Due to this mechanism, the operating system
guarantees that the mean value of the intervals corresponds exactly to the
configured call time.
OB1
OB35
10ms
There are different causes for the delay of the call of the watchdog interrupt
OB:
A&D AS CS3 KM
Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc
10ms
Delay caused by the operating system of the S7-CPU:
• Switchover time from the current OB to the watchdog interrupt OB
• Running PG test functions (status/control).
Delay caused by the communication of the S7-CPU:
•
•
•
•
PG communication
PG routing
OP communication
Communication via subnets using CPs.
Delay caused by the user program of the S7-CPU:
• Use of the copy command SFC81 (UBLKMOV)
• Use of OBs with a higher priority
• Disabling the watchdog interrupt OB by SFC39.
Rev. V3.0 - Endgültig 08.06.2004
30/50
Watchdog Interrupts
5.2
Why does the communication influence the watchdog interrupt?
General information
During handling the communication jobs in the S7-CPU, the operating
system of the S7-CPU executes internal system routines to restore data.
If such a routine is processed at the time of the watchdog interrupt, a
watchdog interrupt must wait until this routine is completed.
Parameter “Cycle load due to communication”
In the hardware configuration, the load of OB1 due to the communication
can be set between 5% (10% in S7-300) and 50%.
Yet, the percentage is a mean.
With this mechanism, the communication load of OB1 can on average be
limited to the set value. Yet, higher communication loads may develop
within the timeslices.
A&D AS CS3 KM
Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc
In the case of a setting of e.g. 20%, the communication fraction in a
timeslice may be considerably higher than 20%. But the communication
fraction in the next timeslice amounts only to a few per cent or even 0%.
5.3
Which influence does a PG at the MPI interface have?
The influence of the programming device at the MPI interface of the
S7-CPU on the interval between two watchdog interrupts may be
significant.
!
Important
If a PG is plugged “online” during running system, a higher fluctuation of the
interval is to be expected.
It is absolutely necessary to check the effects before plugging the device.
Rev. V3.0 - Endgültig 08.06.2004
31/50
Watchdog Interrupts
5.4
What happens if you use a different S7-CPU?
If you want to use a CPU which was not measured here, the tables below
will help you. Using these tables, you will be able to judge whether this S7CPU responds worse, identically or better.
The fluctuation of the interval of two watchdog interrupts “without
communication load” of the S7-CPUs is documented in the reference
manuals of the S7-CPUs. These values are summarized in the following
tables.
S7-300 CPUs
Fluctuation interval between watchdog interrupts in S7-300 CPUs without
communication load:
A&D AS CS3 KM
Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc
Table 5-1
Watchdog interrupt times S7-300: Excerpt from reference manuals
S7-CPU
Minimum (μs)
Maximum (μs)
312C-2
approx. 200
approx. 200
314C-2
approx. 200
approx. 200
312 IFM
approx. 200
approx. 200
313 / 314 / 314 IFM / 315
approx. 200
approx. 200
315-2 / 316-2
approx. 200
approx. 200
317-2
approx. 200
approx. 200
318-2
approx. 40
approx. 40
gray
= S7-CPUs used in the measurement
S7-400 CPUs
Fluctuation interval between watchdog interrupts in S7-400 CPUs without
communication load:
Table 5-2
Watchdog interrupt times S7-400: Excerpt from reference manuals
S7-CPU
Minimum (μs)
Maximum (μs)
412-1/-2
40
40
414-2/-3
40
40
416-2/-3
40
40
417-4
40
40
417-4H solo
850
850
417-4H redundant
700
700
gray
= S7-CPUs used in the measurement
Rev. V3.0 - Endgültig 08.06.2004
32/50
Watchdog Interrupts
5.5
Where do you find interesting information on the topic?
The table below lists manuals containing valuable information on “watchdog
interrupts”.
Table 5-3
List of manuals
No. Title
/1/
A&D AS CS3 KM
Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc
/2/
Chapter MLFB
System software for S7-300/400 system- and
standard functions – reference manual
1
Module data S7-300: “SIMATIC automation
system S7-300 module data”
3
3.2
/3/
Module data S7-400: “SIMATIC automation
system
S7-400, M7-400 module data“
4
/4/
Reference manual: “SIMATIC automation
system S7-300 CPU data: CPU 31xC and CPU
31x"
5
Reference manual “SIMATIC automation
system S7-400 CPU data”
3
/5/
Issue
6ES7810-4CA068AR0
12/2002
Documentation
package:
11/2002
6ES7398-8FA108AA0
Documentation
package:
6ES7498-8AA038AA0
Documentation
package:
09/2003
06/2003
6ES7398-8FA108AA0
Documentation
package:
12/2002
6ES7498-8AA038AA0
/6/
Reference manual: “SIMATIC automation
system S7-300 CPU data: CPU 312 IFM and
CPU 318-2 DP"
/7/
Communication with SIMATIC
Rev. V3.0 - Endgültig 08.06.2004
3
6ES7 398-8FA108AA0
10/2001
EWA 4NEB 710
6075-01 02
10/1999
33/50
Watchdog Interrupts
6
The Measurement in Detail
This chapter explains:
• The properties of the components
• The configuration and the programming of the components
• The measuring procedure
• The determination of the measured variables
• The MLFBs for the main components.
6.1
General boundary conditions for the measuring setup
Unless mentioned otherwise, all parameterizations / configurations
correspond to the default values of the components.
• September 2003
A&D AS CS3 KM
Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc
For the measuring setup, only components from the SIMATIC delivery
scope as of the date below were used:
6.2
Photograph of the measuring setup
Operator panel side
4 load CPUs
on PB-Bus
S7-400 test
CPU
SIMIT PC station:
Simulation of the 32
ET200 stations
Fig. 6-1
4 load CPUs on IE-Bus
S7-300 test
CPU
LeCroy
storage oscilloscope
Measuring setup
Rev. V3.0 - Endgültig 08.06.2004
34/50
Watchdog Interrupts
6.3
Properties of the hardware components
Different components were used during the measurements. The most
important properties of the core components will be briefly described below.
An overview table of the MLFBs and the versions of the essential
components are available in chapter 6.9.
Test CPU
• Communicates with the load CPUs via CP
• Reads/writes distributed I/O via the integrated DP interface
• Communicates with the OPs at the integrated MPI interface
• Measures its own cycle time.
• A PC with the simulation program SIMIT is connected at the integrated
DP interface. 32 ET200 stations are simulated.
• The PC creates a constant load for the test CPU.
A&D AS CS3 KM
Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc
Distributed I/O
Operator panel
• OPs are connected at the MPI interface of the test CPU.
• All OPs visualize data from the test CPU. In order to put a high load on
the S7-CPU, a configuration with many variables and a short clock was
chosen.
• The OPs create an optionally switchable load for the test CPU.
Programming device
• PG is connected online at the MPI interface of the test CPU.
• The PG executes the “Status Variable” function on the test CPU. On the
PG, one complete screen page is filled with status values. The contents
are taken from different memory areas of the S7-CPU.
• The PC creates an optionally switchable load for the test CPU.
Load CPUs on Profibus-CP and on Industrial Ethernet-CP
• The load CPUs are powerful S7-CPUs which exchange extensive data
with the test CPU.
• An optionally switchable load for the test CPU is created via the CP.
Rev. V3.0 - Endgültig 08.06.2004
35/50
Watchdog Interrupts
6.4
Properties of the software applications
In the following, you will be provided with important information on the
software applications used.
An overview table of the MLFBs and of the versions is available in chapter
6.9.
STEP7
Configuration / programming of the S7-CPUs:
• STEP7 V5.2 SP1
ProTool
For the image configuration was used:
6.5
A&D AS CS3 KM
Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc
• ProTool V6.0 SP2
Configuration of the components
This chapter provides important information on the configuration of the
hardware components used.
The description of the programs for the “intelligent” components can be
found in chapter 6.6.
Unless described differently, always the default settings of the components
apply.
Test CPU
Deviation from the standard parameterization of the CPU:
• Cycle monitoring time:
300ms
Baud rates of the integrated interfaces:
• MPI interface: 187,5Mbit/s
• DP interface: 1,5Mbit/s
Load CPU
The default settings are used.
Rev. V3.0 - Endgültig 08.06.2004
36/50
Watchdog Interrupts
Distributed I/O
ET200 stations are operated at the integrated DP interface of the test CPU.
The ET200 stations are simulated with the SIMIT simulator. The simulator
runs on a PC. The PC is connected to the internal Profibus interface of the
test CPU. The distributed I/O below is simulated:
• Number of ET200 stations:
32
• Type ET200:
ET200M
• Configuration:
16 byte I / 16 byte O
During all measurements, the ET200 stations are connected to the test
CPU and polled actively.
Subnet PB
Settings of the PB subnet:
• 12Mbit/s
• S7 connection
A&D AS CS3 KM
Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc
• FDL connection
Subnet IE
Settings of the IE subnet:
• 100Mbit/s
• Transport protocol TCP
• FDL: ISO-on-TCP
• S7 connection
Operator panel
OP configuration:
• Basic interval 200ms
• Display update: 200ms
• Display of 31 word variables
• Use of range pointer, fault and status messages.
Programming device
Settings:
• Operating mode: Process mode
• PG function “Status Variable”: A complete screen page with status
values is displayed on the PG.
Rev. V3.0 - Endgültig 08.06.2004
37/50
Watchdog Interrupts
6.6
Programming the components
This chapter describes the programs of the “intelligent” components.
6.6.1
STEP7 program of the test CPU
The STEP7 program of the test CPU consists of the program parts:
• User program:
○ Load program (OB1)
○ OP program (OB1)
○ Communication program (OB1)
○ Watchdog interrupt program (OB35)
Organization blocks
A&D AS CS3 KM
Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc
• Measuring program (OB1, OB35).
OB1
User program
Load program
OP program
OB35
Communication prog.
Watchdog interrupt prog.
Measuring program
Measuring program
Figure 6-2
Measuring program
Program parts in the test CPU
Definition user program:
All program parts are combined which have nothing to do with the
measured value acquisition. Basically, these program parts can also be
found in real applications.
Definition measuring program:
All program parts are combined which are exclusively used for the
acquisition of measured values. The programs exist in all measurements.
Depending on the configuration of the measurement, only the necessary
program parts are called.
Rev. V3.0 - Endgültig 08.06.2004
38/50
Watchdog Interrupts
Load program
The load program does not have a “real” function during the measurement.
With the program, only OB1 is filled to achieve the desired “no-load cycle
time”. The load program consists of a combination of different STEP7
commands:
Table 6-1
Weighting of the instructions in the load program of the test CPU
Statement type
Percentage in the load program
Binary statements
60%
Time / counter statements
20%
Data word commands
10%
Floating point arithmetic
10%
During adjusting, all loads (OPs on MPI, PG on MPI, load CPUs on IE and
load CPUs on PB-DP) except the simulated ET200 stations are taken away
physically. The communication program is not called. Thus, the no-load
program has the structure illustrated below:
A&D AS CS3 KM
Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc
Before the measurement, the no-load cycle time of the test CPU is once
adjusted to 20ms.
Organization blocks
OB1
Load program
OP program
Measuring program
Measuring program
Fig. 6-3
User program
OB35
Watchdog interrupt prog.
Measuring program
Program parts during cycle time adjusting
OP program
The variables in the OP program are incremented in OB1 of the test CPU in
every cycle. The program is used for the variation of the data displayed on
the OP.
Communication program
The test CPU communicates with the load CPUs via CPs. For this, a
communication program is processed cyclically in the respective CPUs.
The program permanently exchanges data with the load CPUs. After
completing a communication job, this job is restarted immediately. This
creates a very high communication load.
Rev. V3.0 - Endgültig 08.06.2004
39/50
Watchdog Interrupts
Two different communication types are realized:
• Without calls of communication blocks in OB1:
Test CPU does not actively participate in the communication; test CPU
is server
• With call of communication blocks in OB1:
Test CPU sends or receives data due to the call of communication
blocks. The communication blocks (SFCs/SFBs) are called cyclically.
Watchdog interrupt program
The watchdog interrupt program is implemented in OB35 and it is used for
the acquisition of watchdog interrupt times. This is realized either by setting
outputs (in the case of the S7-300 CPUs without S7-318) or by calling a
special function block for time determination (in S7-416 and S7-318).
Both variants used for the acquisition of watchdog interrupt times are
considered identical with regard to scope and processing time.
In OB1, the measuring program performs the following:
A&D AS CS3 KM
Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc
Measuring program
• Depending on the measurement configuration, communication calls are
disabled or processed
• The OB1 cycle time is cyclically written in a data block. After completing
the watchdog interrupt measurement, an evaluation program determines
the following measured variables (minimum, typical, maximum):
○ Interval of the watchdog interrupts in CPU318 and CPU416
○ OB1 cycle time.
A measuring program is realized in OB35:
• Only for S7-300 CPUs without 318:
Toggling of a digital output
• Only for S7-318 and S7-416:
Determination of the internal CPU time, calculation and storing of the
differential times between two watchdog interrupt calls.
Rev. V3.0 - Endgültig 08.06.2004
40/50
Watchdog Interrupts
6.6.2
STEP7 program of the load CPUs
The user program permanently exchanges data with the load CPUs. After
completing a communication job, this job is restarted immediately. This
creates a very high communication load.
Two different communication types are realized:
• Only PUT / GET is called cyclically in OB1 (setting "Without c-blocks" in
the test CPU). Test CPU is server.
• Communication blocks (e.g. SEND/RCV) are called cyclically in OB1.
6.6.3
Communication between test CPU and load CPUs
The tables below show with which blocks and with which user data size
each load CPU communicates with the test CPU.
Series of measurements
Subnet Without / with call of
c-blocks in test CPU
Blocks in
test CPU
Blocks in
load CPU
Length of
user data
in bytes
Number of
connectio
ns
PB
----AG_RCV
AG_SEND
AG_RCV
AG_SEND
----AG_RCV
AG_SEND
AG_RCV (*1)
AG_SEND (*1)
PUT
GET
AG_SEND
AG_RCV
AG_SEND
AG_RCV
PUT
GET
AG_SEND
AG_RCV
AG_SEND
AG_RCV
160
160
240
240
240
240
160
160
240
240
512 (*2)
512 (*2)
1
1
1
Series of measurements
Subnet Without / with call
c-blocks in test CPU
Blocks in test
CPU
Blocks in load
CPU
Length of
user data
in bytes
Number of
connectio
ns
PB
and
IE
----AG_RCV
AG_SEND
U_RCV
U_SEND
B_RCV
B_SEND
PUT
GET
AG_SEND
AG_RCV
U_SEND
U_RCV
B_SEND
B_RCV
400
400
240
240
440
440
16384
16384
1
1
1
A&D AS CS3 KM
Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc
Test object is S7-300 CPU
Without
With
IE
Without
With
1
1
1
1
1
(*1) In CPU318: AG_LRCV/AG_LSEND
(*2) In CPU318: 8192 bytes
Test object is S7-400 CPU
Without
With
Rev. V3.0 - Endgültig 08.06.2004
1
1
41/50
Watchdog Interrupts
6.7
Measuring procedure
This chapter briefly describes the individual steps required to measure a
measurement configuration:
• Measuring environments
• Performing the measurement.
6.7.1
Measuring environments
Depending on the CPU type, the measurement is performed with two
different measuring environments:
• Measuring environment 1
○ S7-300 CPUs without CPU 318
• Measuring environment 2
○ S7-400 CPUs and CPU 318
A&D AS CS3 KM
Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc
○ Measurement with the storage oscilloscope.
○ Measurement with the time determination function block.
6.7.2
Performance: Recording interval between watchdog interrupts
Measuring environment 1 (S7-300 CPUs without CPU 318)
A peripheral output word is alternately set and reset (toggling) by a direct
command in the user program of OB35.
In order to avoid additional specified times, the toggling output signal is
picked up directly at the backplane bus of the S7-CPU. To do this, a special
module is used which functions as interface to the storage oscilloscope
The recording is started at the storage oscilloscope. All differential times of
the toggling output bit are recorded by the storage oscilloscope and stored
internally.
The storage oscilloscope is stopped after 10.000 recordings and analyzed
via the internal histogram. The following values are determined:
• Minimum value:
Smallest value measured
• Maximum value:
Largest value measured
• Typical value:
Arithmetic mean from all measured values.
Rev. V3.0 - Endgültig 08.06.2004
42/50
Watchdog Interrupts
Measuring environment 2 (S7-CPU 318 and CPU 416)
In the first STEP7 instruction of OB35, a special SFC sensing the CPU time
in micro seconds is called to read the internal CPU time. The time is
temporarily stored and compared with the time of the previous SFC call.
The formed differential time is stored in a data block. The data are analyzed
after 10.000 acquired measured values and the measuring results are
written to output words.
• Minimum value:
Smallest value measured
• Maximum value:
Largest value measured
• Typical value:
Arithmetic mean from all measured values.
The measured values are rounded to two numbers of places after the
decimal point.
A&D AS CS3 KM
Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc
6.7.3
Performance: Recording OB1 cycle time
The OB1 cycle time is written during the watchdog interrupt measurement.
After the measurement has been completed, the measured values stored in
the data block are analyzed and written to ET200 outputs.
The following values are determined:
• Minimum value:
Smallest value measured
• Maximum value:
Largest value measured
• Typical value:
Arithmetic mean from all measured values.
Rev. V3.0 - Endgültig 08.06.2004
43/50
Watchdog Interrupts
6.7.4
Example of a series of measurements
The figure below shows a screenshot of the storage oscilloscope after a
series of measurements with 10.000 measurements. In this example, the
CPU 318 was recorded with all active communication loads.
The statistical allocation of the measured values can roughly be derived
from the height of the bar.
The lower the bar, the smaller the number of measured values that have
occurred in this range. The x-axis is the time axis.
Minimum
measured
value
A&D AS CS3 KM
Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc
Largest number of
a measured value
Maximum
measured
value
t
Typical measured
value
Number of measured
values taken
Fig. 6-4
Example of a series of measurements: Screenshot of the storage
oscilloscope
Rev. V3.0 - Endgültig 08.06.2004
44/50
Watchdog Interrupts
6.8
Determining the measured variables
This chapter defines the measured variables and it introduces the
measuring method.
Measured variables:
• Interval between watchdog interrupts
• OB1 cycle time.
6.8.1
Interval between two watchdog interrupts
Definition
The time between event 1 and event 2 is measured:
Event 1: Call OB35, execution of first STEP7 instruction in OB35
A&D AS CS3 KM
Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc
The “interval between watchdog interrupts” is the time between two calls of
watchdog interrupt OBs (OB35)
Event 2: Following call of OB35, execution of the first STEP7 instruction in
OB35.
Rev. V3.0 - Endgültig 08.06.2004
45/50
Watchdog Interrupts
Measuring method
Measuring environment 1 (S7-300 CPUs without CPU 318):
In the STEP7 program, a bit is toggled after each OB35 call and output to a
digital output module via an I/O direct command. A special laboratory
module is used which operates without output delay.
The toggling output signal is detected and stored with a storage
oscilloscope. The storage oscilloscope is stopped after a cycle of 10.000
OB35 calls and the measuring results are analyzed.
Measuring environment 2 (S7-CPU 318 and CPU 416):
In the first STEP7 instruction of OB35, a special SFC determining the CPU
time in micro seconds is called to read the internal CPU time. The time is
temporarily stored and compared with the time of the previous SFC call.
The differential time is formed and stored in a data block. The measuring
results are analyzed after 10.000 differential times have been recorded.
Test CPU
A&D AS CS3 KM
Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc
Schema of the measuring setup and the capture of the performance data:
ET200M
32 stations
simulated
Internal measuring point
in the STEP7 program
(CPU318 and CPU416)
OB35 call
DO
Profibus-DP
SIMIT PC
Industrial Ethernet
MPI-Bus
Number 3 / 15
OP170B
Profibus
PG
t
Industrial Ethernet
MPI
4 load CPUs
4 load CPUs
External measuring point
(CPU314C, CPU315 and CPU317)
Profibus-DP
Profibus
Fig. 6-5
Schema of the acquisition of the interval between two watchdog interrupts
Rev. V3.0 - Endgültig 08.06.2004
46/50
Watchdog Interrupts
Time sequence (S7-CPU 300 without S7-CPU 318)
S7-300 laboratory
module
Test CPU
Output command is
transferred to the K-Bus
Setting DO in OB35 of the test
CPU via direct command
T1
T2
K-Bus
Signal at terminal of
laboratory module and at
input of oscilloscope
Time axis
with
times
Fig. 6-6
A&D AS CS3 KM
Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc
T3
Time axis
with
times
Signal in the memory of
the oscilloscope
Time sequence of the measurement of the watchdog interrupts
Description of the intervals Tx
The following table describes the intervals T1 to T3 as displayed in the time
sequence.
Table 6-2
Description of the intervals Tx for the watchdog interrupts
Time Description
Magnitude Depending on
T1
From: Setting a digital output in the user program of the
test CPU via direct command.
Until: The operating system transfers the signal to the Kbus.
<10µs
Operating
system
T2
From: See above
Until: Signal pending at the output terminal of the
laboratory module and at the input of the oscilloscope.
<10µs
K-bus
T3
From: See above
<0,1µs
Storage
oscilloscope
Until: Signal is stored in the oscilloscope.
Rough measuring error consideration
Due to the specified times described above, a measuring error remains
smaller than 20µs.
Rev. V3.0 - Endgültig 08.06.2004
47/50
Watchdog Interrupts
6.8.2
OB1 cycle time
Definition
The OB1 cycle time is the time the operating system requires for
processing the cyclic program as well as all program parts interrupting this
cycle (e.g. processing a process or a watchdog interrupt) and system
activities (e.g. process image updates).
Measuring method
During measuring the intervals between two watchdog interrupts, the ring
buffer is filled with 5.000 cycle time measured values or continuously
overwritten. This ensures that the 5.000 current measured values are in the
ring buffer.
A&D AS CS3 KM
Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc
The duration of the previous OB1 throughput can be polled in OB1. This
value is read out from the start information of OB1 and stored in a data
block functioning as ring buffer.
If the measurement is completed, values are no longer written into the ring
buffer and the evaluation of the cycle time is triggered.
The cycle time measurement supplies minimum, maximum and typical
cycle time. The typical cycle time is averaged. This is done via the 5.000
values in the ring buffer.
Rev. V3.0 - Endgültig 08.06.2004
48/50
Watchdog Interrupts
6.9
Overview of the components (MLFB, versions)
Here, you find a summary of all components involved in the measurement.
Hardware components
Application
Component
Type
S7 station
S7-CPU
CPU 314C-2DP
CPU 315-2DP
CPU317-2DP
of the test object
IE CP
PB CP
A&D AS CS3 KM
Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc
Communication
S7-CPU
MLFB
E status
Firmware
version
6ES7314-6CF01-0AB0
1
V2.0.5
6ES7315-2AG10-0AB0
1
V2.0.0
6ES7317-2AJ10-0AB0
1
V.2.1.1
CPU318-2DP
6ES7318-2AJ00-0AB0
3
V3.0.1
CPU 416-2DP
6ES7416-2XK02-0AB0
7
V3.1.0
CP343-1
6GK7343-1EX11-0AB0
2
V2.0.0
CP443-1
6GK7343-1EX11-0XE0
3
V2.3
CP342-5
6GK7342-5DA02-0XE0
1
V5.2.8
CP443-5
6GK7443-5DX02-0XE0
2
V3.2.3
CPU 416-2DP
6ES7416-2XK02-0AB0
5
V3.0.1
load of the
IE CP 1
CP443-1
6GK7443-1EX11-0XE0
3
V2.1.0
test object
PB CP 1
CP443-5
6GK7443-5FX01-0XE0
1
V3.2
OP
OP170B
6AV6542-0BB15-2AX0
10
V1.0.7
Bus components
Switch
IE
6GK1105-3AB00
2
V2.1
Repeater
RS485
6ES7972-0AA01-0XA0
1
--
Software components
Application
Component
MLFB
Version
Configuration / programming S7
STEP7
6ES7 810-4CC06-0XY0
V5.2 SP1
OP configuration
Pro Tool
6AV 6581-3BX06-0CX0
V6.0 SP2
Rev. V3.0 - Endgültig 08.06.2004
49/50
Watchdog Interrupts
7
Appendix
7.1
Abbreviations
Table 7-1
Abbreviations
A&D AS CS3 KM
Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc
Abbreviations
CP
CPU
DO
DB
DI
DP
FB
FC
I/O
IE
C-block
C-load
“Cycle load due to communication”
max
min
MPI
OB
OP
PB
PG
S7
SEC
SFB
SFC
SIMIT
typ
7.2
Table 7-2
Term
Load CPU
Test CPU
Explanations
Communications processor
Central processing unit
Digital output
Data block, usable in the STEP7 user program
Digital input
Distributed I/O
Function block, callable in the STEP7 user
program
Function, callable in the STEP7 user program
Inputs / outputs
Industrial Ethernet
Communication block
Communication load
Parameter in the hardware configuration
Maximum value
Minimum value
Multiple Point Interface
Organization block
Operator Panel
Profibus
Programming device
Control system from the SIMATIC family
SIMATIC Expert Communication
Standard function block
System function, callable in the STEP7 user
program
SIMIT® process simulation system
Typical value, arithmetic mean
Definitions
Definitions
Definition
The load-CPU communicates with the test CPU via a PB subnet or an IE
subnet.
This S7-CPU processes the watchdog interrupt OB (OB35).
The performance data are measured for this S7-CPU.
Rev. V3.0 - Endgültig 08.06.2004
50/50
Download