s7 Pdiag For s7-300 and s7-400 Diagnostics For Lad, STL, and FBD - Ingles
s7 Pdiag For s7-300 and s7-400 Diagnostics For Lad, STL, and FBD - Ingles
s7 Pdiag For s7-300 and s7-400 Diagnostics For Lad, STL, and FBD - Ingles
User Information
Introduction to S7 PDIAG 1
Installing the S7 PDIAG
SIMATIC Optional Package 2
Getting Started with S7 PDIAG
and ProAgent/PC 3
S7 PDIAG for Configuring Address Monitoring
S7-300 and S7-400 with S7 PDIAG 4
Configuring Process Configuring General Monitoring
5
with S7 PDIAG
Diagnostics for LAD, STL,
and FBD Configuring Motion Monitoring
with S7 PDIAG 6
Generating and Downloading
Monitoring Blocks for
Manual
S7 PDIAG 7
Printing and Exporting
Diagnostic Data with S7 PDIAG 8
Advanced Programming
with S7 PDIAG 9
Appendices
Notes on Programming Your
User Program A
The Language Elements in
S7 PDIAG and their Syntax B
Example of Using Monitoring
Types with S7 PDIAG C
Tips and Tricks for Working
with S7 PDIAG D
Glossary, Index
Edition 07/2000
A5E00063001-01
Safety Guidelines This manual contains notices which you should observe to ensure your own personal safety, as well as to
protect the product and connected equipment. These notices are highlighted in the manual by a warning
triangle and are marked as follows according to the level of danger:
Danger
! indicates that death, severe personal injury or substantial property damage will result if proper precautions are
not taken.
Warning
! indicates that death, severe personal injury or substantial property damage can result if proper precautions are
not taken.
Caution
! indicates that minor personal injury or property damage can result if proper precautions are not taken.
Note
draws your attention to particularly important information on the product, handling the product, or to a particular
part of the documentation.
Qualified Personnel The device/system may only be set up and operated in conjunction with this manual.
Only qualified personnel should be allowed to install and work on this equipment. Qualified persons are
defined as persons who are authorized to commission, to ground, and to tag circuits, equipment, and
systems in accordance with established safety practices and standards.
Warning
! This device and its components may only be used for the applications described in the catalog or the technical
description, and only in connection with devices or components from other manufacturers which have been
approved or recommended by Siemens.
This product can only function correctly and safely if it is transported, stored, set up, and installed correctly, and
operated and maintained as recommended.
Trademarks SIMATIC, SIMATIC NET and SIMATIC HMI are registered trademarks of SIEMENS AG.
Third parties using for their own purposes any other names in this document which refer to
trademarks might infringe upon the rights of the trademark owners.
Audience
This manual is intended for STEP 7 programmers and persons who are
configuring, commissioning, or servicing automation systems.
General knowledge of automation technology and experience of using the STEP 7
Standard software are required.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 iii
Important Notes
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
iv A5E00063001-01
Important Notes
Guidelines
This manual requires knowledge of S7 programs which you can read about in the
Programming Manual /234/. Since the S7 PDIAG process diagnostics software is
based on the STEP 7 Standard software, you should also be familiar with using the
Standard software which is described in the STEP 7 User Manual /231/.
This manual is structured as follows:
• Chapter 1 introduces you to process diagnostics with S7 PDIAG. It describes
the functional capabilities and the main advantages of S7 PDIAG. It also
provides you with an overview of the individual configuration steps and the
general procedure when working with S7 PDIAG.
• Chapter 2 describes the operational requirements you should take into
consideration and how to install the process diagnostics software and the
authorization.
• Chapter 3 describes how to get started with S7 PDIAG. Using a simple
example, it shows you how to monitor your process with address monitoring on
your CPU. The example then takes you through the first steps with ProAgent,
the configuration software for display devices.
• Chapter 4 shows you step by step how to configure address monitoring.
• Chapter 5 shows you step by step how to configure general monitoring
• Chapter 6 shows you step by step how to configure motion monitoring.
• Chapter 7 describes how to generate the monitoring blocks required for process
diagnostics and how to download them to your programmable logic controller.
• Chapter 8 describes how to print out the diagnostic data created with S7 PDIAG
and how you can export them, if necessary.
• Chapter 9 shows you how to create user-defined templates and modify times
offline and online, and how you work with auxiliary process values and
exclusion addresses when using advanced programming. In addition you learn
how to group units and to search for objects in S7 PDIAG so that they can be
edited. We also inform you on the reference data created by S7 PDIAG and on
the new graphics motion screen as an interface to the display device.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 v
Important Notes
Online Help
An online help is integrated in the software to complement this manual. This online
help is intended to provide detailed support when using the software, and can be
activated from the help menu or by pressing the F1 key.
Additional Assistance
In addition to the manual detailed support in using the software is provided by the
online help integrated in the software.
The help system is integrated in the software through several interfaces:
• The Help menu contains several menu commands: Contents opens the table of
contents of the help, Introduction provides an overview over S7 PDIAG
programming, Using Help provides detailed instructions on using the online
help.
• The context-sensitive help provides information on the current context, for
example on an opened dialog box or on active window. It can be used by
clicking on the ”Help” command button or by pressing F1.
• The status line provides a further form of context-sensitive help. A brief
explanation of the respective menu command is displayed as soon as the
cursor is positioned on the menu command.
• A brief explanation of the icons in the toolbar is also displayed if the cursor is
positioned briefly on the icon.
If you would rather have the information of the online help in printed form, you can
also print out individual help topics, books or the entire help.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
vi A5E00063001-01
Important Notes
Nuremberg
Johnson City
Singapore
SIMATIC Hotline
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 vii
Important Notes
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
viii A5E00063001-01
Contents
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 ix
Contents
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
x A5E00063001-01
Contents
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 xi
Contents
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
xii A5E00063001-01
Introduction to S7 PDIAG 1
In This Chapter
This chapter introduces you to process diagnostics and will familiarize you with the
terms and performance range of S7 PDIAG.
In addition, this chapter describes the standard procedure for working with process
diagnostics and how S7 PDIAG also supports you in troubleshooting on the display
device.
Chapter Overview
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 1-1
Introduction to S7 PDIAG
Introduction
System and process operators continually need to minimize production costs in
order to remain internationally competitive in industry.
Down times in production systems can lead to loss of production and therefore
represent an important cost factor. The aim of diagnostics is to significantly reduce
this cost factor.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
1-2 A5E00063001-01
Introduction to S7 PDIAG
System-Wide Interaction
Figure 1-1 below shows how all the components of process diagnostics interact
throughout the system.
LAD/STL/FBD Editor
S7 Graph S7 HiGraph * with PDIAG
* in preparation
Pro Agent OP
Pro Agent WinCC
SIEMENS
SIMATIC PG 740
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 1-3
Introduction to S7 PDIAG
System-Wide Interface
Common Database
* in preparation
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
1-4 A5E00063001-01
Introduction to S7 PDIAG
Introduction
If an error occurs in the process, process diagnostics performs the following
functions, as shown in Figure 1-3:
Process
manual
Synchronize
Resolve Error
Process
Display Device
1. Error detection:
When a process error occurs, it is detected by the monitoring logic configured
with S7 PDIAG. At the same time, the states of the addresses which caused
the error are saved. This is known as initial value acquisition.
2. Message display:
Both incoming and outgoing process errors are detected by S7 PDIAG and
represented as an incoming or outgoing message on the display device.
3. Criteria analysis:
Using criteria analysis together with the display devices, you can determine
which address caused the error (and therefore the reason for the process error
in S7 PDIAG) on the basis of the initial values (with boolean program logic).
4. Resolve error:
Errors can be resolved by manually intervening in the process and/or by
operating the process using the programmable logic controller in manual
operation (on the display device).
5. Synchronize process:
Depending on the type of error to be resolved, the program will either continue
processing or the plant is brought to a defined starting situation and the
program then continues.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 1-5
Introduction to S7 PDIAG
Introduction
The information supplied by S7 PDIAG also supports you when troubleshooting on
display devices. Using criteria analysis, you can analyze the conditions which led
to a process error on the display device. To do this, you use the initial values
stored in the programmable logic controller.
The display devices are provided with the corresponding configuration data for this
by the ProTool and ProAgent configuration software.
Message Display
Figure 1-4 From the Message Display via Process Diagnostics to Easy Troubleshooting
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
1-6 A5E00063001-01
Introduction to S7 PDIAG
Introduction
S7 PDIAG expands the functional scope of the STEP 7 Standard software by
offering a process diagnostics option for the programming languages Ladder Logic
(LAD), Statement List (STL), and Function Block Diagram (FBD). Process
diagnostics detects errors in the user process (manufacturing, distribution,
processing, etc.) and provides information on:
• The type of error
• The location of the error
• The cause of the error in your process.
It also helps you when troubleshooting.
Error Definitions
An error definition is an address, motion, or general monitoring definition. In error
definitions, you define the exact error which is to be monitored. Such error
definitions can be appended to addresses in the LAD/STL/FBD Editor. You can
monitor all boolean addresses with S7 PDIAG.
Monitoring Blocks
S7 PDIAG generates monitoring blocks from the configured error definitions which
you can then download to your CPU in order to monitor your process.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 1-7
Introduction to S7 PDIAG
Introduction
An error detected by S7 PDIAG is registered on all connected display devices
while your user program is running by means of a message text which you
configure. You can enter message texts while you are configuring the error
definitions.
You can assign each message a priority (from 1 to 16). In this way, you can react
to specific errors with different priorities in your user program.
Criteria Analysis
Criteria analysis is carried out on the display device in order to analyze the error
conditions. You can only carry out criteria analysis for boolean addresses (see
Readme.wri) and analysis starts with the initial diagnostic address (IDA). Criterial
analysis evaluates the initial values of all networks which determined the value of
the initial diagnostic address. You can then display the states of the addresses
(initial values) which caused the error (for example, limit switch at input I1.1) up to
the result of logic operation in STL, LAD, and FBD directly on the display device.
Positive criteria analysis assumes the signal state “1” of the initial diagnostic
address to be correct, while negative criteria analysis assumes that signal state “0”
is correct.
The criteria analysis is available for all Boolean input parameters of a function
block and can thus also be carried out across the block limits.
In order to carry out criteria analysis on the display device, you must activate initial
value acquisition in S7 PDIAG. Criteria analysis is still possible beyond block limits
without additional programming being necessary.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
1-8 A5E00063001-01
Introduction to S7 PDIAG
Exclusion Addresses
You can create a list of “exclusion addresses” for criteria analysis which are
defined as “never causing an error.” Criteria analysis then hides these addresses
and the network sections which contain them if they have been registered as
having the value “0” (this is only possible in conjunction with ProAgent, version 5.0
or higher). In this way, you can differentiate between manual and automatic
operation, for example.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 1-9
Introduction to S7 PDIAG
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
1-10 A5E00063001-01
Introduction to S7 PDIAG
Introduction
S7 PDIAG works with units and motions; these are introduced in this section.
We will then show you how units and motions are represented in the unit overview
and how S7 PDIAG works with block types (function blocks) and their
corresponding instances (data blocks).
Grouping Units
In addition to the default standard group you can group any number of units in up
to 15 different groups. However, you should not group the units until the end of the
structuring phase has been completed when you have already created your
program hierarchy completely.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 1-11
Introduction to S7 PDIAG
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
1-12 A5E00063001-01
Introduction to S7 PDIAG
Motions are represented with other objects in a tree structure in the unit overview.
When you create your error definitions, the new motions are depicted in the unit
overview, as shown in Figure 1-5 below.
Figure 1-5 Representation of Units and Motions in the Unit Overview of S7 PDIAG
The motions represented in the unit overview are output on the display devices
(using ProAgent) in the motion screens; for example, with the current final
positions, and can be moved from there using manual operation, for example.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 1-13
Introduction to S7 PDIAG
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
1-14 A5E00063001-01
Introduction to S7 PDIAG
Printing
You can also print out the data you create with S7 PDIAG. The standard STEP 7
layout applies. Each page has headers and footers, and the actual content of the
page consists of a leader as well as the corresponding units and error definitions.
• The block numbers for the blocks generated by S7 PDIAG are printed in the
leader.
• The selected units, motions, and error definitions are then printed.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 1-15
Introduction to S7 PDIAG
Advantages of S7 PDIAG
Of course, you can still detect errors in your process even without S7 PDIAG. With
S7 PDIAG, however, this is much quicker and more effective, because you can
design your own, plant-specific process diagnostics with S7 PDIAG and configure
special types of monitoring definition for specific sections of the process. This
results in the following advantages:
• Errors in your process can be detected early on using S7 PDIAG; this
considerably reduces down times and production losses in your plant.
• Simple and fast configuring, as well as minimum programming for motion
monitoring is possible.
• Troubleshooting on the display device is made easier by specific information
(for example, from a criteria analysis) and is possible without additional
configuration being necessary.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
1-16 A5E00063001-01
Introduction to S7 PDIAG
Introduction
This section gives you an overview of how to start working with S7 PDIAG. You will
find a detailed, step-by-step description of the procedures for creating the
individual monitoring definitions in the following chapters. Creating address
monitoring is described in Chapter 4, creating general monitoring in Chapter 5 and
creating motion monitoring in Chapter 6:
Requirement:
Use UDTs and Ladder
networks for
programming motions
6. Modify monitoring times (if necessary) using the “Modify Times Online / Offline” function
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 1-17
Introduction to S7 PDIAG
Offline Functions
You can program and configure the error definition offline on a programming device
or PC.
The monitoring blocks generated are also added offline to your user program as
usual.
Using the “Modify Times Offline” function, you can modify the monitoring times offline
in existing monitoring definitions without having to generate the monitoring blocks
again each time.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
1-18 A5E00063001-01
Introduction to S7 PDIAG
Online Functions
If the process errors you have configured occur in online operation, these are
detected and registered.
Using the “Modify Times Online” function, you can modify the monitoring times online
in existing monitoring definitions without having to generate the monitoring blocks
again each time.
On the display device (for example, operator panel), you can carry out a criteria
analysis of the process error which has just occurred. This means that the states
of the addresses which led to an error are displayed here:
Example: Address: States:
A I0.0 1 // First initial value
A I1.1 0 // Second initial value
A I1.2 0 // Third initial value
= Q1.0 1 // Monitors Q1.0 for level “0”
The error was triggered because the address being monitored has level “0.”
Criteria analysis will cite I1.1 as the cause of the error.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 1-19
Introduction to S7 PDIAG
Introduction
The following table will help you to select the most suitable monitoring type for your
requirements.
You can find additional information on creating monitoring definitions and a detailed
description of the procedure in the chapters given below.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
1-20 A5E00063001-01
Introduction to S7 PDIAG
Introduction
If an error definition is active, meaning that the defined error case has occurred, a
value can be acquired additionally from your process and sent with the message to
the corresponding display device (HMI).
This auxiliary process value is displayed in the message text at the display device
at a point specified by you. The auxiliary process value can be entered as well
when creating or editing error definitions.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 1-21
Introduction to S7 PDIAG
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
1-22 A5E00063001-01
Installing the S7 PDIAG Optional Package 2
In This Chapter
Chapter Overview
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 2-1
Installing the S7 PDIAG Optional Package
Hardware Requirements
You will require a personal computer (PC) or programming device (PG) with the
following system configuration:
• For Windows 95/98:
An 80486 processor or higher, with at least 16 Mbytes RAM
(preferably 32 Mbytes)
For Windows NT/2000:
A Pentium processor or higher, with at least 32 Mbytes RAM
(preferably 64 Mbytes), and
• A monitor, keyboard, and mouse, all of which must be supported by Windows
95/98/NT/2000.
• Your S7 CPU must contain SFC17 and SFC18, otherwise the Alarm_S cannot
be processed by S7 PDIAG and an error message will appear after you
download the blocks.
Software Requirements
S7 PDIAG runs on a programming device or PC with the following:
• The Windows 95/98/NT or Windows 2000 operating system
• The STEP 7 Standard software, version 4.02 or higher.
Memory Capacity
The S7 PDIAG optional package requires:
• Approximately 1 MByte free memory on your hard disk for the setup
• An additional 8 to 12 MBytes free memory, depending on the extent of the
installation.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
2-2 A5E00063001-01
Installing the S7 PDIAG Optional Package
Error Detection
For error detection, you require the following:
Basic memory requirement: approximately 1368 bytes
Monitoring without time: approximately 14 to 20 bytes
Monitoring with time: approximately 106 to 114 bytes
Monitoring with auxiliary process value: approximately 24 bytes
The above values are standard values which depend on the complexity of the
networks being monitored and the corresponding monitoring logic used.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 2-3
Installing the S7 PDIAG Optional Package
Authorization Diskette
In order to use the S7 PDIAG software package, you require the read-only
authorization diskette or the update authorization diskette included with the
software package. This contains the authorization and the AUTHORSW program
which enables you to display, install, and remove the authorization.
The number of authorizations you can install is determined by an authorization
counter on the authorization diskette. Every time you install an authorization, the
counter is decremented by one. When the counter value reaches zero, you cannot
install any more authorizations using this diskette.
Caution
! Note the information in the README.TXT file on the authorization diskette. If you
do not adhere to these guidelines, the authorization may be irretrievably lost.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
2-4 A5E00063001-01
Installing the S7 PDIAG Optional Package
Introduction
S7 PDIAG contains a setup program which executes the installation automatically.
Screen prompts guide you step-by-step through the whole installation procedure.
Preparations
Before you can start installing the software, you must start Windows
95/98/NT/2000 and install the STEP 7 Standard software.
Using Authorization
During installation, the program checks to see whether you have an authorization
installed on the hard disk. If you wish, you can run the authorization program
immediately or continue installing the software and execute the authorization at a
later date.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 2-5
Installing the S7 PDIAG Optional Package
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
2-6 A5E00063001-01
Getting Started with S7 PDIAG and
ProAgent/PC 3
In This Chapter
This chapter guides you step-by-step through the entire configuration with
S7 PDIAG using address monitoring as an example.
This chapter also shows you the steps involved in creating an entire, functional
process diagnostics program with a controller and a display device using ProTool
and ProAgent.
Chapter Overview
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 3-1
Getting Started with S7 PDIAG and ProAgent/PC
Introduction
This section aims to show you how to work with S7 PDIAG using address
monitoring as an example.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
3-2 A5E00063001-01
Getting Started with S7 PDIAG and ProAgent/PC
Executability
In order for the example to run on the programmable logic controller, input byte 0
and output byte 1 must be interconnected on digital modules. If you only have one
CPU but no digital modules, insert OB122 (I/O access error) and monitor your
parameters using the menu command Monitor/Modify Variables.
Programming FB10
Open FB10 in the SIMATIC Manger by double-clicking it and fill in the variable
declaration table and the code section in the LAD/STL/FBD Editor as follows:
1. Enter the following in the first network:
As the network name: Interconnection Q1.0 in FB 10
As the program: U I 0.0
U I 0.1
U I 0.2
U I 0.3
= Q 1.0
2. Save the block using the menu command File > Save.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 3-3
Getting Started with S7 PDIAG and ProAgent/PC
Introduction
Now that you have programmed the blocks for the sample program, you can
create an address monitoring definition for these blocks.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
3-4 A5E00063001-01
Getting Started with S7 PDIAG and ProAgent/PC
4. To assign the corresponding message text to this error message, enter the
following in the “Message” group field: “Q1.0 in FB11 has level 1.”
5. Exit the tabbed sheet with “OK.” You have now configured an address
monitoring definition for Q1.0 at level 1. This is now displayed in the “Process
Monitoring” dialog box under “Existing Monitoring Definitions.”
6. Exit the “Process Monitoring” dialog box with “Close.”
7. Save the block using the menu command File >Save, so that the new error
definition is saved in the block and exit the LAD/STL/FBD Editor.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 3-5
Getting Started with S7 PDIAG and ProAgent/PC
3.4 Adding a Call to OB1 and Creating an Instance Data Block for
FB10
Introduction
Now that you have programmed your blocks and configured address monitoring,
you can add a call for these blocks in OB1 and create the instance data block for
FB10 at the same time.
Procedure
Insert the following call for FB10 at the end of OB1 in the “ExPDIAG” project:
CALL FB10, DB10
Click “Yes” in the next dialog box to create the new instance data block (here:
DB10) (see Figure 3-3).
LAD/STL/FBD (30:150)
Result: DB10 is created with the data relevant to S7 PDIAG and also receives the
S7 PDIAG attribute.
Save the block using the menu command File > Save and close the LAD/STL/FBD
Editor.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
3-6 A5E00063001-01
Getting Started with S7 PDIAG and ProAgent/PC
Introduction
The following steps show you how to generate monitoring blocks from error
definitions.
Procedure
To generate the monitoring blocks, proceed as follows:
1. Select the ”Blocks” container in the SIMATIC Manager and open S7 PDIAG by
using the menu command Options > Process Monitoring.
Result: The units relevant to PDIAG, in this case FB 10 and DB 10, are
displayed in the unit overview as shown in Figure 3-4.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 3-7
Getting Started with S7 PDIAG and ProAgent/PC
4. Exit the dialog box by clicking on “OK.” A progress bar is displayed and the
monitoring blocks are generated. If an error occurs during compilation, a
message will appear on the screen.
Result: The generated monitoring blocks are displayed in the SIMATIC
Manager together with the system function blocks (SFCs) required for them.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
3-8 A5E00063001-01
Getting Started with S7 PDIAG and ProAgent/PC
Introduction
In order for the monitoring blocks you generated to become active, you must
download them to your programmable logic controller and add a call for these
blocks in OB1, or at the required point in your user program.
Requirements
You have generated the monitoring blocks for your entire user program.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 3-9
Getting Started with S7 PDIAG and ProAgent/PC
Introduction
Now that you have been through the whole configuration process with S7 PDIAG
using the example, you can simulate a process error and display the configured
messages via the CPU Messages application.
Requirements
In order to view the messages without a display device, you must start the CPU
Messages application in the standard package. Proceed as follows:
1. Switch to online mode in the SIMATIC Manager.
Result: The online project window appears.
2. Select the sample program “ExPDiag.”
3. Start the CPU Messages application using the menu command PLC > CPU
Messages....
4. Activate the check box under “A” in the “Customize” dialog box which appears
so that you can display Alarm_S messages, and close the dialog box.
Now that you have made all the settings for displaying error messages in the CPU
Messages application, you can start triggering process errors.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
3-10 A5E00063001-01
Getting Started with S7 PDIAG and ProAgent/PC
Introduction
This section shows you how to create a configuration for diagnosing processes for
the previous example using ProTool and how to download this configuration to the
operator panel.
Requirement
In order to configure process diagnostics in ProTool, you must have successfully
generated the monitoring blocks for your user program, as described at the start of
this chapter.
Display Device
The following description shows the OP25 as an example of a display device in all
the figures. The procedure is identical for all display devices.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 3-11
Getting Started with S7 PDIAG and ProAgent/PC
Introduction
Before you can configure process diagnostics for the operating unit, you must first
integrate the associated screens into your sample project.
Since only diagnostic screens are required in the example, you can apply the
standard configuration directly to the example, together with the diagnostic
screens. Otherwise you will have to describe, copy and insert the diagnostic
screens, as described in the manual.
Procedure
To integrate diagnostic screens, proceed as follows:
1. If you have not already done so, start SIMATIC Manager and select the menu
command File > Open.
2. In the Open dialog box, choose the Projects option and select the ”BspPDIAG”
project from the list.
3. Open the ”ProAgent” project in the same way.
Should this project not appear in the list box, click Browse and open the
”ProAgent” project in the ”Standard\ProAgent” subdirectory of the ProTool
directory.
The ”ProAgent” project contains standard projects for the various operating
units.
4. Use the mouse to drag and drop the ”ProAgentPCmedium” configuration into
the ”BspPDIAG” project or use the File > Save As menu command to save it to
the ”BspPDIAG” project.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
3-12 A5E00063001-01
Getting Started with S7 PDIAG and ProAgent/PC
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 3-13
Getting Started with S7 PDIAG and ProAgent/PC
Introduction
The next step is to start ProTool and perform the necessary settings. Particularly
important here are the network parameter, CPU and unit selections.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
3-14 A5E00063001-01
Getting Started with S7 PDIAG and ProAgent/PC
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 3-15
Getting Started with S7 PDIAG and ProAgent/PC
Introduction
Once the configuration has been completed, you still have to save, compile and
start the project. You can initiate all these steps at once by starting ProTool RT.
Note
If you do not want to use the same PC that you used for the configuration as the oper-
ating unit in this example, once the project is compiled you must first download it to
the operating unit and then start it there.
Procedure
Proceed as follows:
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
3-16 A5E00063001-01
Getting Started with S7 PDIAG and ProAgent/PC
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 3-17
Getting Started with S7 PDIAG and ProAgent/PC
Introduction
Now that you have created the configuration for the operating unit in the preceding
sections and loaded it onto the operating unit, you can perform a process
diagnosis.
Requirements
Before you can perform a process diagnosis on the operating unit, you must
successfully perform all the steps described in the previous sections:
• the PLC program must be loaded on the CPU and
• the configuration must be on the operating unit.
One of your options here is to change either to the overview screen or to the
message screen. Change to the message screen by clicking the corresponding
button.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
3-18 A5E00063001-01
Getting Started with S7 PDIAG and ProAgent/PC
Message screen
The message screen is blank at first because there have not been any errors so
far.
1. Now simulate an error in FB 10, as you did previously in section 3.7.
An alarm message will appear on the operating unit:
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 3-19
Getting Started with S7 PDIAG and ProAgent/PC
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
3-20 A5E00063001-01
Getting Started with S7 PDIAG and ProAgent/PC
Unit:DB 10 DB10
Unit A
ction Mode
DB10
0
If a subordinate unit is faulty,
the unit above it in the hierar-
chy is also faulty
Here you switch Here you switch Here you switch back
to the message to the detail to the diagnostic star-
screen screen tup screen
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 3-21
Getting Started with S7 PDIAG and ProAgent/PC
Detail screen
The detail screen shows you precisely which signals triggered the alarm message.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
3-22 A5E00063001-01
Getting Started with S7 PDIAG and ProAgent/PC
The display will appear as a symbol list in the central area of the detail screen.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 3-23
Getting Started with S7 PDIAG and ProAgent/PC
LAD Display
Click again on the corresponding button. This will move you to the next display in
the cycle:
The display will appear as a ladder diagram in the central area of the detail screen.
Net result
You have now simulated an error, traced its alarm message on the PC and
determined the cause of the error.
Additional information
In this chapter you have seen how a process diagnosis is configured in ProTool
and how it is run on the operating unit. You now know the important steps and
sequences.
Of course, this simple example cannot possibly demonstrate all the options
ProAgent has to offer. In practice, you will normally have your own screens which
you want to combine with the diagnostic screens, you may even wish to customize
the diagnostic screens to suit your own particular requirements.
You will find detailed information on this and other topics in the online Help and in
the ProAgent User’s Guide.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
3-24 A5E00063001-01
Configuring Address Monitoring with
S7 PDIAG 4
In This Chapter
This chapter gives you an overview of address monitoring used in process
diagnostics and shows you step-by-step how to create address monitoring with
S7 PDIAG.
Chapter Overview
Chapter 7 describes how to generate monitoring blocks for S7 PDIAG from your
error definitions and how to download these blocks to the programmable logic
controller.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 4-1
Configuring Address Monitoring with S7 PDIAG
Introduction
With address monitoring, you can create error definitions which are linked to an
address. This address is called the initial diagnostic address (IDA).
Address Monitoring
There are two different types of address monitoring:
1. Level monitoring:
for level “0” or level “1”
2. Edge monitoring:
for edge “0 >1” or “1 >0”
You can define the following parameters:
• The name of the address to be monitored
• The delay time to be set
• Whether to use initial value acquisition
• Whether to assign a message text to be displayed on the connected display
devices whenever an error occurs
• The priority of the message and whether or not the message must be
acknowledged.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
4-2 A5E00063001-01
Configuring Address Monitoring with S7 PDIAG
As Level Monitoring
With level monitoring, a specific address is monitored for a defined level (0 or 1).
The error state occurs when the address has the specified level for longer than the
defined delay time (tdelay). If the level changes during this delay time, the timer is
restarted.
tVerz tVerz
T0 T1 T2 T3 T4 T5
Monitoring starts with the first cycle (To = startup). The delay time (tdelay) is started
both at T0 and T3. As soon as the defined level occurs for longer than the delay
time, an error is detected and registered as “incoming” (at T1 and T4). At T2 and
T5, the error is registered as “outgoing.”
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 4-3
Configuring Address Monitoring with S7 PDIAG
As Edge Monitoring
With edge monitoring, a specific address is monitored for a defined edge (rising or
falling). The error state occurs when there is an incorrect level (for example, level
“1” after a rising edge) at the address after the edge change for longer than the
defined delay time (tdelay). If an edge change occurs during this delay time, the
timer is restarted. You can define the duration of the delay time yourself.
(tVerz) tVerz
T0 T1 T2 T3 T4
Edge monitoring generally behaves like level monitoring, except that with edge
monitoring, the state of the address being monitored is saved at the point To
( = startup); that is, the switch-on point is not interpreted as an edge.
The delay time (tdelay) does not start until the next active edge (the selected edge).
This means that errors cannot be detected and registered as “incoming” until T3
and not at T1, as would be the case with level monitoring. At T4, the error is
registered as “outgoing.”
Error State
With address monitoring, the error state occurs when the conditions you defined
have occurred.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
4-4 A5E00063001-01
Configuring Address Monitoring with S7 PDIAG
Introduction
The diagram below shows you the configuration steps for creating address
monitoring with S7 PDIAG.
You can find a detailed description of the procedure in the sections listed below:
Note : Blocks which contain preceding logic operations must also be made
capable of being diagnosed (refer to Appendix A).
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 4-5
Configuring Address Monitoring with S7 PDIAG
Introduction
Before you can create an error definition for address monitoring, you must first
select the initial diagnostic address. This is the address to which the error definition
is appended. There are three ways of selecting an initial diagnostic address:
• In the incremental LAD/STL/FBD Editor
• In S7 PDIAG and
• In the symbol table (as from STEP 7 V5.0 SP3)
The various procedures are described below.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
4-6 A5E00063001-01
Configuring Address Monitoring with S7 PDIAG
Figure 4-4 Selecting the monitoring type in the “Process Diagnostic Messages” dialog box
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 4-7
Configuring Address Monitoring with S7 PDIAG
3. Select “S7 PDIAG: Address Monitoring” and click “New.” Fill in the “Definition”
tab in the next dialog box “S7 PDIAG: Address Monitoring” according to your
requirements (see Figure 4-5).
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
4-8 A5E00063001-01
Configuring Address Monitoring with S7 PDIAG
“General” Tab
If required, you can enter the author of the error definition and a comment in the
“General” tab, as well as modifying the name of the error definition.
The project path and the storage location of the monitoring definition are already
entered. Exit the dialog box with “OK.”
Result: You have now configured an address monitoring definition.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 4-9
Configuring Address Monitoring with S7 PDIAG
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
4-10 A5E00063001-01
Configuring General Monitoring with
S7 PDIAG 5
In This Chapter
This chapter gives you an overview of general monitoring used in process
diagnostics and shows you step-by-step how to create general monitoring with
S7 PDIAG.
With general monitoring, you can program the monitoring logic yourself using the
language elements available in S7 PDIAG. These language elements are
described in Appendix B.
Chapter Overview
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 5-1
Configuring General Monitoring with S7 PDIAG
Introduction
General monitoring enables you to monitor several events at a time and define
your own monitoring logic for these events.
General Monitoring
General monitoring provides you with a means of creating monitoring logic tailored
to suit your needs using the language elements available in S7 PDIAG, and also to
carry out complex error monitoring.
You can assign a message to your error definitions which will then be displayed on
the registered display devices whenever an error occurs; that is, when the
monitoring logic is fulfilled.
Appendix B of this manual and the online help both contain the language
description for S7 PDIAG, which you will need in order to create your own
monitoring logic.
Error State
With general monitoring, the error state also occurs when the conditions you
defined have occured.
The following generally applies when detecting an error with a defined monitoring
logic:
• If the result of logic operation is “0,” no error has been detected.
• If the result of logic operation is “1,” an error has just been detected.
• When the result of logic operation changes from “0” to “1,” an incoming error
message is always generated.
• When the result of logic operation changes from “1” to “0,” an outgoing error
message is always generated.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
5-2 A5E00063001-01
Configuring General Monitoring with S7 PDIAG
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 5-3
Configuring General Monitoring with S7 PDIAG
Introduction
The diagram below shows you the configuration steps for creating general
monitoring with S7 PDIAG.
You can find a detailed description of the procedure in the sections listed below:
Note: You must also configure diagnostic capability for blocks with preceding
logic (see Appendix A).
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
5-4 A5E00063001-01
Configuring General Monitoring with S7 PDIAG
Introduction
Before you can create an error definition, you must first select the initial diagnostic
address. This is the address to which the error definition is appended. There are
three ways of selecting an initial diagnostic address:
• In the incremental LAD/STL/FBD Editor
• In S7 PDIAG
• In the symbol table (as from STEP 7 V5.0 SP3).
The various procedures are described below.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 5-5
Configuring General Monitoring with S7 PDIAG
Figure 5-2 Selecting the Monitoring Type in the “Process Diagnostic Messages” Dialog
Box
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
5-6 A5E00063001-01
Configuring General Monitoring with S7 PDIAG
3. Select “S7 PDIAG: General Monitoring” and click “New.” Fill in the “Definition”
tab in the next dialog box “S7 PDIAG: General Monitoring” according to your
requirements (see Figure 5-3).
4. Enter your own monitoring logic in the “Monitoring Definition” field. To do this,
you can use the language elements available in S7 PDIAG (see Appendix B).
Note: The maximum number of addresses for the monitoring logic amounts to
64 addresses.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 5-7
Configuring General Monitoring with S7 PDIAG
“General” Tab
If required, you can enter the author of the error definition and a comment in the
“General” tab, as well as modifying the name of the error definition.
The project path and the storage location of the monitoring definitions are already
entered. Exit the dialog box with “OK.”
Result: You have now configured a general monitoring definition.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
5-8 A5E00063001-01
Configuring General Monitoring with S7 PDIAG
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 5-9
Configuring General Monitoring with S7 PDIAG
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
5-10 A5E00063001-01
Configuring Motion Monitoring with
S7 PDIAG 6
In This Chapter
First, this chapter introduces you to the concept of programming motions with
S7 PDIAG.
Then, there is an overview of each type of motion monitoring which can be used in
process diagnostics.
Finally, we will show you step-by-step how to create a monitoring definition in
S7 PDIAG for each of the motion monitoring types listed below.
Chapter Overview
Chapter 7 describes how to generate monitoring blocks for S7 PDIAG from your
error definitions and how to download these blocks to the programmable logic
controller.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 6-1
Configuring Motion Monitoring with S7 PDIAG
Introduction
The concept of programming motions with S7 PDIAG consists of three
components:
1. The supplied Ladder networks for motion programming (see Appendix A) and
the corresponding data structure for the motion, the UDT_Motion (UDT2).
2. The special motion monitoring definitions with S7 PDIAG which are described in
detail in the following sections.
3. The display devices which are suited to the data structure of the UDT_Motion.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
6-2 A5E00063001-01
Configuring Motion Monitoring with S7 PDIAG
#m.Executability1 #m.Executability2
É ÉÉ
É Direction1 Motionx
ÉÉ
Direction2 #m.Manual_
É ÉÉ
#m.Manual_
Operation1 Operation2
#m.Final_Position[0] #m.Final_Position[1]
#”Motion_Name”. Number_of_Final_Position=2
#m.Moving_Status1 #m.Moving_Status2
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 6-3
Configuring Motion Monitoring with S7 PDIAG
Introduction
In processes, you often control procedures which have two stable final positions
and the triggering of one final position transfers the process to the other.
For example, a cylinder can be moved from the current final position to the target
final position after switching on the hydraulic pressure. In the same way, a reactor
can be heated up from a current temperature to a higher value once a heating
system is switched on. These procedures can be viewed as motions.
A motion is therefore part of a process which has the following characteristics:
• An object is in a current, stable final position
• A trigger is executed
• The object moves to the target final position as a result of this trigger.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
6-4 A5E00063001-01
Configuring Motion Monitoring with S7 PDIAG
Error State
With motion monitoring, the error state also occurs when the conditions you
defined have occured.
Example
The following Figure 6-2 gives you an overview of how and where the individual
monitoring types start in motion monitoring. The following requirements are
predefined:
• There is a motion with two final positions, the current final position (CFP) and
the target final position (TFP).
• Before each final position, there is a position flag (PF) and a safety guard (SG)
as an interlock enable.
After the control signal, the motion is to move from the current final position (CFP)
to the target final position (TFP). However, this motion may not start until the
safety guard is closed.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 6-5
Configuring Motion Monitoring with S7 PDIAG
Motion Monitoring
At the point in time T0, the control signal is set. Interlock monitoring starts at this
point. If the interlock condition is fulfilled within this time and the safety guard is
closed, motion control is triggered (T1).
The start of the motion is monitored by startup monitoring, which checks to see
whether the motion leaves the current final position (CFP) within the startup time
(T2). Monitoring starts once the interlock has been enabled (T1).
The actual motion process is monitored by the action time. This monitors whether
the target final position (T4) is reached within the action time after the interlock is
enabled (T1). The completion of the motion is detected when the target final
position (T4) has been reached.
Reaction monitoring checks whether the target final position remains stable. The
reaction time starts once the position flag (T3) is set or when the target final
position has been left while the position flag is still set.
Action Time
Interlock Time
Reaction Time
PF
Reaction Time
TFP
Start t
T0 T1 T2 T3 T4
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
6-6 A5E00063001-01
Configuring Motion Monitoring with S7 PDIAG
Definition
Action monitoring is one of the four types of motion monitoring. Using action
monitoring, you can monitor whether the target final position is reached within a
specified time (action time) following a machine operation (trigger).
• The point at which the process is monitored is the target final position. This
means that the execution of a motion in the process is being monitored.
• The monitoring logic is already predefined. All you need to do is add the action
time and the trigger, if necessary.
Monitoring Logic
The monitoring logic for action monitoring is defined as follows:
ONDT( <Trigger>,<Action Time>)
AND
NOT <Target Final Position>
If you have used the UDT_Motion in your program, the initial diagnostic address for
action monitoring is the “Final_Position[n]”. The trigger here is the enabled
machine operation.
In this case, the monitoring logic is preset as follows:
ONDT(Motion_Name.Control1/2,<Action Time>)
AND
NOT Motion_Name.Final_Position[n]
“Motion_Name” is the name of the UDT_Motion in the block interface and
“Control1/2” is the name of the trigger.
All you have to do here is enter the required monitoring time.
Error Messages
The error state occurs and an error is registered as incoming when the trigger for
the specified action time has been activated and the target final position (initial
diagnostic address) has not become active.
The error is registered as outgoing when the final position is reached (after the
action time expires) or if there is no machine operation (trigger).
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 6-7
Configuring Motion Monitoring with S7 PDIAG
Introduction
Reaction monitoring is one of the four types of motion monitoring. Using reaction
monitoring, you can monitor whether a final position which has been reached
remains stable after a specified period of time (reaction time) has elapsed.
• The point at which the process is monitored is the target final position. In order
to monitor the target final position, you will require an additional position flag
which shows that reaction monitoring is active. As long as the target final
position is not active while the position flag is set, the reaction time will run. If
the target final position is not reached again within the reaction time, an error
message is sent.
• The monitoring logic is already predefined. All you have to do is add the
reaction time and the position flag, if necessary.
Monitoring Logic
The monitoring logic for reaction monitoring is defined as follows:
ONDT (<Position Flag> AND NOT <Target Final Position>,<Reaction Time>)
If you have used the UDT_Motion in your program, the initial diagnostic address for
reaction monitoring is the “Final_Position[n]”.
In this case, the monitoring logic is preset as follows:
ONDT(Motion_Name.Position_Flag[n] AND NOT
Motion_Name.Final_Position[n],<Reaction Time>)
“Motion_Name” is the name of the UDT_Motion in the block interface.
All you have to do here is enter the required monitoring time.
Error Messages
The error state occurs and an error is registered as incoming when the position
flag is active and the target final position (initial diagnostic address) is not active
once the reaction time has expired.
The error is registered as outgoing when the target final position is reached, or if
the position flag is reset.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
6-8 A5E00063001-01
Configuring Motion Monitoring with S7 PDIAG
Introduction
Interlock monitoring is one of the four types of motion monitoring. Using interlock
monitoring, you can monitor whether the interlock condition (executability) is
fulfilled once the motion has been triggered and after a specified period of time
(interlock time) has elapsed.
• The point at which the process is monitored is the executability. This monitors
whether the interlock condition is fulfilled once the motion has been triggered
and after the interlock time has expired.
• The monitoring logic is already predefined. All you have to do is add the
interlock time and the trigger, if necessary.
Monitoring Logic
The monitoring logic for interlock monitoring is defined as follows:
ONDT(<Trigger>,<Interlock Time> )
AND
NOT <Executability>
If you have used the UDT_Motion in your program, the initial diagnostic address for
interlock monitoring is the “Executability1/2”.
In this case, the monitoring logic is preset as follows:
ONDT(Motion_Name.Trigger1/2,<Interlock Time> )
AND
NOT Motion_Name.Executability1/2
“Motion_Name” is the name of the UDT_Motion in the block interface.
All you have to do here is enter the required monitoring logic.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 6-9
Configuring Motion Monitoring with S7 PDIAG
Error Messages
The error state occurs and an error is registered as incoming when the trigger for
the specified interlock time has been activated and the interlock condition (initial
diagnostic address) is not yet fulfilled.
The error is registered as outgoing when the interlock condition is fulfilled or if the
trigger is removed.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
6-10 A5E00063001-01
Configuring Motion Monitoring with S7 PDIAG
Introduction
Startup monitoring is one of the four types of motion monitoring. Using startup
monitoring, you can monitor whether the current final position is left within a
specified period of time (startup time) following a machine operation (trigger).
• The point at which the process is monitored is the current final position. The
reaction of a motion to a trigger is therefore being monitored. This means that,
in contrast to action monitoring, errors may be detected much earlier. This is
particularly useful with slow processes.
• The monitoring logic is already predefined. All you have to do is add the startup
time and the trigger, if necessary.
Monitoring Logic
The monitoring logic for startup monitoring is defined as follows:
ONDT( <Trigger>,<Startup Time>)
AND
<Current Final Position>
If you have used the UDT_Motion in your program, the initial diagnostic address for
startup monitoring is the current final position.
In this case, the monitoring logic is preset as follows:
ONDT(Motion_Name.Control1/2,<Startup Time>)
AND
Motion_Name.Final_Position[n]
“Motion_Name” is the name of the UDT_Motion in the block interface.
All you have to do here is enter the required monitoring time.
Error Messages
The error state occurs and an error is registered as incoming when the trigger for
the specified startup time has been activated and the current final position (initial
diagnostic address) is still active.
An error is registered as outgoing when the final position being monitored is left
after the startup time or if motion control is not triggered.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 6-11
Configuring Motion Monitoring with S7 PDIAG
Introduction
The diagram below shows you the configuration steps for creating motion
monitoring with S7 PDIAG.
You can find a detailed description of the procedure in the sections listed below:
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
6-12 A5E00063001-01
Configuring Motion Monitoring with S7 PDIAG
Introduction
Before you can configure an error definition for motion monitoring, you must first
select the initial diagnostic address. This is the address to which the error definition
is appended. There are three ways of selecting an initial diagnostic address:
• In the incremental LAD/STL/FBD Editor
• In S7 PDIAG
• In the symbol table (as from STEP 7 V5.0 SP3).
The following sections describe the various procedures.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 6-13
Configuring Motion Monitoring with S7 PDIAG
Figure 6-4 Selecting the Monitoring Type in the “Process Monitoring” Dialog Box
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
6-14 A5E00063001-01
Configuring Motion Monitoring with S7 PDIAG
3. Select the required type of motion monitoring (for example, S7 PDIAG: Action
Monitoring) and click “New.” Fill in the “Definition” tab in the dialog box “S7
PDIAG: Action Monitoring” according to your requirements (see Figure 6-5).
4. The monitoring logic is preset according to the monitoring type selected. All you
need to do is add the required monitoring time and the trigger.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 6-15
Configuring Motion Monitoring with S7 PDIAG
“General” Tab
If required, you can enter the author of the error definition and a comment in the
“General” tab, as well as modifying the name of the error definition.
The project path and the storage location of the monitoring definitions are already
entered. Exit the dialog box with “OK.”
Result: You have now configured a motion monitoring definition.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
6-16 A5E00063001-01
Configuring Motion Monitoring with S7 PDIAG
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 6-17
Configuring Motion Monitoring with S7 PDIAG
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
6-18 A5E00063001-01
Generating and Downloading Monitoring
Blocks for S7 PDIAG 7
In This Chapter
This chapter tells you how to generate monitoring blocks from the configured error
definitions in S7 PDIAG and how to add them to your user program.
Chapter Overview
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 7-1
Generating and Downloading Monitoring Blocks for S7 PDIAG
Introduction
Once you have configured the error definitions for your user program, you can then
generate the S7 PDIAG monitoring blocks.
There are two steps involved in generating monitoring blocks:
• Creating instances:
First, the error definitions and messages for the instance data blocks are
generated, which means that you can still make changes to the individual
instance data blocks at this point.
• Compiling:
The program code for error detection and initial value / status acquisition for the
entire user program is then generated and the monitoring blocks created.
You can then add the call for these blocks in OB1 or wherever you wish, and
download the generated monitoring blocks to the programmable logic controller.
Procedure
The diagram below shows you the sequence of configuration steps:
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
7-2 A5E00063001-01
Generating and Downloading Monitoring Blocks for S7 PDIAG
Introduction
If an identical component of a machine or plant is used several times, you can
write a single function block to control this component. You can call this function
block many times in your user program, each time using different data; in other
words, with different instance data blocks.
However, you must be able to distinguish between these identical components on
the display devices, so that an error which occurs in a specific plant component
can be precisely located, for example.
This concept, also called the type instance concept, is fully supported by
S7 PDIAG. Individual monitoring definitions are generated for each instance data
block of a function block; these can be found in the instance data block. You can
find additional information on instances of function blocks in the STEP 7
Programming manual.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 7-3
Generating and Downloading Monitoring Blocks for S7 PDIAG
Procedure
To create the instance data blocks, proceed as follows:
1. Open the block (for example, OB1) which is to call your function block with the
error definitions in the SIMATIC Manager by double-clicking it. The
LAD/STL/FBD Editor opens.
2. Add the call for the function block with the error definitions and the instance
data block to be created with the correct name at the required location.
Example: CALL FB30, DB30
3. Click “Yes” in the next dialog box to create the new instance data block (here:
DB30) (see Figure 7-2).
LAD/STL/FBD (30:150)
4. Save the block using the menu command File > Save and close the
LAD/STL/FBD Editor.
5. Select the block container in the SIMATIC Manager and open S7 PDIAG using
the menu command Options > Configure Process Monitoring.
Result: The units relevant to S7 PDIAG are displayed in the unit overview.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
7-4 A5E00063001-01
Generating and Downloading Monitoring Blocks for S7 PDIAG
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 7-5
Generating and Downloading Monitoring Blocks for S7 PDIAG
Introduction
Once you have made instance-specific changes to the error definitions, you can
generate the monitoring blocks. If you have grouped units, monitoring blocks are
created for every group created by you during generation.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
7-6 A5E00063001-01
Generating and Downloading Monitoring Blocks for S7 PDIAG
Procedure
To generate the monitoring blocks, proceed as follows:
1. Select the menu command Process Diagnostics > Compile in S7 PDIAG. If
you are compiling for the first time, you will be requested to check the
compilation settings. Confirm this message with “OK.”
2. Open the “Customize” dialog box using the menu command Options >
Customize and, in the “Default Settings” tab, enter the settings for the blocks
to be compiled for error detection and initial value / status acquisition, as shown
in Figure 7-3.
3. In the ”Name” list field select the group whose monitoring blocks you want to
check or change.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 7-7
Generating and Downloading Monitoring Blocks for S7 PDIAG
Note: If you are entering different numbers for the monitoring blocks to be
created, make sure that they are not already assigned to existing blocks in your
user program.
4. You must also enter in the “Default Settings” tab whether you want the user
block you program (see Appendix A) to be called if an error occurs and whether
you want to activate group priority storage. If so, you must enter another free
memory word for data storage.
5. You can define other options for generating the monitoring blocks in the
“Compile” tab and set the options for presetting the message text in the
“General” tab.
6. When you have finished making all your settings, click “OK” to start the
compilation procedure. A progress bar appears and the monitoring blocks are
generated. If an error occurs during compilation, a message will appear on the
screen.
Result: The monitoring blocks are generated with the numbers you assigned
them and displayed in the SIMATIC Manager together with the system function
blocks (SFC17, SFC18, and SFC64), which are also required; these are
automatically included in your program.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
7-8 A5E00063001-01
Generating and Downloading Monitoring Blocks for S7 PDIAG
Introduction
In order for the monitoring blocks you generated to become active, you must
download them to your programmable logic controller and add a call for these
blocks in OB1, or at the required point in your user program. This is usually at the
end of the block.
Requirements
You have generated the monitoring blocks for your entire user program.
Adding a Call
To add the call for the generated error-detection block in the required block, for
example, OB1, proceed as follows:
1. Open OB1 in the SIMATIC Manager by double-clicking it.
2. Insert the following lines:
CALL FB xy, DB xy
PDIAGCycle: = OB1_SCAN_1
Note: You must enter the corresponding number of your error-detection block
instead of “xy.” Initial value acquisition is automatically started from this block
whenever an error occurs.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 7-9
Generating and Downloading Monitoring Blocks for S7 PDIAG
Introduction
Once you have finished configuring your process diagnostics with S7 PDIAG, you
can now configure the diagnostic screens for your display device.
Refer to the documentation supplied with your display device for information on
how to configure the screens.
Example
You will find an example of configuring the diagnostic screens with ProTool and
ProAgent in Chapter 3 of this manual.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
7-10 A5E00063001-01
Printing and Exporting Diagnostic Data
with S7 PDIAG 8
In This Chapter
In this chapter you will learn how to print out and export the diagnostic data
generated by S7 PDIAG.
Chapter Overview
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 8-1
Printing and Exporting Diagnostic Data with S7 PDIAG
Introduction
Once you have configured the error definitions for your user program and
generated the corresponding monitoring blocks, you can print out the diagnostic
data created with S7 PDIAG.
The standard STEP 7 layout applies. Each page has headers and footers, and the
actual content of the page consists of a leader as well as the corresponding units
and error definitions.
• The block numbers for the blocks generated by S7 PDIAG are printed in the
leader.
• The selected units, motions, and error definitions are then printed.
Procedure
To print the data generated with S7 PDIAG, proceed as follows:
1. If you want to print all the data generated, select the uppermost object in the
unit overview and select the menu command Process Diagnostics > Print in
S7 PDIAG.
2. If you only want to print out part of the data, select the corresponding unit or
monitoring definition in the unit overview of S7 PDIAG from which you want to
start printing.
3. Fill in the dialog box which appears according to your requirements and confirm
the print job with “OK.”
Result: S7 PDIAG prints the data you selected.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
8-2 A5E00063001-01
Printing and Exporting Diagnostic Data with S7 PDIAG
Introduction
Once you have completed the process diagnostics with S7 PDIAG, you can export
the diagnostic data you have generated in CSV format and use them for your own
purposes. CSV format is a format which can be read with Microsoft Excel, for
example, and it uses a semicolon as a separator between each of the listed
elements.
You can use the exported data and a list of all the messages which occurred during
the process to measure, for example, the down times and the failure frequency of
your plant.
In addition, these data will help you to establish an assignment between the
specified message number and the actual message.
Procedure
To export the files generated with S7 PDIAG, proceed as follows:
1. Select the menu command Process Diagnostics > Export. The “Export”
dialog box then opens.
2. Here you enter the name of the output file or select one of the files listed. The
default file type is “*.csv”.
3. Start the export procedure with “Save.”
Result: All the printable attributes of the entire program are exported.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 8-3
Printing and Exporting Diagnostic Data with S7 PDIAG
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
8-4 A5E00063001-01
Advanced Programming with S7 PDIAG 9
In This Chapter
In this chapter you will learn which additional functions are available in S7 PDIAG
for advanced programming.
Chapter Overview
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 9-1
Advanced Programming with S7 PDIAG
Introduction
Using S7 PDIAG you can configure your own templates for the specific types of
monitoring definition you require and then simply re-use these templates.
In general, the same procedure applies as for creating monitoring definitions.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
9-2 A5E00063001-01
Advanced Programming with S7 PDIAG
Procedure
Proceed as follows to create a user-defined template:
1. Select the menu command Options > Templates in S7 PDIAG.
2. Select the appropriate monitoring definition in the following dialog box under
“Templates” or “Existing Monitoring Definitions,” for example: “S7 PDIAG:
Address Monitoring” and click “New.”
Note: Existing monitoring definitions are only displayed if you have selected an
initial diagnostic address.
3. The dialog box “Template (...)” opens. Complete the “General” and “Definition”
tabs according to your requirements.
4. Click the “Save” button to save your template.
Result: The template is added to the “Templates” dialog box with the name you
selected (in this case, “Address Monitoring”), as shown in Figure 9-1.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 9-3
Advanced Programming with S7 PDIAG
5. You can edit existing templates by selecting them in the list of templates and
clicking “Edit.” You then only have to enter the changes you require.
6. Using the “Delete” button, you can delete existing templates and monitoring
definitions if you have selected them.
Note: Remember that you are only creating a message template and not a real
message. This is why no message number is assigned in a template.
However, you can configure the message text for your monitoring definition in the
template.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
9-4 A5E00063001-01
Advanced Programming with S7 PDIAG
Introduction
Standard projects are “normal” projects in which you can program everything you
want to use again in other projects.
For example, you can re-use the supplied UDTs and block templates from the
“S7_DIAG” standard project in your own projects.
You can also create all the special templates for error definitions in user-defined
standard projects in order to use them in your projects.
The following section describes how to create a project derived from a standard
project.
Procedure
To derive a user-defined project from a standard project, proceed as follows:
• Open the standard project in the SIMATIC Manager and save it under a new
name with the menu command File > Save As.
or:
Create a new project and open this project together with the standard project.
Now select the corresponding S7 program in the standard project which you
want to copy into your project and select the menu command File > Copy.
Paste the copied S7 program into your new project.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 9-5
Advanced Programming with S7 PDIAG
Introduction
Using the “Modify Times Online / Offline” function, you can change monitoring
times both online or offline in existing monitoring definitions without having to
generate the monitoring blocks again each time, because the changes you make
are added to the S7 PDIAG database and the online or offline blocks.
Requirements
The monitoring definition you want to modify must meet the following requirements
if you want to modify times:
• It must have already been added to the S7 PDIAG monitoring blocks in a
previous compilation and the blocks must have been downloaded to the CPU
• It must be active; that is, the “Monitoring Active” check box must be set in the
dialog box for the corresponding error definition
• It must contain a monitoring time which is not equal to “0.”
Procedure
In order to modify times, proceed as follows:
1. Select the compiled monitoring definition in S7 PDIAG and select the menu
command Edit > Modify Times Online / Offline or click the corresponding
button in the toolbar.
or:
1. You can also modify times online or offline from the LAD/STL/FBD Editor if you
are in online or offline mode. To do this, open the block to which the monitoring
definition is appended and place the cursor on the initial diagnostic address.
2. Select the menu command Special Object Properties > Monitoring from the
pop-up menu.
3. Select the monitoring definition in which you want to modify the monitoring time
in the next dialog box which appears and then click the “Modify Times” button.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
9-6 A5E00063001-01
Advanced Programming with S7 PDIAG
4. The next dialog box displays the selected monitoring definition. However, you
can only modify the monitoring time.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 9-7
Advanced Programming with S7 PDIAG
Introduction
Criteria analysis treats all addresses in the same way when analyzing the cause of
an error. This may mean that some network sections which have contributed to the
error as a result of their programming logic are identified as faulty, but by using
additional information, you can eliminate them as the cause of the error.
For this reason, you have the option of defining a list of “exclusion addresses” in
S7 PDIAG. These addresses and the network sections which contain them
are excluded by criteria analysis if they are registered as having the value
“0” (only in conjunction with ProAgent, version 5.0 or higher).
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
9-8 A5E00063001-01
Advanced Programming with S7 PDIAG
Identifying Addresses
All addresses which are marked for criteria analysis are called exclusion
addresses. You can identify lines in your program using a list of addresses.
Procedure
In order to define exclusion addresses, proceed as follows:
1. Select the menu command Options > Exclusion Addresses in S7 PDIAG.
2. Enter the required addresses under “Exclusion Address” in the next dialog box
which appears. You can enter both symbolic and absolute addresses.
3. Click “Insert” to add the selected address to the list of existing exclusion
addresses.
4. If you want to delete any existing exclusion addresses, select the required
address from the list and click “Delete.”
5. If you want to delete all the addresses in the list, click “Delete All.”
6. Click “OK” to save your entries and close the dialog box.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 9-9
Advanced Programming with S7 PDIAG
Introduction
S7 PDIAG gives you the option of adapting message texts automatically when
generating the corresponding instances and of embedding associated values in the
message text. A number of formal addresses are provided for this purpose which
are replaced according to the programming language used
• when compiling the error definition (generation process) or
• when displaying the message.
The components to be replaced are identified in the message text by the opening
and closing characters “$$”.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
9-10 A5E00063001-01
Advanced Programming with S7 PDIAG
Procedure
In order to adapt message texts for a specific instance, proceed as follows:
• Enter the required formal addresses while you are configuring your message
text (see “Entering Message Texts” in Chapters 4, 5, and 6).
• You can select the source of the name from the following list:
– The names of the units
– The name of the motion
– The direction texts
– The name of the instance error definition for the initial diagnostic address
(IDA).
Result: The formal addresses you use in the message texts are replaced
according to the programming language used when the monitoring definitions
are compiled. Depending on the formal address, the next name or the
next-but-one will be used for the unit or motion, starting from the end of the
name.
• The table below shows you an example:
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 9-11
Advanced Programming with S7 PDIAG
Introduction
You can specify the position and the representational format of an associated value
in the message text. An associated value is a value (or an address) which can
accompany a message text. This value is detected by S7 PDIAG at the same time
the error is detected. The associated value is shown in the message text by the
display unit (HMI) at the position you have configured it. To do this, enter the
corresponding formal address in the message text.
The associated value can be a parameter of the BOOL, BYTE, WORD or DWORD
type from the I, Q, M or DB areas. You can specify the position and the
representational format of the associated value in the message text. To do this, put
together a description block for the associated value opened by the characters
“@1X” and closed by “@”.
Example for an associated value:
• @1X%6d@: The associated value is to be represented as a decimal number of
max 6 digits.
You can chose between the following characters of the associated value output
format. The format specification is opened by the character “%”.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
9-12 A5E00063001-01
Advanced Programming with S7 PDIAG
Procedure
Procede as follows to configure associated values:
• Open the monitoring definition message text in which you want to configure an
associated value.
• Select the check box “Record Associated Value” and enter the address.
• Determine the position and the representational format of the associated value
in the message text.
• Put together a description block for the associated value opened by the
characters “@1X” and closed by “@”. The associated value is entered in the
message text at the position of this description block.
• Furthermore, you can chose between the characters of the associated value
output format mentioned above. The format specification is opened by the
character “%”.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 9-13
Advanced Programming with S7 PDIAG
Introduction
S7 PDIAG allows you to group units by using the menu command Options >
Group Units.
In addition to the default standard group you can group any number of units in up
to 15 different groups. Monitoring blocks are created for each group during
generation. This results in smaller blocks and thus shorter generating times.
Note: You should not group the units until the end of the structuring phase has
been completed when you have already created your program hierarchy
completely.
Procedure
Proceed as follows in order to group units:
1. In S7 PDIAG select the Options > Group Units menu command.
2. The standard group is displayed in the subsequent dialog box under “Group”.
The left-hand list field displays the units belonging to the standard group, as
shown in the subsequent Figure 9-3:
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
9-14 A5E00063001-01
Advanced Programming with S7 PDIAG
3. Click on the “New” command button in order to create a new group. The “Group
Defaults” dialog box is opened (refer to Figure 9-4):
4. Enter a name for the new group to be created as well as the number for the
monitoring blocks for error recognition and initial-value acquisition and leave the
dialog box by clicking on “OK”.
Result: You have now created a new group which is displayed in the “Group
Units” dialog box under “Group”.
5. In the ”Group Units” dialog box now move units from the standard group to the
new group by selecting the desired units in the standard group and clicking on
the corresponding command buttons (>, All >). You can also use the ”>” and ”<
All” command buttons to move units back to the standard group.
6. In order to change the group defaults for the selected group again click on the
“Edit” command button.
7. The “Group Defaults” dialog box is opened and you can change the settings.
Leave the dialog box by clicking on “OK”.
8. You can use the “Delete” command button to delete the selected group, with
the exception of the standard group. The units assigned to this group are
moved back to the standard group.
9. After you have carried out all the settings, leave the dialog box by clicking on
“OK”.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 9-15
Advanced Programming with S7 PDIAG
Result: The new group is identified in the unit overview of S7 PDIAG by a small
number of a red background, as shown in the subsequent Figure 9-5:
Note: When you have created groups and copy the corresponding blocks, the
group information is not copied as well. The group information is not copied either
when you select all the blocks in the “Blocks” directory and then copy these.
The group information is only included in the copy when you select and copy the
“Blocks” directory, since the information in contained in the directory itself.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
9-16 A5E00063001-01
Advanced Programming with S7 PDIAG
Introduction
You can search in S7 PDIAG for the following objects and then edit them:
• S7 PDIAG error definitions,
• Other error definitions (relevant to S7 GRAPH and S7 HiGraph),
• Units
• Motions and
• Templates
In order to edit the search result you can call up a pop-up menu with the right-hand
mouse button which depends on the respective objects selected.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 9-17
Advanced Programming with S7 PDIAG
Figure 9-6 ”Search In - ...” Dialog Box with Display of the Search Results
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
9-18 A5E00063001-01
Advanced Programming with S7 PDIAG
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 9-19
Advanced Programming with S7 PDIAG
Introduction
Whenever generation has been carried out successfully, S7 PDIAG saves the
generated reference data in the STEP 7 database. The corresponding STEP 7
functionality can be used to display and filter these reference data.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
9-20 A5E00063001-01
Advanced Programming with S7 PDIAG
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 9-21
Advanced Programming with S7 PDIAG
Introduction
The properties of the selected motion are displayed in graphical form in the “Motion
Screen” dialog box. The “Movement screen” dialog box orientates itself as far as
possible to the representation of the movement screen at the display device.
Procedure
You can call this dialog box in S7 PDIAG by using the Edit > Motion menu item if
you have selected a motion in the left-hand section of the S7 PDIAG unit overview.
Note: You can use the Edit > Object Properties menu command to obtain the
identical information for a selected motion in non-graphical form.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
9-22 A5E00063001-01
Advanced Programming with S7 PDIAG
Introduction
In the past the diagnostic-relevant network data were written to the data storage of
S7 PDIAG. These data are then modified and transferred to the display devices
depending on the respective exclusion addresses.
This meant that you also had to update the data for the display devices after every
S7 PDIAG generation run.
New Functionality
As from V5.0 of S7 PDIAG you can specify that the diagnostic-relevant network
data are to be written to the initial-value acquisition blocks generated by S7 PDIAG
(under consideration of the exclusion addresses). From there they are read by the
display device (HMI) as required.
This has the advantage that you only have to generate in S7 PDIAG, depending on
the change, and that the display devices (HMI) do not have to be updated every
time.
Conditions
The following conditions have to be considered:
• When you add or delete error definitions or edit existing error definitions, a
message is displayed after the generation run informing you which new groups
have been created. These data also have to be updated for the corresponding
display devices (HMI).
• Changes to the LAD/STL/SFC Blocks:
– If you change blocks in the LAD/STL/SFC Editor, a message is also
displayed after the generation run informing you which new groups have
been created. You can decide whether you want to update these data for the
display devices (HMI) or not. These data do not have to be updated after
changes within networks.
– If you change the name or the number of networks, an incorrect name or an
incorrect number is displayed at the display device for this network.
However, the criteria analysis is correct. In this case it is up to you whether
you update the diagnostic-relevant network data for the display devices.
– If you delete networks which contain multiple assignments or if you add
networks which create multiple assignments (which thus contain an address
which has been assigned several times), you have to update the
diagnostic-relevant network data for the display devices (HMI), since it will
otherwise not be possible to carry out the criteria analysis.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 9-23
Advanced Programming with S7 PDIAG
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
9-24 A5E00063001-01
Notes on Programming Your User
Program A
In This Chapter
In this chapter, you will learn how S7 PDIAG supports you when programming or
modifying your user program.
You will also learn how to install the UDT_Unit, the UDT_S_Unit, and the
UDT_Motion as well as how to create motion monitoring using the Ladder
networks in FB100 of the sample program “S7_DIAG” supplied with the software.
Chapter Overview
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 A-1
Notes on Programming Your User Program
Introduction
S7 PDIAG supports you when assigning error definitions to a functional unit or
motion by:
• Providing user-defined data types (UDTs)
– The UDT_Unit (see Section A.2)
– The UDT_S_Unit (see Section A.3)
– The UDT_Motion (see Section A.4)
• Providing Ladder networks which describe the assignment of parameters to the
UDT_Motion, for example (see Section A.5).
• Providing auxiliary networks which support you when carrying out criteria
analysis if you have also programmed preceding logic operations.
What is a UDT?
A UDT is a user-defined data type which can be saved as a block. This means that
you can create one UDT and then use it many times: on the one hand as a
“normal” data type, and on the other hand as a template for creating blocks with
the same data structure.
For additional information on UDTs, refer to the reference manual Statement List
(STL) for S7-300 and S7-400.
The UDT_Unit
The UDT_Unit represents a functional unit with its own operating modes. The
following has already been defined in the UDT_Unit:
• Group error detection
• 16 operating modes, two of which are predefined as “manual operation” and
“automatic.” You can define the remaining 14 modes according to your own
requirements.
You will find a detailed description of the UDT_Unit in Section A.2.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A-2 A5E00063001-01
Notes on Programming Your User Program
The UDT_S_Unit
The UDT_S_Unit represents a functional unit without its own operating modes. It
contains the following:
• The group error address
• The group error acknowledgement.
You will find a detailed description of the UDT_S_Unit in Section A.3.
The UDT_Motion
The UDT_Motion represents a standard interface between S7 PDIAG and the
display devices (OPs) and contains all the parameters for:
• Displaying motions in motion screens on the display device without the need for
additional configuring
• Moving these motions manually in the motion screen on the display device.
The requirement for this is that you have used the Ladder networks supplied in
FB100 for motion programming.
You will find a detailed description of the UDT_Motion in Section A.4.
Example
A stamping machine contains the elements “Press,” “Safety Guard,” and “Punch,”
where the safety guard and the punch are, in turn, components of the press.
The press is a unit in the sense of S7 PDIAG. The punch is a motion which is
enabled by the safety guard.
In order to coordinate these objects with one another, you need to program a
“coordination” function block which uses the UDT_Unit and the UDT_Motion.
If you now receive a group error message on your display device informing you
that the unit “Press” is faulty, you can position the cursor in the motion screen on
the unit “Press” and move down a level to display the three motions for the press,
punch, and safety guard. Here, you will see that a group error bit is also set in the
motion structure of the punch.
Result: The press is therefore faulty because the punch is faulty. The fault in the
punch has caused the error definition.
Use: Using the UDT_Unit, the UDT_S_Unit, and the UDT_Motion enables you to
determine which error definition was caused by means of data reduction, and to
then remedy this error manually.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 A-3
Notes on Programming Your User Program
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A-4 A5E00063001-01
Notes on Programming Your User Program
Introduction
The UDT_Unit contains all the necessary data of a process unit and can be
inserted in the variable declaration table of a function block:
• In the areas: “In,” “Out,” and “Stat”
An “Array of UDT_Unit” is not permitted.
The UDT_Unit is characterized by the fact that it has the attribute “S7_pdiag_unit”
and this attribute is set to “TRUE.”
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 A-5
Notes on Programming Your User Program
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A-6 A5E00063001-01
Notes on Programming Your User Program
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 A-7
Notes on Programming Your User Program
Introduction
The UDT_S_Unit contains the basic parameters necessary for a process unit and
can be inserted in the variable declaration table of a function block:
• In the areas: “In,” “Out,” and “Stat”
An “Array of UDT_S_Unit” is not permitted.
The UDT_S_Unit is characterized by the fact that it has the attribute
“S7_pdiag_s_unit” and this attribute is set to “TRUE.”
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A-8 A5E00063001-01
Notes on Programming Your User Program
Introduction
The UDT_Motion represents a motion in your user program. It can be inserted in
the variable declaration table of a function block:
• In the areas: “In,” “Out,” and “Stat”
An “Array of UDT_Motion” is not permitted.
The UDT_Motion is characterized by the fact that it has the attribute
“S7_pdiag_motion” and this attribute is set to “TRUE.”
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 A-9
Notes on Programming Your User Program
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A-10 A5E00063001-01
Notes on Programming Your User Program
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 A-11
Notes on Programming Your User Program
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A-12 A5E00063001-01
Notes on Programming Your User Program
Introduction
The Ladder networks for motion monitoring supplied in FB100 of the sample
project “S7_DIAG” create the whole motion programming, and are explained in
detail in this section.
These networks also contain the program for manually operating the motion from
the display device.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 A-13
Notes on Programming Your User Program
Introduction
The following example shows how the incoming and outgoing values of the motion
structure UDT_Motion are provided. It is up to you which networks you use or
modify; however, if you do change the given networks, this may restrict the
functionality of the program on the display device.
Network 1
In network 1, the final position can be determined via a limit switch, a light sensor,
or a combination of data. The status of the final positions is displayed in the motion
screen. Here, the limit switch “Ia.b” is visualized.
#z.Final_
Ia.b Position[0]
• Startup monitoring:
Here the program monitors whether the current final position is actually left
once the motion has been triggered.
Monitoring logic (with time):
ONDT (#z.Control2, ?) AND #z.Final_Position[0]
(generally without initial value acquisition)
• Action monitoring:
Here the program monitors whether the final position is actually reached once
the motion has been triggered.
Monitoring logic (with time):
ONDT (#z.Trigger1, ?) AND NOT #z.Final_Position[0]
(generally without initial value acquisition)
• Reaction monitoring:
Here the program monitors whether the final position is left without the motion
being triggered.
Monitoring logic (without time):
#z.Position_Flag[0] AND NOT #z.Final_Position[0]
Monitoring logic (with time):
#z.Position_Flag[0] AND NOT ONDT (#z.Final_Position[0], ?)
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A-14 A5E00063001-01
Notes on Programming Your User Program
Network 2
In this network, the safety conditions (interlocks) of the motion are checked in
direction 1. In the example, the opposite direction of the motion is used; in this
case, the trigger for the output is negated.
#z.Control2 #z.Interlock1
Network 3
In this network, the interlocks for manual operation of the motion are checked in
direction 1.
This network may or may not be used, depending on whether there are differences
in the interlock between the operating modes. Depending on the application used,
network 1 can also include the interlocks for automatic operation and network 2 the
interlocks for manual operation (programmed manual mode). In the example, the
same interlocks apply as in network 1.
#z.Manual_
#z.Interlock1 Interlock1
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 A-15
Notes on Programming Your User Program
Network 4
In this network, the executability is formed. This supports programmed manual
mode. The network shows that the motion can be moved in direction 1.
• Interlock monitoring:
The interlock monitoring definition is appended to the “Executability” signal.
This, together with criteria analysis, enables you to determine the missing signal
which is preventing the motion from moving (either in manual operation or
automatic operation).
Monitoring logic (without time):
#z.Trigger1 AND NOT #z.Executability1
Monitoring logic (with time):
ONDT (#z.Trigger1, ?) AND NOT #z.Executability1
(generally with initial value acquisition)
#z.Manual_ #z.Final_
manual Interlock1 Position[0] #z.Executability1
automatic #z.Interlock1
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A-16 A5E00063001-01
Notes on Programming Your User Program
Network 5
Here the trigger is formed which is to move the motion in direction 1.
The lowest branch in this network represents automatic operation. Due to the order
in which the program is processed, the variable “#z.Automatic_Trigger1” is set at
another location in the user program in order to move the motion.
The two upper branches in the network represent the operation of the motion using
the direct keys via the motion screen. Here, “#z.Manual_Enable1” decides whether
the motion is represented on the display device or not.
The pair “Ix1.y1” and “#z.Display_order[0]” would switch if the motion were first in
the sequence and the direct key “Ix1.y1” were pressed. The same applies to all
other direct keys. In this example, only two direct keys are used.
#z.Display_
Ix2.y2 Order[1]
#z.Automatic_
Trigger1 automatic
Network 6
This network is only required if you are using reaction monitoring.
The position flag is set when the motion has arrived at the final position and the
trigger is still active. The trigger is then removed in the next network. As soon as
the position flag is set, reaction monitoring is activated.
Note: Reaction monitoring is not activated until the motion has already been
moved once, in order to avoid initialization problems.
#z.Final_ #z.Position_
Position[0] #z.Control1 Flag[0]
Fig. A–6: Network 6: Setting the Position Flag for Reaction Monitoring
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 A-17
Notes on Programming Your User Program
Network 7
In this network, the trigger for the motion is formed for all operating modes.
In this example, the motion is only controlled if both the executability and the
trigger for this direction are set.
Network 8
The “Moving_Status” bit is used to represent whether the motion being triggered is
actually moved on the display device.
This can be determined implicitly by triggering the output, as shown in the
example, or by measuring the motion directly in the process.
#z.Moving_
#z.Control1 Status1
Network 9
This network is only required if you are using reaction monitoring.
The position flag is reset when the motion is triggered in the opposite direction.
#z.Position_
#z.Control2 Flag[0]
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A-18 A5E00063001-01
Notes on Programming Your User Program
Introduction
In the following example, one direction of a motion is shown in reduced form. This
contains the display functions and the monitoring definitions, whilst excluding
reaction monitoring
This motion cannot be moved via direct keys.
Network 1
The final position can be determined via a limit switch, a light sensor, or a
combination of data. The status of the final positions is displayed in the motion
screen.
In this example, the limit switch Ia.b is visualized.
• Startup monitoring:
Here the program monitors whether the current final position is actually left
once the motion has been triggered.
Monitoring logic (with time):
ONDT (#z.Control2, ?) AND #z.Final_Position[0]
(generally without initial value acquisition)
• Action monitoring:
Here the program monitors whether the final position is actually reached once
the motion has been triggered.
Monitoring logic (with time):
ONDT (#z.Trigger1, ?) AND NOT #z.Final_Position[0]
(generally without initial value acquisition)
#z.Final_
Ia.b Position[0]
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 A-19
Notes on Programming Your User Program
Networks 2, 3 and 4
In these networks, the executability is formed. The networks contain the interlocks
for both manual and automatic operation. This supports programmed manual
mode, and the networks show that the motion can be moved in Direction 1.
You can add further interlock conditions in these networks.
• Interlock monitoring:
The interlock monitoring definition is appended to the “Executability” signal.
This, together with criteria analysis, enables you to determine the missing signal
which is preventing the motion from moving.
Monitoring logic (without time):
#z.Trigger1 AND NOT #z.Executability1
Monitoring logic (with time):
ONDT (#z.Trigger1, ?) AND NOT #z.Executability1
#z.Moving_ #z.Final_
manual Status2 Position[0] #z.Executability1
#z.Moving_
automatic Status2
Fig. A–11: Networks 2/3/4: Displaying Executability for Direction 1 on the Dis-
play Device
Network 4
Here the trigger is formed to enable the motion to move in Direction 1.
The upper branch in the network represents the operation of the motion using the
key via the motion screen. When the key is pressed, the display device sets the
“Manual_Operation” bit.
The lowest branch in this network represents automatic operation. Due to the order
in which the program is processed, the variable “#z.Automatic_Trigger1” is set at
another location in the control program in order to move the motion.
#z.Manual_ #z.Final_
manual Operation1 Position[0] #z.Trigger1
#z.Automatic_
automatic Trigger1
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A-20 A5E00063001-01
Notes on Programming Your User Program
Networks 7 and 8
In these networks, the trigger for the motion is formed for all operating modes.
In this example, the motion is only controlled if both the executability and the
trigger for this direction are set.
#z.Moving_
#z.Executability1 #z.Trigger1 Status1
Fig. A–13 Networks 7 and 8: Triggering / Displaying the Motion Moving in Di-
rection 1
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 A-21
Notes on Programming Your User Program
A.8 The User Function Block as the Interface to Your User Program
Introduction
The user function block supplied with the S7 PDIAG software enables you to react
to specific error messages and hence to error states in your process. It is called
with different parameters, depending on whether the error is incoming or outgoing.
In this way, you can obtain information on the unit, the priority, and the message
number of the error, for example.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A-22 A5E00063001-01
Notes on Programming Your User Program
Introduction
In order for S7 PDIAG to be able to support criteria analysis on the display device,
you should observe the following notes.
Program-Oriented Work
S7 PDIAG enables program-oriented work; that is, it searches for and edits only
those error definitions which you have configured in an entire program.
Run Sequence
The run sequence of the individual networks is not taken into account when using
auxiliary networks.
Example: A M0.0
A I1.0
= M1.1 //M1.1 has the value of cycle n-1
A I1.1
= M 0.0 //M0.0 has the value of cycle n
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 A-23
Notes on Programming Your User Program
Introduction
In order to carry out process diagnostics, you must create the information required
by S7 PDIAG for the selected block. For blocks which contain error definitions, this
occurs automatically. Blocks which do not have their own error definition, but which
contain preceding logic for the network to be monitored, can be given diagnostic
capability as follows:
1. Activate the “Store Process Diagnostics Data” check box in the LAD/STL/FBD
Editor, as described below.
2. Enable the block to which you want to append the error message to contain
diagnostic data by following the instructions below.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A-24 A5E00063001-01
The Language Elements in S7 PDIAG and
their Syntax B
In This Chapter
This chapter describes the language elements available in S7 PDIAG for
programming monitoring logic, and the syntax to be observed.
The chapter also informs you about the processing priorities of the individual
qualifiers.
Chapter Overview
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 B-1
The Language Elements in S7 PDIAG and their Syntax
Introduction
Using the language elements in S7 PDIAG, you can program your own individual
monitoring logic.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
B-2 A5E00063001-01
The Language Elements in S7 PDIAG and their Syntax
AND
The AND instruction combines two logical expressions A1 and A2 to form another
logical expression (A0) which can then be further combined. The result of the logic
operation is TRUE when both input conditions are TRUE.
Example: I1.0 AND I1.1, or
MotorOn AND Enable, or
(MotorOn AND Enable) AND Automatic
A1
T0 T1 T2 T3 T4 T5 T6 T7 T8 T9
A2
T0 T1 T2 T3 T4 T5 T6 T7 T8 T9
A0
T0 T1 T2 T3 T4 T5 T6 T7 T8 T9
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 B-3
The Language Elements in S7 PDIAG and their Syntax
OR
The OR instruction combines two expressions A1 and A2 to form a new
expression A0 so that the expression A0 is TRUE when either A1 only or A2 only
is TRUE or when both A1 and A2 are TRUE.
Example: I1.0 OR I1.1, or
MotorOn OR Enable, or
(MotorOn OR Enable) OR Automatic
A1
T0 T1 T2 T3 T4 T5 T6 T7 T8 T9
A2
T0 T1 T2 T3 T4 T5 T6 T7 T8 T9
A0
T0 T1 T2 T3 T4 T5 T6 T7 T8 T9
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
B-4 A5E00063001-01
The Language Elements in S7 PDIAG and their Syntax
XOR
The XOR instruction combines two logical expressions A1 and A2 to form a new
expression A0 so that this expression is TRUE when either A1 only or A2 only is
TRUE.
Example: I1.0 XOR I1.1, or
MotorOn XOR Enable, or
(MotorOn XOR Enable) XOR Automatic
A1
T0 T1 T2 T3 T4 T5 T6 T7 T8 T9
A2
T0 T1 T2 T3 T4 T5 T6 T7 T8 T9
A0
T0 T1 T2 T3 T4 T5 T6 T7 T8 T9
NOT
The NOT instruction forms the logical expression A0 by negating the expression
A1. If A1 = TRUE, then A0 = FALSE. If A1 = FALSE, then A0 = TRUE. NOT
therefore negates the logical result of the input expression.
A1
T0 T1 T2 T3 T4 T5 T6 T7 T8 T9
A0
T0 T1 T2 T3 T4 T5 T6 T7 T8 T9
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 B-5
The Language Elements in S7 PDIAG and their Syntax
EN
General: A0 = EN (A1)
The EN instruction (falling edge) saves whether the last edge of the expression A1
was a rising or a falling edge. The EN instruction creates the expression A0 from
the expression A1 according the following rules:
• A0 = TRUE after a falling edge (change from TRUE to FALSE) in A1.
• A0 = FALSE after a rising edge (change from FALSE to TRUE) in A1.
• A0 = FALSE until the occurrence of the first falling edge in A1.
A1
T0 T1 T2 T3 T4 T5 T6 T7 T8 T9
A0
T0 T1 T2 T3 T4 T5 T6 T7 T8 T9
EN therefore evaluates whether the logic result of the input expression has caused
a change from TRUE to FALSE. The result is TRUE when the change from TRUE
to FALSE is recognized. The result remains TRUE until the input expression is
TRUE again.
Note: The expression A1 should not contain the qualifiers ONDT, EN, EP, or SRT.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
B-6 A5E00063001-01
The Language Elements in S7 PDIAG and their Syntax
EP
General: A0 = EP (A1)
The EP instruction is the opposite of EN. This instruction saves whether the last
edge of the expression A1 was a rising or a falling edge. The EP instruction
creates the expression A0 from the expression A1 according the following rules:
• A0 = TRUE after a rising edge (change from FALSE to TRUE) in A1.
• A0 = FALSE after a falling edge (change from TRUE to FALSE) in A1.
• A0 = FALSE until the occurrence of the first rising edge in A1.
A1
T0 T1 T2 T3 T4 T5 T6 T7 T8 T9
A0
T0 T1 T2 T3 T4 T5 T6 T7 T8 T9
With the EP instruction, the logic result is TRUE when the change in the input
expression from FALSE to TRUE is recognized.
Note: The expression A1 should not contain the qualifiers ONDT, EN, EP, or SRT.
SR
General: A0 = SRT (A1, A2, T)
SRT (set / reset timer) is an on delay and monitors two expressions together. SRT
works with both a set input and a reset input, both of which are pulse-driven. This
means that the result is triggered by a rising edge (pulse) and not by TRUE or
FALSE.
• A rising edge and therefore a positive change (from FALSE to TRUE) in A1 (set
input) starts the time T, regardless of whether the timer is running. A0 is set to
FALSE.
• A rising edge and therefore a positive change (from FALSE to TRUE) in A2
(reset input) stops the time T, regardless of whether the timer is running. A0 is
set to FALSE. If the delay time expires before it is stopped by expression A2,
the error is registered as “incoming.”
• A0 is set to TRUE if the time T has expired.
• A0 is initialized with FALSE on program start.
• If a rising edge occurs in both A1 (set input) and A2 (reset input) at the same
time, A1 is ignored, since the expression A2 has higher priority, and the result is
FALSE.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 B-7
The Language Elements in S7 PDIAG and their Syntax
tVerz tVerz
A1
A2
Result:
A0
Note: The expressions A1 and A2 should not contain the qualifiers ONDT, EN, EP,
or SRT.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
B-8 A5E00063001-01
The Language Elements in S7 PDIAG and their Syntax
ONDT
General: A0 = ONDT (A1, T)
The ONDT instruction executes an on delay. Depending on the expression A1 and
the time T, the ONDT instruction forms the expression A0 according to the
following rules:
• If (A1 = FALSE) or (T running), then A0 = FALSE.
• If (A1 = TRUE) and (T expired), then A0 = TRUE.
• If A1 changes from FALSE to TRUE (rising edge), the timer starts again,
(regardless of whether it is already running).
• If (A1 = TRUE), the timer is started (program start or complete restart).
The ONDT instruction always restarts the delay time if the result of logic operation
of the expression (A1) is TRUE, see Figure LEERER MERKER:
tVerz tVerz
A1
Result:
A0
P0 T0 T1 T2 T3 T4 T5 T6 T7 T8 T9 T10 T11 T12 T13 T14 T15 T16
If the expression A1 is still TRUE after the time (T) has expired, the result of ONDT
is also TRUE.
Example: ONDT (I1.0, 2000 ms)
If the input I1.0 is TRUE, the result of this expression is TRUE after 2000 ms if the
input remains TRUE. Here, the ONDT instruction corresponds to level monitoring
at a positive level which can be further combined.
Note: The expression A1 should not contain the qualifiers ONDT, EN, EP, or SRT.
Separators
You must separate the individual language elements in S7 PDIAG from one
another using separators.
The following characters are interpreted as separators:
• Space
• TAB
• ENTER
• Brackets (, )
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 B-9
The Language Elements in S7 PDIAG and their Syntax
Brackets
You can use brackets (or parentheses) to determine the order in which individual
language elements are processed. Brackets can also be used as separators.
Addresses
You can use all binary S7 addresses in S7 PDIAG.
Timers
You can enter a time “t” in milliseconds, seconds, or hours, and in S7 time format.
If you do not specify the unit of measurement, milliseconds is used as the default
unit. Negative times and times = 0 are excluded.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
B-10 A5E00063001-01
The Language Elements in S7 PDIAG and their Syntax
Introduction
The syntax of the programming language describes the relationship between the
different language elements. The syntax for addresses and timers corresponds to
the standard STEP 7 syntax.
This section illustrates the valid syntax for the following:
• Expressions
• Boolean expressions
The words in bold text are metawords in the language.
Expressions are always binary and can have the value TRUE or FALSE.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 B-11
The Language Elements in S7 PDIAG and their Syntax
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
B-12 A5E00063001-01
The Language Elements in S7 PDIAG and their Syntax
Introduction
The individual qualifiers within S7 PDIAG are processed with the following priority:
Qualifier Priority
Brackets (, ) 1
NOT, EP, and EN 2
AND 3
XOR 4
OR 5
ONDT and SRT 6
With qualifiers which have the same priority, the monitoring logic is processed from
left to right.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 B-13
The Language Elements in S7 PDIAG and their Syntax
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
B-14 A5E00063001-01
Example of Using Monitoring Types with
S7 PDIAG C
In This Chapter
This chapter uses an example of a drill to show how you can work with motion
monitoring in S7 PDIAG with the help of a function block containing both the data
interface for the display device and the monitoring definitions for S7 PDIAG.
To ensure that the “drill” example can be programmed and debugged as described,
you require the following hardware and software components:
• Programming device / PC with the STEP 7 Standard package and S7 PDIAG
optional package
• Multipoint interface connection to an S7-300 or S7-400 programmable logic
controller with 16 digital inputs and 8 digital outputs, or, alternatively, with the
S7 PLCSIM V4.x optional package.
• In order to familiarize yourself with the complete range of functions, you also
require a display device with the process diagnostics package ProAgent.
Chapter Overview
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 C-1
Example of Using Monitoring Types with S7 PDIAG
Task Definition
A monitoring definition is to be programmed to automate a drill. The structure of
the drill is predefined in a diagram and the process is defined in the form of a
function chart.
Drill motor
Feed up
Drill motor on
Confirmation:
– Drill on hold Limit switch:
Feed is up
Cooling pump On
Á
Á
Confirmation:
Cooling pressure reached Limit switch:
Á
Feed is down
Start button
Preselection switch for cooling liquid
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
C-2 A5E00063001-01
Example of Using Monitoring Types with S7 PDIAG
Initial State
The initial state of the drill is defined as follows:
• Drill motor and cooling pump are on hold
• Feed/drill is in “is up” position
• No workpiece has been inserted or clamped.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 C-3
Example of Using Monitoring Types with S7 PDIAG
C.2 Function Chart and Units for the Structure of the Drilling
Process
Introduction
The drilling process is divided into the following steps:
• Insert workpiece (manually)
• Press preselection switch for cooling liquid, if required (dependent on material)
• Start machine using start button
• Clamp workpiece
• Switch on cooling pump (depending on preselection)
• Lower drill using feed to lower target position (drill)
• Raise drill using feed to upper target position
• Release workpiece, switch off drill motor and cooling pump
• Remove workpiece (manually).
Function Chart
Figure C-1 below shows the corresponding function chart for the structure of the
drilling process.
Element State
Start
closed
Clamp
open
up
Feed
down
Determining Units
In this example there is exactly one functional unit, the drill itself.
As the drill does not have an operating mode selection switch, the UDT_S_Unit is
used for this functional unit.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
C-4 A5E00063001-01
Example of Using Monitoring Types with S7 PDIAG
Determining Motions
As shown in the diagram, there are two motions:
• Feed
• Clamp
Address Comment
Absolute Symbolic
Inputs in the Program (I)
I 0.1 Drill_on_Hold Confirmation: Drill is not active
I 1.1 Is_Open Confirmation: Workpiece released from clamp
I 0.3 Is_Up Limit switch “clamp in upper position”
I 0.2 Is_Down Limit switch “feed in lower position”
I 1.2 Is_Closed Confirmation: Workpiece clamped
I 0.6 Cooling_Pressure_OK Confirmation: Cooling pressure reached
I 0.7 Start_Button Start button of drill
I 0.5 Use_Cooling_Liquid Selection switch for cooling liquid
I 1.0 Workpiece_Present Confirmation: Workpiece in clamp
Outputs in the Program (Q)
Q 0.0 Drill_Motor_On Switch on drill motor
Q 0.1 Cooling_Pump_On Switch on cooling pump (dependent on workpiece)
Q 0.5 Release_Clamp Release workpiece from clamp
Q 0.4 Close_Clamp Hold workpiece in clamp
Q 0.3 Feed_Up Raise drill using feed to upper final position
Q 0.2 Feed_Down Lower drill using feed to lower final position
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 C-5
Example of Using Monitoring Types with S7 PDIAG
Overview of Blocks
The following table provides an overview of the blocks used in the user program
and their functions:
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
C-6 A5E00063001-01
Example of Using Monitoring Types with S7 PDIAG
Using FB100
The following figure shows the call interface of the motion FB100:
Interlock1
Interlock2
Trigger1 Control1
Trigger2
Control2
FinalPosition1
FinalPosition2
Interlock1/2 Interlocks which, if not fulfilled, prevent the motion from moving in the
respective direction.
Note: The different operating modes should be taken into
consideration. You can also insert the corresponding different
network branches and interconnect them to this input.
Trigger1/2 Trigger which ensures that the motion can be moved in the required
direction.
Note: The logic for moving motions manually via the motion screens
on the display device is already stored in the motion block. This
means that you only need to interconnect the trigger here, for
example, for automatic operation.
FinalPosition1/2 Input showing that the motion has reached or left the respective final
position.
Note: If you activate the option “Preset Final Positions” when
compiling with S7 PDIAG, the designations of the final positions for
the motion screen on the display devices are entered automatically.
Control1/2 Triggers the outputs for the respective direction of the motion.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 C-7
Example of Using Monitoring Types with S7 PDIAG
Drill DB1
This data block contains all the data required to control the drill.
When you call FB1 in OB1 to control the drill, you are automatically asked whether
the corresponding instance data block has been generated. The symbolic name of
this data block is accepted by the display devices as the name of the unit.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
C-8 A5E00063001-01
Example of Using Monitoring Types with S7 PDIAG
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 C-9
Example of Using Monitoring Types with S7 PDIAG
Preparations
In order for the example to run correctly, you require input bytes 0 and 1 and
output 0 in your controller. First switch the controller to STOP.
• If you are working without a display device, you can display the messages
generated by S7 PDIAG on your programming device/PC using the menu
command PLC > CPU Messages. Place a check mark in column “A” and select
“Top.”
In this case, however, you cannot display the unit overview, the motion screen,
and the criteria analysis. Instead, you can open FB1 and monitor it online.
• If you are working with a display device, create a new project and insert your
CPU and the relevant display device.
• Double-click the network symbol to check that both the CPU and the display
device are connected to a common network. Then copy the sample program
into the program below your CPU.
• Download the sample program to the CPU and, if necessary, to the
configuration for the display device.
Procedure
The error messages that occur will guide you through the example.
You will see how S7 PDIAG and ProAgent help you to “drive” the drill and how they
offer you support when errors occur.
Now select the message screen on the display device, or activate the function
“CPU Messages.”
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
C-10 A5E00063001-01
Example of Using Monitoring Types with S7 PDIAG
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 C-11
Example of Using Monitoring Types with S7 PDIAG
First leave final position I1.1 “Is_Open” and then set final position I1.2 “Is_Closed.”
• The following message is now displayed:
“Interlock Feed down.”
• Criteria analysis displays the following result:
AN I0.1 Drill_on_Hold Confirmation: Drill is not active
Now simulate the drill motor turning by resetting input I0.1 “Drill_on_Hold.” You
must note that because of the “AN” instruction, negative logic is displayed.
The feed now proceeds downwards and drilling takes place. This can be seen at
the set output Q0.2 “Feed_Down.”
• When the specified monitoring time of one minute has elapsed, the following
message is displayed:
“Final Position Feed down not reached.”
First leave the final position I0.3 “Is_Up” and then set the final position I0.2
“Is_Down.”
Now the feed travels upwards again. This can be observed at the set output Q0.3
“Feed_Up.”
• When the configured monitoring time of one minute has elapsed, the following
message is displayed:
“Final position Feed up not reached.”
First leave the final position I0.2 “Is_Down” and then set the final position I0.3
“Is_Up.”
All that remains is for the clamp to be opened again.
• However, first the following message appears:
“Interlock clamp open.”
• Criteria analysis for this displays the following result:
A I0.1 Drill_on_Hold Confirmation: Drill is not active
Now acknowledge this message again.
Output Q0.5 “Release_Clamp” is now triggered.
• When the configured monitoring time of one minute has elapsed, the following
error message is displayed:
“Final position Clamp open not reached.”
First leave the final position I1.2 “Is_Closed” and then set the final position I1.1
“Is_Open.”
The drilling process is now complete and you can remove the workpiece by
resetting input I1.0 “Workpiece_Present.” You can see in the motion screen that
the left-hand triangle of the “Clamp” motion is now empty. This shows that this
motion can now no longer be moved. As soon as you insert a workpiece, the clamp
can be used again.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
C-12 A5E00063001-01
Example of Using Monitoring Types with S7 PDIAG
Summary
With a relatively simple configuration, S7 PDIAG and ProAgent provide both
automatically generated motion screens and detailed information on any errors that
occur. This enables you to reduce the down times of your automation solution and
contributes to increased productivity.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 C-13
Example of Using Monitoring Types with S7 PDIAG
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
C-14 A5E00063001-01
Tips and Tricks for Working with S7 PDIAG D
In This Chapter
The following table contains information which will help you when working with
S7 PDIAG.
Chapter Overview
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 D-1
Tips and Tricks for Working with S7 PDIAG
Introduction
The following notes may be of use when you are working with S7 PDIAG.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
D-2 A5E00063001-01
Tips and Tricks for Working with S7 PDIAG
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 D-3
Tips and Tricks for Working with S7 PDIAG
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
D-4 A5E00063001-01
Tips and Tricks for Working with S7 PDIAG
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 D-5
Tips and Tricks for Working with S7 PDIAG
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
D-6 A5E00063001-01
Glossary
Absolute Address
An absolute address includes the address identifier and the physical memory
location where the address is stored. Examples: Input I 12.1; Memory Word
MW25; Data Block DB3.
Action Monitoring
Action monitoring is a type of motion monitoring which monitors whether a motion
is completed within a specific action time. This is the case when the target final
position is reached.
Action Time
The action time is the time within which a motion must be completed.
Address
An address is part of a STEP 7 statement and specifies what the processor should
execute the instruction on. Addresses can be absolute or symbolic.
Address Monitoring
Address monitoring allows you to monitor specific individual addresses for level or
edge changes; this type of monitoring can be combined with a time delay. Address
monitoring is directly linked to an address, called the initial diagnostic address.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 Glossary-1
Glossary
Block
Blocks are part of the user program and can be distinguished by their function,
their structure, or their purpose. STEP 7 provides the following types of blocks:
• Logic blocks (FB, FC, OB, SFB, SFC)
• Data blocks (DB, SDB)
• User-defined data types (UDT)
Compiling
This process creates an executable user program from a source file.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
Glossary-2 A5E00063001-01
Glossary
Criteria Analysis
Using criteria analysis, you can analyze error conditions. You can then display the
states of the addresses (initial values) which caused the error (for example, limit
switch at input I1.1) up to the result of logic operation in STL, LAD, and FBD
directly on the display device.
In order to be able to carry out criteria analysis on the display device, you must
activate initial value acquisition in S7 PDIAG.
Direct Keys
Direct keys are keys which are linked directly to the digital inputs of the controller
(for example, as hardware wiring or via a DP interface) via the digital outputs of the
display device. They enable you to operate the motion directly in the motion screen
on the display device.
Edge Monitoring
Edge monitoring monitors a specific address for a defined edge (rising or falling).
The error state occurs after an edge change if the incorrect level is at the address
for longer than the defined delay time (for example, level “1” after a rising edge).
Error Definition
In error definitions, you can define the exact error which is to be monitored. Such
error definitions can be appended to addresses in the LAD/STL/FBD Editor or
created with S7 PDIAG.
Error Message
The errors detected by S7 PDIAG are registered on all connected display devices
using the message text you configured. You can enter message texts for error
messages while you are configuring the error definitions.
Exclusion Addresses
Exclusion addresses are addresses which you define in a list as “never causing an
error.” Criteria analysis hides these addresses and the subnets which contain them
if they are registered as having the value “0” (only in conjunction with ProAgent,
version 5.0 or higher).
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 Glossary-3
Glossary
Executability
Executability means that the executability of the motion is enabled. The
executability is defined as “Executability1/Executability2” when using the
UDT_Motion.
General Monitoring
With general monitoring, you can specify your own monitoring logic as a sequence
of logical expressions. You create a monitoring logic using the language elements
available, which enables you to carry out complex error monitoring. The error state
occurs when the defined conditions are fulfilled.
Group Error
A group error is an error which is passed from a lower-level unit causing an error to
the highest unit in the unit overview of S7 PDIAG and is displayed at the display
device.
Initial Value
Initial values are the binary states which have led to the result of logic operation for
the address being monitored.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
Glossary-4 A5E00063001-01
Glossary
Interlock Monitoring
Interlock monitoring is one of the four types of motion monitoring. With interlock
monitoring, you monitor whether the interlock condition (executability) is fulfilled
once the motion has been triggered and after a specified period of time (interlock
time) has elapsed.
Interlock Time
The interlock time is the time within which the interlock conditions must be fulfilled.
Level Monitoring
With level monitoring, a specific address is monitored for a defined level (0 or 1).
The error state occurs when the address has had the specified level for longer than
the defined delay time.
Library
A library is a container for blocks, source files, and charts.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 Glossary-5
Glossary
Monitoring Blocks
Monitoring blocks are the blocks for error detection as well as for initial value and
status acquisition, which are generated from the error definitions you create in S7
PDIAG. After you have downloaded these monitoring blocks to your user program,
you can carry out process diagnostics.
Monitoring Definitions
S7 PDIAG offers the following types of monitoring:
• Address monitoring
• General monitoring
• Motion monitoring
Monitoring Logic
The monitoring logic is the logic defined with the S7 PDIAG language elements
which is used to monitor your process. With address monitoring and motion
monitoring, the monitoring logic is already predefined and you only need complete
the logic.
With general monitoring, you can program your own logic using the language
elements in S7 PDIAG.
Monitoring Type
This term is used for the type of an error definition, in contrast to its instance.
Motions
Motions in a process are often defined as follows:
• They have two directions with two or more stable final positions
• They can be moved in the corresponding direction when triggered
For example, a cylinder moves from the current final position to the target final
position when the hydraulic pressure is switched on.
A system or machine may contain a large number of motions. It is therefore a good
idea to combine motions with similar functions together in a subsystem, which is
referred to here as a unit.
Motions are sequences in the process which are monitored using error definitions.
You can create several error definitions for each motion. A motion can only be
contained in a unit, and represents an actual movement of a physical object in the
process (for example, a punch moving up and down).
Motions are defined by the fact that the UDT_Motion is used in a block. Predefined
Ladder networks are available for controlling motions easily.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
Glossary-6 A5E00063001-01
Glossary
Motion Monitoring
With motion monitoring, you can monitor whether physical motions have been
carried out correctly and quickly enough in your process.
S7 PDIAG supports you by providing the UDT_Motion, which has a
preprogrammed data structure for controlling and monitoring the motion.
There are four different ways of monitoring motions in S7 PDIAG, each of which
monitors specific parameters:
• Action monitoring
• Reaction monitoring
• Interlock monitoring
• Startup monitoring
Online / Offline
When online, a data link between the programming device and the programmable
logic controller exists; when offline, no connection exists.
Position Flag
This is defined as “Position_Flag(n)” when using the UDT_Motion (see network 6
in Appendix A.6).
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 Glossary-7
Glossary
ProAgent
ProAgent is an optional package in ProTool and also a configuration software
package for your display device (OP).
Project
A project is a container for all objects in an automation solution, independent of the
number of stations, modules, and how they are connected in a network.
ProTool
ProTool is the configuration software for your display device (OP).
Reaction Monitoring
Reaction monitoring is one of the four types of motion monitoring. With reaction
monitoring, you monitor whether a final position which has been reached remains
stable after a specified period of time (reaction time) has expired.
Reaction Time
The reaction time is the time by which the target final position must have been
reached and stabilized.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
Glossary-8 A5E00063001-01
Glossary
S7 Graph
The S7 Graph programming language extends the functional scope of STEP 7 to
include a graphical means of programming sequential control systems. S7 Graph
is an optional package for STEP 7.
S7 HiGraph
The S7 HiGraph programming language for S7-300/400 devices extends the
functional scope of STEP 7 to include a state graph programming system.
S7 HiGraph is a programming tool for creating control programs on the basis of
state graphs and is an optional package for STEP 7.
S7 PDIAG
Using the S7 PDIAG optional package, you can configure monitoring definitions
which monitor your process for specific errors. You may configure these errors
while you are creating your user program. The following types of monitoring are
available: address monitoring, general monitoring, and motion monitoring.
S7 Program
An S7 program is a container for blocks, source files, and charts for S7
programmable modules which also contains the symbol table.
SIMATIC Manager
The SIMATIC Manager is the graphic user interface for SIMATIC users under
Windows 95.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 Glossary-9
Glossary
Standard Group
The standard group is created by default. From the standard group you can move
units to other groups defined by you (max. of 15).
If a group created by you is deleted, the units contained in it are reintegrated
automatically into the standard group.
Startup Monitoring
Startup monitoring is one of the four types of motion monitoring. With startup
monitoring, you monitor whether the current final position (actual final position) is
left following a machine operation (trigger) within a specified period of time (startup
time).
Startup Time
The startup time is the time within which a motion must have started.
Syntax Check
In incremental input mode for STEP 7 programs, a syntax check is run after each
line has been completed. This means that the software checks whether, for
example, a STEP 7 statement has been entered correctly. In free-edit mode, the
syntax check is run during compilation.
System Data
“System Data” is an object containing the configuration data and parameters of a
station.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
Glossary-10 A5E00063001-01
Glossary
Trigger
The trigger starts the motion. It is defined as “Control1/Control2” when using the
UDT_Motion.
UDTs in S7 PDIAG
The user-defined data types supplied with S7 PDIAG can be saved as blocks. In
this way, you can re-use any UDT which you have created many times:
• As a normal data type, or
• As a template for creating blocks with the same data structure.
The following UDTs are available in S7 PDIAG:
• The UDT_Unit
• The UDT_S_Unit
• The UDT_Motion
UDT_Unit
The UDT_Unit incorporates the information required in order for the display device
(operator panel) to assign an alarm message to the faulty program location.
The UDT_Unit contains the following:
• Group error detection and group error acknowledgement
• 16 operating modes, of which two are predefined as “manual operation” and
“automatic operation.” You can define the remaining 14 operating modes
according to your own individual requirements.
UDT_Motion
The UDT_Motion represents a standardized interface between S7 PDIAG and the
display devices (operator panels) and contains all the parameters for the following:
• For displaying motions in motion screens on the display device without the need
for additional configuration, and
• For manually moving these motions in the motion screen on the display device.
Note: The requirement for this is that you use the Ladder networks for motion
programming supplied in FB100 of the sample project “S7_DIAG”.
UDT_S_Unit
The UDT_S_Unit contains the group error address and the group error
acknowedgement. This saves memory space and means that the program no
longer has to run through the operating mode of the process unit in all subunits.
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 Glossary-11
Glossary
Unit
Units structure the process view according to components which are related to one
another by their technical function. If you have set up your project so that each
block relates to a physical object in the process (for example, a press, a punch, or
a safety guard), the units represent an image of your process. A unit exists for
each block in your program which can be diagnosed.
Units can also save data common to all other units, motions, and function blocks
which lie below them in the hierarchy.
A unit may contain error definitions, motions, and other subunits.
Using units, you can combine both individual errors and motions into a
technological unit. This enables you to find process errors quickly and easily.
Units are represented with other objects in a tree structure in the unit overview.
Units for a data block, function, or organization block are also visible in the unit
overview on the display devices.
User Block
The user block is a function block with a predefined interface which is supplied with
S7 PDIAG. This block enables you to react to specific errors in your user program
without substantial programming being necessary. It is called with different
parameters, depending on whether the error is incoming or outgoing. For example,
it provides you with information on the unit, the priority, and the message number
of the error.
User-Defined Templates
As well as the predefined monitoring definitions supplied with S7 PDIAG, you can
also create your own templates for specific monitoring definitions. Using templates
makes configuring much easier and involves less time and effort. You can also
store incomplete monitoring logic in your own templates.
Note that you can only store a message template within a template. This is why no
message number is assigned in a template. However, you can still configure the
message text for your monitoring definition in the template.
User Program
The user program contains all the statements and declarations and the data
required for signal processing to control a plant or a process. The program is linked
to a programmable module (for example, CPU, FM) and can be structured in the
form of smaller units (blocks in S7 and tasks in M7).
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
Glossary-12 A5E00063001-01
Glossary
Variable
A variable defines an item of data with variable content which can be used in the
STEP 7 user program. A variable consists of an address (for example, M3.1) and a
data type (for example, BOOL), and can be identified by means of a symbolic
name (for example, BELT_ON).
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 Glossary-13
Glossary
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
Glossary-14 A5E00063001-01
Index
A Configuring general monitoring
overview, 5-1
Action monitoring
procedure, 5-5
error messages, 6-7
Configuring motion monitoring
example, 6-7
overview, 6-1
monitoring logic, 6-7
procedure, 6-13
Adding a call for monitoring blocks, 7-9
Creating instance data blocks, procedure, 7-4
Address monitoring, 1-7
Criteria analysis in S7 PDIAG, definition, 1-8
as edge monitoring, 4-4
as level monitoring, 4-3
assigning a system attribute to a block,
A-24 D
entering message texts, 4-9 Data structure of the UDT_Motion, A-9
error state, 4-4 Data structure of the UDT_S_Unit, A-8
introduction, 4-2 Data structure of the UDT_Unit, A-5
selecting a block and enabling it to contain Defining exclusion addresses, 9-8
diagnostic data, A-24 Definition
Selecting initial diagnostic addresses in the motions, 1-12, Glossary-6
symbol table, 4-10, 5-9, 6-17 process diagnostics with S7 PDIAG, 1-7
selecting the initial diagnostic address in S7 UDT, A-2
PDIAG, 4-10 UDT_Motion, A-3
selecting the initial diagnostic address in the UDT_S_Unit, A-3
Editor, 4-7 UDT_Unit, A-2
Advanced programming with S7 PDIAG, 9-1 units, 1-11, Glossary-12
Advantages of S7 PDIAG, 1-16 Description, Ladder networks for motion
Authorization for S7 PDIAG, 2-4 programming, A-13
Auxiliary networks in S7 PDIAG, A-4 Diagnostic data, printing and exporting,
overview, 8-1
Differences, between S7 PDIAG and S7 Graph
C / S7 HiGraph, 1-15
Displaying error messages on the OP, 1-6
Configuration steps in creating address
Downloading monitoring blocks, 3-9, 7-9
monitoring, overview, 4-5
Configuration steps in creating general
monitoring, overview, 5-4
Configuration steps in creating motion E
monitoring, overview, 6-12 Edge monitoring, 4-4
Configuring Entering formal addresses, in address
address monitoring, 4-1 monitoring, 4-9
general monitoring, 5-1 Entering message texts
motion monitoring, 6-1 in address monitoring, 4-9
Configuring address monitoring in general monitoring, 5-8
overview, 4-1 in motion monitoring, 6-16
procedure, 4-6
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 Index-1
Index
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
Index-2 A5E00063001-01
Index
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 Index-3
Index
P S
Performance range of S7 PDIAG, 1-7 S7 PDIAG
Printing and exporting diagnostic data, 8-1 advantages, 1-16
Printing data created with S7 PDIAG, 1-15, 8-2 auxiliary networks, A-4
Procedure creating user–defined templates, 9-2
activating the check box, A-24 enabling blocks to contain diagnostic data,
for configuring address monitoring, 4-6 A-23
for configuring general monitoring, 5-5 error definitions, 1-7
for configuring motion monitoring, 6-13 error messages, 1-8
for generating and downloading monitoring exporting, 8-3
blocks, 7-2 getting started with S7 PDIAG, 3-1
when installing S7 PDIAG, 2-5 group error bit ID, A-3
Process diagnostics with S7 PDIAG, definition, how S7 PDIAG differs from S7 Graph and
1-7 S7 HiGraph, 1-15
Processing priorities of qualifiers, B-13 initial value acquisition, 1-8
Programming notes installing, 2-1, 2-5
definition of a UDT, A-2 installing the software, 2-5
introduction, A-2, A-23 introduction, 1-1
program-oriented work, A-23 language elements, B-1
run sequence, A-23 modifying times online / offline, 9-6
using auxiliary networks, A-23 monitoring types, 1-7
objects, 1-11
offline functions, 1-18
R online functions, 1-19
overview of the configuration steps, 1-18
Reaction monitoring
overview of working with the software, 1-17
error messages, 6-8
performance range, 1-7
example, 6-8
printing, 8-2
monitoring logic, 6-8
programming notes, A-1
Requirements for use, 2-2
required memory capacity, 2-2
starting the installation program, 2-5
tips and tricks, D-1
troubleshooting on the OP, 1-6
using monitoring types, C-1
S7-PDIAG, Obligation to acknowledge
messages, 1-9
Selecting the initial diagnostic address in S7
PDIAG
in address monitoring, 4-10
in general monitoring, 5-9
in motion monitoring, 6-17
Selecting the initial diagnostic address in the
Editor
in address monitoring, 4-7
in general monitoring, 5-6
in motion monitoring, 6-13
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
Index-4 A5E00063001-01
Index
T W
Templates, creating user–defined, 9-2 Working with formal addresses, 9-10
Troubleshooting on the OP, 6-3
U
UDT
use, A-2
UDT_Motion
data structure, A-9
definition, A-3
use, A-9
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
A5E00063001-01 Index-5
Index
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
Index-6 A5E00063001-01
Siemens AG
A&D AS E 81
Oestliche Rheinbrueckenstr. 50
D-76181 Karlsruhe
Federal Republic of Germany
From:
Your Name: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
Your Title: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
Company Name: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
Street: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
City, Zip Code _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
Country: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
Phone: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
Automotive Pharmaceutical
Chemical Plastic
Electrical Machinery Pulp and Paper
Food Textiles
Instrument and Control Transportation
Nonelectrical Machinery Other _ _ _ _ _ _ _ _ _ _ _
Petrochemical
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
1
A5E00063001-01
Remarks Form
Your comments and recommendations will help us to improve the quality and usefulness of our
publications. Please take the first available opportunity to fill out this questionnaire and return it
to Siemens.
Please give each of the following questions your own personal mark within the range from 1 (very
good) to 5 (poor).
Additional comments:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
S7 PDIAG for S7-300 and S7-400 Configuring Process Diagnostics for LAD, STL, and FBD
2 A5E00063001-01