Professional Documents
Culture Documents
Weckalarm Doku v30 e
Weckalarm Doku v30 e
Content
1 Preliminary Remarks
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
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).
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
Only current components from the SIMATIC delivery scope were used for
the measurements:
• As at August 2003
OP7 OP170B
21626316_weckalarm_DOKU_v30_e.doc
This table allows you to decide quickly which chapter you want to read.
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.
• Load CPU:
The load-CPU communicates with the test CPU via a PB subnet or an IE
subnet.
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
Reference potential (M) is grounded. All racks are connected with the
station ground.
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
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
2.2 Configurations
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.
Event 2:
Following process image update in the S7-CPU.
Note
If the macros cannot be activated, the safety settings in “Tools/Macros/Safety”
must be set to medium.
Tab
selection
Functional
model
Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc
A&D AS CS3 KM
Operation
All input and output boxes are doubled in order to enable simultaneous
viewing of two configurations:
• Configuration 1: Shaded yellow
• Configuration 2: Shaded purple.
Input section
Output section
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?
Proceed as follows:
In a first step, select two identical configurations (“yellow“ and ”purple“
A&D AS CS3 KM
You can read immediately whether the watchdog interrupts are within the
required tolerance.
The influence can now be seen in the “yellow” and “purple” output boxes.
You can also do this similarly for other measuring parameters.
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
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
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?
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
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.
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
x-axis:
Parameters of the configuration
4.5
Watchdog Interrupts OB35
27/50
Copyright © Siemens AG 2005 All rights reserved
21626316_weckalarm_DOKU_v30_e.doc
A&D AS CS3 KM
OB1 OB35
10ms
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
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.
limited to the set value. Yet, higher communication loads may develop
21626316_weckalarm_DOKU_v30_e.doc
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.
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
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
31x" 6ES7398-8FA10-
8AA0
A&D AS CS3 KM
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
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.
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
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.
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.
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
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
Organization blocks
OB1
Load program OB35 User program
OP program Watchdog interrupt prog.
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.
Measuring program
Copyright © Siemens AG 2005 All rights reserved
• 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.
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.
The tables below show with which blocks and with which user data size
each load CPU communicates with the test CPU.
Subnet Without / with call of test CPU load CPU user data connectio
in bytes ns
21626316_weckalarm_DOKU_v30_e.doc
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
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
Definition
The “interval between watchdog interrupts” is the time between two calls of
watchdog interrupt OBs (OB35)
Copyright © Siemens AG 2005 All rights reserved
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
MPI-Bus Profibus
SIMIT PC
Number 3 / 15 PG
OP170B
t
Industrial Ethernet
Fig. 6-5 Schema of the acquisition of the interval between two watchdog interrupts
S7-300 laboratory
Test CPU module
Output command is
transferred to the K-Bus
Signal at terminal of
T2
laboratory module and at
K-Bus input of oscilloscope
T3
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
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
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
7 Appendix
7.1 Abbreviations
7.2 Definitions