Download as pdf or txt
Download as pdf or txt
You are on page 1of 50

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


We do not accept any liability for the information contained in this
document.
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
Copyright © Siemens AG 2005 All rights reserved

not imply a change in the burden of proof to your detriment.


21626316_weckalarm_DOKU_v30_e.doc

The Application Examples are not binding and do not claim to be


complete regarding the circuits shown, equipping and any
A&D AS CS3 KM

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

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
Copyright © Siemens AG 2005 All rights reserved

3 Overview of the Simulator....................................................................... 16


21626316_weckalarm_DOKU_v30_e.doc

3.1 The user interface ...................................................................................... 16


A&D AS CS3 KM

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


Watchdog Interrupts OB35

6.5 Configuration of the components ............................................................... 36


6.6 Programming the components ................................................................... 38
6.6.1 STEP7 program of the test CPU ................................................................ 38
6.6.2 STEP7 program of the load CPUs ............................................................. 41
6.6.3 Communication between test CPU and load CPUs ................................... 41
6.7 Measuring procedure ................................................................................. 42
6.7.1 Measuring environments............................................................................ 42
6.7.2 Performance: Recording interval between watchdog interrupts................. 42
6.7.3 Performance: Recording OB1 cycle time ................................................... 43
6.7.4 Example of a series of measurements....................................................... 44
6.8 Determining the measured variables ......................................................... 45
6.8.1 Interval between two watchdog interrupts.................................................. 45
6.8.2 OB1 cycle time ........................................................................................... 48
6.9 Overview of the components (MLFB, versions) ......................................... 49
7 Appendix................................................................................................... 50
7.1 Abbreviations ............................................................................................. 50
7.2 Definitions .................................................................................................. 50
Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc
A&D AS CS3 KM

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 S7-
CPU.
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:
• How exactly is the configured interval between two watchdog interrupts
kept to?
Copyright © Siemens AG 2005 All rights reserved

Nowadays, an S7-CPU has to manage various communication tasks aside


21626316_weckalarm_DOKU_v30_e.doc

from control tasks. An S7-CPU often communicates simultaneously with a


programming device, operating modules and other S7-CPUs via PB
A&D AS CS3 KM

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!

Documentation
If you are more interested in trends and magnitudes, please refer to the
Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc

diagrams in the documentation.


You will find a concise summary of the measuring results, valuable
A&D AS CS3 KM

background information, tips for optimizing your configuration and a


detailed description of the measurement.

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 Content
Simulator EXCEL 2000 V3.0 • 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
• Background knowledge
Copyright © Siemens AG 2005 All rights reserved

The download “Documentation“ is available to you with this document.


21626316_weckalarm_DOKU_v30_e.doc
A&D AS CS3 KM

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 Date of Version Measuring Change
documentation release measurement setup status
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 Editing for the Shop
V3.0 Oct. 2003 V3.0 Aug. 2003 Repeated
measurement

Rev. V3.0 - Endgültig 08.06.2004 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
• Added: CPU317-2DP
Line-oriented operator panel: Windows-CE operator panel:
Copyright © Siemens AG 2005 All rights reserved

OP7 OP170B
21626316_weckalarm_DOKU_v30_e.doc

Additional measured variable


OB1 cycle time
A&D AS CS3 KM

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: Field of application cause, aims and application
Preliminary Remarks Overview of the downloads field of the measurement.
History of the documentation
Differences of the measurements
Chapter 2: Measuring setup the most important details
Overview of the Measurement Measured variables for a quick start.
Technical data
Chapter 3: User interface
Copyright © Siemens AG 2005 All rights reserved

Overview of the Simulator Tables


21626316_weckalarm_DOKU_v30_e.doc

Chapter 4: Diagrams the evaluation


Diagrams for quick comprehension.
A&D AS CS3 KM

Chapter 5: Factors influencing interval interesting and valuable


Background Knowledge and Use of other S7-CPUs aspects on the subject of the
Tips for Optimization measurement.
Sources of information
Tips for optimization.
Chapter 6: Properties of the components all details
The Measurement in Detail Measuring procedure required to understand and
Determination of the measured reproduce the measurement.
variables
Overview of MLFB
Chapter 7: Abbreviations important abbreviations and
Appendix Definitions definitions for orientation.

Rev. V3.0 - Endgültig 08.06.2004 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:


In order to distinguish the S7-CPUs, the names listed below are used:
• Test CPU:
Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc

This S7-CPU processes the watchdog interrupt OB (OB35). The


performance data are measured for this S7-CPU.
A&D AS CS3 KM

• 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.
• 32 ET200 stations are connected at the integrated DP interface of the
test CPU.

Mechanical and electrical setup


Copyright © Siemens AG 2005 All rights reserved

All components are set up according to the setup guidelines in the following
21626316_weckalarm_DOKU_v30_e.doc

SIMATIC manuals:
A&D AS CS3 KM

• 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 DI PB-CP IE-CP

OB 1
Measuring
A I0.0
point S M 20.1
of the .
cycle time .
.OB35
.UC SFB xy
.T MW 400
t .BE
.
.
.
.
.OB35
.UC SFB xy
.T MW 400
.BE
.
.
Copyright © Siemens AG 2005 All rights reserved

BE
DP MPI PB IE
21626316_weckalarm_DOKU_v30_e.doc

1,5 Mbit 187,5 kbit


A&D AS CS3 KM

Profibus-DP

CPUnn
CPU Measuring point for the interval
32 ET200 between two watchdog interrupts

Communication load
Profibus

Industrial
MPI Ethernet

CPU n
CPU CPUnn CPUnn
PG 3 / 15n 4CPU
load 4CPU
load
OP170B CPUs CPUs

Fig. 2-1 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:


Constants of the test CPU:
• Length of the user program
Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc

• Call interval of the watchdog interrupt (OB35)


A&D AS CS3 KM

• 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).

Interval between watchdog interrupts:


This is the time between event 1 and event 2:
Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc

Event 1:
Call OB35, execution of first STEP7 instruction in OB35
A&D AS CS3 KM

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 Technical data of the measurement


Simulator Watchdog interrupts
Outputs:
Measured variable: Measured values Unit Comments
Interval between Maximum, typical, ms, 2 numbers of places Interval of two OB35 calls
watchdog interrupts minimum value after the decimal point
Cycle time Maximum, typical, ms, no number of places OB1 cycle time of the S7-CPU
minimum value after the decimal point
Inputs:
Component: Feature Measuring parameters Comments
S7-CPU Type 314C-2DP S7-300 CPU with integrated I/O
(test CPU) 315-2DP S7-300 CPU
317-2DP S7-300 CPU
318-2DP S7-300 CPU
416-2DP S7-400 CPU
Cycle load due to 5% / 10% Smallest value possible (S7-400: 5%, S7-300: 10%)
Copyright © Siemens AG 2005 All rights reserved

communication 20% Default value


21626316_weckalarm_DOKU_v30_e.doc

Call of Yes Communication blocks in test CPU and load CPUs:


communication blocks in Communication SFC calls in OB1
A&D AS CS3 KM

OB1 of the test CPU No Communication blocks only in load CPUs:


PUT, GET; test CPU is server
Communication load Without load No communication load on the test CPU
PG on MPI PG on MPI. Online function “Status Variable”
OPs on MPI 3/15 OP on MPI. Acquisition cycle 200ms.
Load CPUs via PB-CP Four 400-CPUs communicate with test CPU via PB-CP
Load CPUs via IE-CP Four 400-CPUs communicate with test CPU via IE-CP
All loads All above loads act simultaneously on the
test CPU and “Call communication block” = “Yes”
Constant:
Component Feature Range of values Comments
Test CPU Baud rate DP 1,5MBit/s
Baud rate MPI 187,5kBit/s
Run time user program in 20ms Applies to “Communication load” = “Without” (“no-load”)
the test object
Interval OB35 10ms Length user program in OB35: 100 instructions
ET200 on DP Type ET200M Simulated with SIMIT simulator
Number of stations 32
Configuration 16 byte DI
16 byte DO
Subnet PB 12MBit/s
IE 100MBit/s
OP Type OP 170B
Information:
Component Display Range of values Comments
Test CPU Cycle time without c-load 20ms Value is set via a load program.
Interval OB35 10ms Fixed set
Number of OPs 3 / 15 Number of OPs connected to selected test CPU
Number of load CPUs 4 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
• Open the Excel file
• If prompted “Enable macros“
Copyright © Siemens AG 2005 All rights reserved

• Select the ”Simulation“ tab.


21626316_weckalarm_DOKU_v30_e.doc
A&D AS CS3 KM

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)

Yellow boxes: Purple boxes:


Selectable tabs:
Configuration 1 Configuration 2
Integrated description

Tab
selection

Functional
model
Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc
A&D AS CS3 KM

Operation

Input section: Information section: Output section:

Configuration of Display of important Performance data watchdog


the S7- CPU constants 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
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:
• Input section (shaded green):
Contains the input boxes for selecting a configuration.
Copyright © Siemens AG 2005 All rights reserved

• Output section (shaded orange):


21626316_weckalarm_DOKU_v30_e.doc

Contains the output boxes for displaying the performance data.


A&D AS CS3 KM

• 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 Input box for configuration 2


Selection: x Selection: y

Output section

Output box for configuration 1 Output box for configuration 2


Output: x (measured) Output: y (measured)

Figure 3-2 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.
Can the CPU 315-2DP meet these requirements?

Application of the simulator


Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc

Proceed as follows:
In a first step, select two identical configurations (“yellow“ and ”purple“
A&D AS CS3 KM

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
• Open the Excel file
• If prompted "Enable macros"
the user interface of the simulator appears on the screen
Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc

• Close the user interface of the simulator:


The standard Excel user interface appears. The tables are available in
A&D AS CS3 KM

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.

Configurations Measuring results


(performance data)
Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc
A&D AS CS3 KM

Series of measurements
example:
CPU TYPE: CPU315-2DP
Load: 4 CPUs on PB
Cycle load due to communication: 10%
with communication (send/receive)
CPU TYPE
Fig. 3-3 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:
• Minimum, typical and maximum interval between watchdog interrupts
depending on
Copyright © Siemens AG 2005 All rights reserved

• communication load
21626316_weckalarm_DOKU_v30_e.doc

• cycle load due to communication.


A&D AS CS3 KM

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 Manager diagram
(test object)
Chapter Summarization of Chapter
314C-2DP 4.1 x 4.6
315-2DP 4.2 x
317-2DP 4.3 x
318-2DP 4.4 x
416-2DP 4.5 x

Rev. V3.0 - Endgültig 08.06.2004 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

Description
of a diagram
bar
Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc
A&D AS CS3 KM

Cycle load due to Communication blocks: Type of the communication load:


communication: send/receive or put/get Without load, PG on MPI, OPs on
5%/10% or 20% 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.
Thus, the entire fluctuation range of the measured values is displayed.
Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc
A&D AS CS3 KM

Rev. V3.0 - Endgültig 08.06.2004 24/50


Watchdog Interrupts OB35

4.1 Overview diagram: CPU314C-2DP


Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc
A&D AS CS3 KM

4.2 Overview diagram: CPU315-2DP

Rev. V3.0 - Endgültig 08.06.2004 25/50


Watchdog Interrupts OB35

4.3 Overview diagram: CPU317-2DP


Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc
A&D AS CS3 KM

4.4 Overview diagram: CPU318-2DP

Rev. V3.0 - Endgültig 08.06.2004 26/50


Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc
A&D AS CS3 KM

4.5
Watchdog Interrupts OB35

Rev. V3.0 - Endgültig 08.06.2004


Overview diagram: CPU416-2DP

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?
• Where is interesting information on the topic available?
Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc

5.1 Why is the call of the watchdog interrupt OB delayed?


A&D AS CS3 KM

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

10ms
Copyright © Siemens AG 2005 All rights reserved

There are different causes for the delay of the call of the watchdog interrupt
21626316_weckalarm_DOKU_v30_e.doc

OB:
A&D AS CS3 KM

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.
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%.
With this mechanism, the communication load of OB1 can on average be
Copyright © Siemens AG 2005 All rights reserved

limited to the set value. Yet, higher communication loads may develop
21626316_weckalarm_DOKU_v30_e.doc

within the timeslices.


A&D AS CS3 KM

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 S7-
CPU 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:

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
Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc

312 IFM approx. 200 approx. 200


313 / 314 / 314 IFM / 315 approx. 200 approx. 200
A&D AS CS3 KM

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 Chapter MLFB Issue
/1/ System software for S7-300/400 system- and 1 6ES7810-4CA06- 12/2002
standard functions – reference manual 3.2 8AR0
/2/ Module data S7-300: “SIMATIC automation 3 Documentation 11/2002
system S7-300 module data” package:
6ES7398-8FA10-
8AA0
/3/ Module data S7-400: “SIMATIC automation 4 Documentation 09/2003
system package:
S7-400, M7-400 module data“ 6ES7498-8AA03-
8AA0
/4/ Reference manual: “SIMATIC automation 5 Documentation 06/2003
Copyright © Siemens AG 2005 All rights reserved

system S7-300 CPU data: CPU 31xC and CPU package:


21626316_weckalarm_DOKU_v30_e.doc

31x" 6ES7398-8FA10-
8AA0
A&D AS CS3 KM

/5/ Reference manual “SIMATIC automation 3 Documentation 12/2002


system S7-400 CPU data” package:
6ES7498-8AA03-
8AA0
/6/ Reference manual: “SIMATIC automation 3 6ES7 398-8FA10- 10/2001
system S7-300 CPU data: CPU 312 IFM and 8AA0
CPU 318-2 DP"
/7/ Communication with SIMATIC EWA 4NEB 710 10/1999
6075-01 02

Rev. V3.0 - Endgültig 08.06.2004 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.
For the measuring setup, only components from the SIMATIC delivery
scope as of the date below were used:
• September 2003
Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc
A&D AS CS3 KM

6.2 Photograph of the measuring setup

Operator panel side


4 load CPUs
on PB-Bus
S7-400 test S7-300 test
CPU CPU

SIMIT PC station: 4 load CPUs on IE-Bus LeCroy


Simulation of the 32 storage oscilloscope
ET200 stations

Fig. 6-1 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.

Distributed I/O
• A PC with the simulation program SIMIT is connected at the integrated
DP interface. 32 ET200 stations are simulated.
Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc

• The PC creates a constant load for the test CPU.


A&D AS CS3 KM

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:
• ProTool V6.0 SP2
Copyright © Siemens AG 2005 All rights reserved

6.5 Configuration of the components


21626316_weckalarm_DOKU_v30_e.doc
A&D AS CS3 KM

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
• FDL connection
Copyright © Siemens AG 2005 All rights reserved

• S7 connection
21626316_weckalarm_DOKU_v30_e.doc
A&D AS CS3 KM

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)
• Measuring program (OB1, OB35).
Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc

Organization blocks
A&D AS CS3 KM

OB1
Load program User program
OP program OB35

Communication prog. Watchdog interrupt prog.

Measuring program Measuring program Measuring program

Figure 6-2 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%

Before the measurement, the no-load cycle time of the test CPU is once
adjusted to 20ms.
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
Copyright © Siemens AG 2005 All rights reserved

physically. The communication program is not called. Thus, the no-load


21626316_weckalarm_DOKU_v30_e.doc

program has the structure illustrated below:


A&D AS CS3 KM

Organization blocks

OB1
Load program OB35 User program
OP program Watchdog interrupt prog.

Measuring program Measuring program Measuring program

Fig. 6-3 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.

Measuring program
Copyright © Siemens AG 2005 All rights reserved

In OB1, the measuring program performs the following:


21626316_weckalarm_DOKU_v30_e.doc

• Depending on the measurement configuration, communication calls are


disabled or processed
A&D AS CS3 KM

• 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.

Test object is S7-300 CPU


Series of measurements Blocks in Blocks in Length of Number of
Copyright © Siemens AG 2005 All rights reserved

Subnet Without / with call of test CPU load CPU user data connectio
in bytes ns
21626316_weckalarm_DOKU_v30_e.doc

c-blocks in test CPU


PB Without --- PUT 160 1
A&D AS CS3 KM

--- GET 160 1


With AG_RCV AG_SEND 240 1
AG_SEND AG_RCV 240
AG_RCV AG_SEND 240 1
AG_SEND AG_RCV 240
IE Without --- PUT 160 1
--- GET 160 1
With AG_RCV AG_SEND 240 1
AG_SEND AG_RCV 240
AG_RCV (*1) AG_SEND 512 (*2) 1
AG_SEND (*1) AG_RCV 512 (*2)
(*1) In CPU318: AG_LRCV/AG_LSEND
(*2) In CPU318: 8192 bytes

Test object is S7-400 CPU


Series of measurements Blocks in test Blocks in load Length of Number of
Subnet Without / with call CPU CPU user data connectio
c-blocks in test CPU in bytes ns

PB Without --- PUT 400 1


and --- GET 400 1
IE With AG_RCV AG_SEND 240 1
AG_SEND AG_RCV 240
U_RCV U_SEND 440 1
U_SEND U_RCV 440
B_RCV B_SEND 16384 1
B_SEND B_RCV 16384

Rev. V3.0 - Endgültig 08.06.2004 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
○ Measurement with the storage oscilloscope.
• Measuring environment 2
Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc

○ S7-400 CPUs and CPU 318


○ Measurement with the time determination function block.
A&D AS CS3 KM

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.

6.7.3 Performance: Recording OB1 cycle time


Copyright © Siemens AG 2005 All rights reserved

The OB1 cycle time is written during the watchdog interrupt measurement.
21626316_weckalarm_DOKU_v30_e.doc

After the measurement has been completed, the measured values stored in
the data block are analyzed and written to ET200 outputs.
A&D AS CS3 KM

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.

Largest number of
a measured value
Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc

Maximum
Minimum measured
measured
A&D AS CS3 KM

value
value

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 “interval between watchdog interrupts” is the time between two calls of
watchdog interrupt OBs (OB35)
Copyright © Siemens AG 2005 All rights reserved

The time between event 1 and event 2 is measured:


21626316_weckalarm_DOKU_v30_e.doc

Event 1: Call OB35, execution of first STEP7 instruction in OB35


A&D AS CS3 KM

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.

Schema of the measuring setup and the capture of the performance data:
Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc

Test CPU
Internal measuring point
A&D AS CS3 KM

ET200M in the STEP7 program


32 stations OB35 call (CPU318 and CPU416)
simulated

Profibus-DP DO Industrial Ethernet

MPI-Bus Profibus
SIMIT PC

Number 3 / 15 PG
OP170B

t
Industrial Ethernet

MPI 4 load CPUs 4 load CPUs

Profibus-DP External measuring point


(CPU314C, CPU315 and CPU317)
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
Test CPU module
Output command is
transferred to the K-Bus

Setting DO in OB35 of the test


CPU via direct command T1

Signal at terminal of
T2
laboratory module and at
K-Bus input of oscilloscope

T3

Signal in the memory of


the oscilloscope
Time axis Time axis
with with
times times
Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc

Fig. 6-6 Time sequence of the measurement of the watchdog interrupts


A&D AS CS3 KM

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 <10µs Operating
test CPU via direct command. system
Until: The operating system transfers the signal to the K-
bus.
T2 From: See above <10µs K-bus
Until: Signal pending at the output terminal of the
laboratory module and at the input of the oscilloscope.
T3 From: See above <0,1µs Storage
Until: Signal is stored in the oscilloscope. 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
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.
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.
Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc

If the measurement is completed, values are no longer written into the ring
buffer and the evaluation of the cycle time is triggered.
A&D AS CS3 KM

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 MLFB E status Firmware
version
S7 station S7-CPU CPU 314C-2DP 6ES7314-6CF01-0AB0 1 V2.0.5
of the test object CPU 315-2DP 6ES7315-2AG10-0AB0 1 V2.0.0
CPU317-2DP 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
IE CP CP343-1 6GK7343-1EX11-0AB0 2 V2.0.0
CP443-1 6GK7343-1EX11-0XE0 3 V2.3
PB CP CP342-5 6GK7342-5DA02-0XE0 1 V5.2.8
CP443-5 6GK7443-5DX02-0XE0 2 V3.2.3
Communication S7-CPU 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
Copyright © Siemens AG 2005 All rights reserved

test object PB CP 1 CP443-5 6GK7443-5FX01-0XE0 1 V3.2


21626316_weckalarm_DOKU_v30_e.doc

OP OP170B 6AV6542-0BB15-2AX0 10 V1.0.7


A&D AS CS3 KM

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


Abbreviations Explanations
CP Communications processor
CPU Central processing unit
DO Digital output
DB Data block, usable in the STEP7 user program
DI Digital input
DP Distributed I/O
FB Function block, callable in the STEP7 user
program
FC Function, callable in the STEP7 user program
I/O Inputs / outputs
IE Industrial Ethernet
C-block Communication block
Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc

C-load Communication load


“Cycle load due to communication” Parameter in the hardware configuration
A&D AS CS3 KM

max Maximum value


min Minimum value
MPI Multiple Point Interface
OB Organization block
OP Operator Panel
PB Profibus
PG Programming device
S7 Control system from the SIMATIC family
SEC SIMATIC Expert Communication
SFB Standard function block
SFC System function, callable in the STEP7 user
program
SIMIT SIMIT® process simulation system
typ Typical value, arithmetic mean

7.2 Definitions

Table 7-2 Definitions


Term Definition
Load CPU The load-CPU communicates with the test CPU via a PB subnet or an IE
subnet.
Test CPU 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

You might also like