You are on page 1of 46

Contents

Page

System Diagnostics - Overview


......................................................................................................
2
Searching for Errors, that Cause the CPU to go into Stop
............................................................. 3-13
Logical Errors
................................................................................................................................. 14-27
Sporadic Errors
........................................................................................................................... 28-38
System Information
........................................................................................................................ 39-46

Training Center
for Automation and Drives

Page 1

ST-7PRO1
Troubleshooting

What is Diagnostics? Diagnostics is the integral detecting functions and recording functions of the CPU.
Th area iin which
The
hi h th
the error iinformation
f
ti iis recorded
d d iis called
ll d th
the di
diagnostic
ti b
buffer.
ff
The size of this buffer depends on the type of CPU (e.g. CPU 314 = 100
messages).
What Happens, when When an error or an event, for example a change of operating mode, occurs, the
an Error Occurs?
following happens:
A message stamped with the date and time is entered in the diagnostic
buffer. The most recent message is stored at the beginning of the buffer. If
the memory is full
full, older entries are deleted
deleted.
Entry of the event in the system status list.
If necessary, the event activates a relevant error OB (Organization block).
Types of Errors

With the help of the CPU diagnostics, the following types of errors can be identified:
System error in the CPU or error in a module
Program errors in the CPU.

Troubleshooting

In troubleshooting, a distinction is made between the following error classes:


Errors, that cause the CPU to go into the Stop mode.
Troubleshooting with the "Module Information" tool.
Logical errors, that is, the CPU executes the program, but the function is not
fulfilled.
Troubleshooting with the "Referece Data" and "Program Status" tools.
Sporadic errors, that only occur in particular system states. These can
either cause the CPU to go into Stop or occur as a logical error.
T bl h ti with
Troubleshooting
ith the
th "CPU M
Messages"" ttooll or b
by creating
ti ""your own
trigger point".

Training Center
for Automation and Drives

Page 2

ST-7PRO1
Troubleshooting

Contents

Page

Calling the "Module Information" Tool


...................................................................................
Module Information Tab: "Diagnostic Buffer"
.................................................................................
Interpreting Error Messages
..........................................................................................................
Opening a Block Containing an Error
.............................................................................................. 7
Diagnostics with I Stack, B Stack, L Stack
......................................................................................
B Stack
.............................................................................................................................................
I Stack
.............................................................................................................................................
L Stack
.............................................................................................................................................
Exercise: Finding Stop Errors and Eliminating Them
.................................................................
Exercise: Troubleshooting with I Stack, B Stack
..............................................................................

Training Center
for Automation and Drives

Page 3

4
5
6
8
9
10
11
12
13

ST-7PRO1
Troubleshooting

Introduction

The information that you need for troubleshooting is stored in all tools in the function
PLC ->
> Module
M d l IInformation.
f
ti
Y can open this
You
thi ffunction,
ti
for
f example,
l from
f
the
th
SIMATIC Manager or through the Program Editor.

SIMATIC Manager

If the project structure is not available on the PG, you click on the "Accessible
Nodes" icon and then on MPI=x (x = MPI address on the connected CPU).
Now select the menu options PLC -> Module Information.
If you have opened a project on the hard disk with the SIMATIC Manager, you can
select the menu options PLC -> Module Information after you have chosen the S7
program.

Program Editor

As soon as you open a block, the information function for troubleshooting appears.

Training Center
for Automation and Drives

Page 4

ST-7PRO1
Troubleshooting

Diagnostic Buffer

The diagnostic buffer is is a FIFO buffer in a battery-backed memory area in the


CPU th
thatt cannott even b
be d
deleted
l t db
by a memory reset.
t It contains
t i allll di
diagnostic
ti
events in the order in which they occurred.
All events can be displayed on the programming device in plain text and in the
sequence in which they occur.

Details on Event

When you select an event, additional information is supplied in the "Details on


Event" box:
Event ID and event number,
additional information, depending on the event, such as the address of the
instruction that caused the event,
etc.

Help on Event

When you click on the


box, help on the event selected in the list is
opened.
(Example: a programming error has occured, the relevant OB (OB121) is not loaded
or activated, however.)

Open Block

When you click on the


box, the block in which the error occurred
can be opened in the CPU.
(in the above example: "FC number: 10").

Opening the Tool

You open the diagnostic buffer by selecting the menu options PLC --> Module
Information --> Diagnostic Buffer tab in the SIMATIC Manager or Program Editor.

Training Center
for Automation and Drives

Page 5

ST-7PRO1
Troubleshooting

General
Interpreting Errors

The last entry appears at the top of the list. The time shows you which error
messages belong
b l
ttogether
th ((eventt no. 1 and
d 2 iin th
the slide).
lid )
In our example, a complete restart was performed before the error occurred (event no.
3 to 5). After the restart, the error occurred and caused entries no. 1 and 2.
Event no. 1:
The CPU went into Stop mode because no error OB was
programmed. The "Details on event" box shows the execution
level (priority class), e.g. OB1 (cycle) and the location of the error
in the program (FC 10, module address 24).
Event no. 2:
The actual cause of the error appears here, e.g. BCD conversion
error. The "Details on event" box shows that there is an incorrect
value
l iin accumulator
l t 1 and
d which
hi h error OB iis responsible
ibl ffor it
(OB 121).

Error OBs

Training Center
for Automation and Drives

Type of error

Example

Error OB

Programming Error

Called block not in the CPU

OB 121

Access Error

Direct access to module that is either


faulty or not present

OB 122

Time error

Maximum scan cycle time exceeded

OB 80

Power supply fault

Backup battery failure

OB 81

Diagnostic interrupt

Wire break at input of diagnostics-capable


module

OB 82

CPU hardware fault

Incorrect signal level at the MPI interface

OB 84

Program execution error

Error in updating the process image (module


faulty)

OB 85

Rack failure

Distributed rack or DP Slave failure

OB 86

Communication error

Incorrect frame ID

OB 87

Page 6

1) only for
S7-400

1)

ST-7PRO1
Troubleshooting

Opening a Block

You can open the block containing the error directly by clicking the "Open Block"
b tt
button.
The
Th block
bl k iis opened
d online.
li
IIn STL
STL, th
the cursor iis positioned
iti
d iin ffrontt off th
the
instruction where the error occurred. In LAD/FBD, the network containing the error
is displayed.
In our example, we tried to convert the value from the pushwheel buttons from BCD
to Integer. An invalid BCD number was presumably in accumulator 1. In this case,
reading out the I stack (see following pages) will help you to make a more exact
error analysis.
The error occurred in FC 10
10, Network 3
3.

Training Center
for Automation and Drives

Page 7

ST-7PRO1
Troubleshooting

Introduction

To obtain additional information about the error location, you can read out the stack
contents
t t (I St
Stack,
k B St
Stack,
k L Stack).
St k) This
Thi enables
bl you tto d
determine,
t
i
ffor example,
l
which values were stored in the accumulators before the CPU went into the Stop
state.

B Stack

The B Stack contains a list of all blocks executed up to the transition to the Stop
state.

I Stack

The I Stack contains the data of the registers at the interrupt location, such as:

L Stack

Training Center
for Automation and Drives

contents of the accumulators and address registers


which data blocks are open
status word contents
program execution level (e.g. cycle)
interrupted block specifying the network and instruction number
next block to be executed

The L Stack contains the values of the temporary variables of the blocks. You need
some experience
p
to evaluate this data.

Page 8

ST-7PRO1
Troubleshooting

Stacks

In order to display the stack information, the CPU must have gone into the STOP
mode:
d
because of a program error
because of a STOP instruction
on reaching a breakpoint.

B Stack

The block stack (B Stack) is a graphic representation of the call hierarchy, that is,
the sequence and nesting of the called blocks up to the interrupt location.
The B Stack contains all interrupts
p through
g interrupt
p OBs and error OBs as well as
the open DBs.
You will find the direct cause of the STOP mode in the block that is displayed last.
In our example, you can see that the error occurred in the first call of the FC 10
block.

Open Block

Training Center
for Automation and Drives

To open a block online, you select the block in the B Stack list and then click on the
"Open Block" button. You can then edit this block. The cursor is located after the
faulty instruction (at the beginning of the next instruction)
instruction).

Page 9

ST-7PRO1
Troubleshooting

I Stack
Register

The interrupt stack (I Stack) always refers to an execution level. Before you can
open the
th I Stack,
St k the
th organization
i ti block
bl k concerned
d mustt b
be selected
l t d iin th
the B St
Stack.
k
The contents of all relevant registers at the time of the interruption are displayed in
the I Stack screen:
Accumulators
You can select the numbers format for displaying the accumulator contents
in the "Display format" list.
Address register
You can select the numbers format for displaying the address register
contents in the "Display
Display format"
format list.
list
Status word
Bits 0 to 8 of the status word are displayed. They are identified with
abbreviations according to their meaning.

Point of Interruption

Error Example

Training Center
for Automation and Drives

The "Point of Interruption" field gives you information about:


the interrupted block, with the option of opening it directly (the cursor is then
located directly in front of the faulty instruction),
the priority class of the OB,
OB whose execution level was interrupted,
interrupted
open data blocks with their number and size.

From our example, you can see that the hexadecimal number 0000 000F is stored
in accumulator 1. This is not a valid BCD number and for this reason a conversion
error occurred during the conversion from BCD to Integer (BTI instruction).
This error can occur during the switching of the pushwheel button due to the
mechanical contacts. To remedy this, confirm the input by pressing a momentarycontact switch before carrying out the conversion.

Page 10

ST-7PRO1
Troubleshooting

L Stack

The current values of the temporary variables for blocks not ended at the time of
i t
interruption
ti are contained
t i d iin th
the L St
Stack.
k
The local data displayed in the L Stack window refer to the block selected in the
B Stack.
The blocks not yet ended when the CPU switched to the STOP mode are listed in
the block stack (B Stack).

Error Example

In our example, the two temporary variables, variable1 and variable2 are defined in
the FC 10 block.
The declaration table of the FC 10 block shows the relative address in the L Stack in
the address column. The variable, variable1 is stored in byte 0 and 1 of the L Stack
and the variable, variable2 in byte 2 and 3.
Thus the variable variable1 contains the value 78H, which corresponds to the
Integer number 120. The variable was described in the program with the
instructions L 120, T variable1 .
The variable, variable2 has the value 08H and this is the result of the last error-free
conversion from BCD to Integer.
In the following picture, you can see the relevant program section of the FC 10
block:

Training Center
for Automation and Drives

Page 11

ST-7PRO1
Troubleshooting

Goal

Troubleshooting a faulty program.

What to Do

1. Carry out a CPU memory reset.


2. Copy the S7 program "ERROR" from the project "ERROR_16" or
"ERROR_32" into the HW station "My Station".
3. Download all the blocks from the S7 program "ERROR" from the project "My
Project" into the CPU.
4. Perform a complete restart.
5. Read out the diagnostic buffer by selecting PLC -> Module Information.
You must select the project "My Project" and the S7 program "ERROR", so
that the correct comments are displayed.
6. Determine the errors and eliminate them.

Result

Training Center
for Automation and Drives

You are now familiar with the diagnostic facilities for troubleshooting. The CPU
executes the program, but the function is not yet fulfilled. The logical errors are
eliminated in a later exercise.

Page 12

ST-7PRO1
Troubleshooting

Task

You are to determine additional error information by reading out the Stacks.

What to Do

Carry out the steps in the slide above and answer the following questions:
Questions

Error 1

Error 2

Error 3

In which block and at which


instruction did the error
occur?
What is the cause of the error?
Which blocks were executed
up to the error?
Which values were in the
accumulators at the error
location?
Why did the error occur?
Which data blocks were
open?

Training Center
for Automation and Drives

Page 13

ST-7PRO1
Troubleshooting

Contents
e

Pag

Displaying Reference Data


...............................................................................................................
Filtering Reference Data
...................................................................................................................
Cross References
............................................................................................................................
Filtering Cross References
..............................................................................................................
Reference Data: Find
.......................................................................................................................
Block Correction using
g Cross References
........................................................................................
Go to Location
..................................................................................................................
Assignment of I,Q,M,T,C ................................................................................................................... 22
Unused Symbols / Addresses without Symbols
..........................................................................
Program Structure
.............................................................................................................................
Comparing Blocks (1)
.........................................................................................................................
Comparing Blocks (2)
... ..................................................................................................................
26
Exercise: Eliminating Logical Program Errors
..................................................................................

Training Center
for Automation and Drives

Page 14

15
16
17
18
19
20
21
23
24
25

27

ST-7PRO1
Troubleshooting

Introduction

For logical errors, you use the "Program Status" and "Reference Data" tools
i t
intensively.
i l IIn th
the P
Program St
Status
t you have,
h
for
f example,
l recognized
i d th
thatt a bit
memory is not fulfilled as a condition. Using the Reference Data, you can determine
where this bit memory is created.
A frequent cause of errors is the multiple assignment of addresses. This means that
an address is assigned from several locations in the program. Such errors are easy
to find when you use the "Reference Data" tool.

Reference Data

The Display Reference Data is triggered in the SIMATIC Manager (with the "Blocks"
folder opened offline) by selecting the menu options Options -> Reference Data ->
Di l or ->Filter.
Display
>Filt
.

Filter

The reference data are displayed as filtered data (regardless of whether the item
Display or Filter was selected in the menu Options.
The narrower you define the filter, the faster the reference data is displayed.
When you open the Display Reference Data, a message pops up that filtered data
will be displayed. For this reason, check how the filter is currently set.

Lists

The Reference Data can be found in 6 different lists:

Training Center
for Automation and Drives

Cross References
Assignment of I/Q/M
A i
Assignment
t off T/C
(User) Program Structure
Unused Symbols
Addresses without Symbols

Page 15

ST-7PRO1
Troubleshooting

Filter

You can open the window for filtering the reference data two different ways:
1. In the SIMATIC Manager by selecting the menu options Options ->
Reference Data -> Filter.
2. In the SIMATIC Manager by selecting the menu options Options ->
Reference Data -> Display and in the "Display Reference Data" window
selecting the menu options View -> Filter or by clicking on the
Filter icon

"C t i " Wi
"Customize"
Window
d
After you open the
Aft
th tool,
t l the
th "Customize"
"C t i " window
i d
appears.
In it, you can select which of the 6 reference data lists are to be opened first.

Training Center
for Automation and Drives

Page 16

ST-7PRO1
Troubleshooting

Cross References

You open the cross references in the "Display Reference Data" window by selecting
th menu options
the
ti
Vi
View
->
> Cross
C
R
References
f
or by
b clicking
li ki on th
the relevant
l
t iicon.
The Cross References is a list of used addresses pertaining to a user program:
- inputs,
- outputs,
- bit memories,
- counters,
- timers, etc.(see next page)

Table

The cross references list is structured as a table. It has the following


g columns:
Column
Contents / Meaning
----------------------------------------------------------------------------------------------------- Address
absolute address of the operand(address)
Symbol
symbolic name of the address
Block
blocks in which the address is used
Type
read-only (R) or write-only (W) access
Language
programming language in which the block was created
Details
instruction with which the address is addressed

Cross Reference
for Address

Training Center
for Automation and Drives

--

When you select an address in the cross references list, you can open a new
window by selecting the menu options View -> Cross Reference for Address. This
window contains only the cross references for the selected address.

Page 17

ST-7PRO1
Troubleshooting

Addresses

You determine which type of address is to be listed by activating the appropriate


checkbox.
h kb

Filter Area

The filter area establishes the address area to be displayed. You can also enter
several part areas.
The filter area entry "10-50; 70; 100-130" means that the address 70 and the
address areas from 10 to 50 and from 100 to 130 are to be displayed.

Access Type

In the standard setting, all access types are displayed. You can also choose the
option
p
"Selected" and then select the access type,
yp for example,
p W, write-onlyy
access, with the checkboxes.

Columns

You determine the number and the contents of the columns for the tabular structure
of the cross references list using check boxes.

Standard

If the settings you have planned are to be accepted for the next start of the
application "Display Reference Data", you must activate the checkbox
"Save as standard".
The basic setting or what you have saved as standard are reproduced using the
"Default" button.

Training Center
for Automation and Drives

Page 18

ST-7PRO1
Troubleshooting

Find

While reference data are displayed, you can start a search for a character string.
Th window
The
i d
can b
be ffound
d iin one off th
the ffollowing
ll i views:
i
Cross References
Assignment
Unused Symbols
Addresses without Symbols.

Note

The search is a pure text search, that is, the entries must be "exact - including every
dot, dash and space"
dot
space .
Additional settings are:
search for address, symbol, block or language,
the character string entered as search term is a whole word or part of a
word,
capital/small letters are to be taken into account or ignored,
the search range and the direction of the search can be specified.

Training Center
for Automation and Drives

Page 19

ST-7PRO1
Troubleshooting

What to Do

With a double-click on an address in the cross references list, you open the
LAD/FBD/STL Editor
Edit and
d display
di l the
th block
bl k where
h
the
th selected
l t d address
dd
iis used.
d Th
The
cursor is located in the network in which the address is used.

Note

Please note that the reference data are only formed from the blocks in the offline
data management. For that reason, modified blocks are always to be saved.

Training Center
for Automation and Drives

Page 20

ST-7PRO1
Troubleshooting

Introduction

In troubleshooting, it is often only necessary to determine where one address is


used
d or assigned
i
d iin th
the program. In
I this
thi case, it makes
k more sense tto use th
the "G
"Go
to Location" function instead of the cross references list. The Go to Location is
called directly from the Program Editor and gives you an excerpt from the cross
references list for the specific address.

Handling

Select an address in the Program Editor and click on it with the right mouse button.
Then choose the menu option Go to Location.
In the "Go to Location" window, all program locations are displayed where this
address is used in the program. In the "Details" column, you can see whether the
address
dd
iis queried
i d or assigned.
i
d IIn th
the example,
l th
the program llocation
ti where
h
th
the
output Q 8.2 is set and reset is of interest. After selecting the relevant line, you can
jump to this program location by selecting the "Go To" button. By selecting the
"Starting Point" button, you return to the starting point.

Access Type

By default, all accesses to the address are displayed. By selecting the "Selected"
button, you can, for example, display write-only accesses (assignment, set, reset).
With the "Overlapping access to memory areas" option, word-by-word accesses to
the address are displayed as well, for example.

Training Center
for Automation and Drives

Page 21

ST-7PRO1
Troubleshooting

Assignment I/Q/M

You open the Assignment of I/Q/M by selecting the menu options View ->
A i
Assignment
t ->
> Inputs,
I
t Outputs
O t t and
d Bit Memory
M
or by
b clicking
li ki on th
the relevant
l
t iicon.
This assignment list gives you an overview of which bit is used in which byte of the
memory areas input (I), output (Q) and bit memory (M).
Every line contains a byte of the memory area, in which the eight bits are identified
according to access. You can also see whether the access is byte-oriented, wordoriented or doubleword-oriented.
Meanings of the IDs in the Assignment List I/Q/M:

- the address is not addressed and therefore still free


o bit-oriented access
x byte-, word- or doubleword-oriented access

Assignment T/C

You open the Assignment of T/C by selecting the menu options View ->
Assignment -> Timers and Counter or by clicking on the relevant icon.
This assignment list gives you an overview of which timers and counters are used in
the program.
Ten timers or counters are displayed in every line.

Filter

By selecting "Filter", you can choose the memory areas to be listed and restrict the
individual address areas.
The same rules as for filtering in the Cross References list apply.

Training Center
for Automation and Drives

Page 22

ST-7PRO1
Troubleshooting

Unused Symbols

When you select the menu options View -> Unused Symbols or click on the
relevant
l
t icon,
i
a lilistt off addresses
dd
appears. Th
These addresses
dd
are d
defined
fi d iin th
the
symbol table but are not used in the S7 user program.

Addresses
without Symbols

When you select the menu options View -> Addresses without Symbols or click
on the relevant icon, a list of addresses appears. These addresses have been used
in the S7 user programm but are not defined in the symbol table.
A line consists of the address and the number of times it was used.

Filt
Filter

You use "Filt


Y
"Filter"" tto make
k selections
l ti
off detailed
d t il d iinformation
f
ti ffor th
the di
display
l off unused
d
symbols (see slide).

Training Center
for Automation and Drives

Page 23

ST-7PRO1
Troubleshooting

Program Structure

The program structure describes the call hierarchy of the blocks in an S7 user
program.

Filter

Depending on the settings of the filter, the program paths are displayed in a Tree
structure (see slide) or as "Parent/child structure" (in each case the calling and the
called block are displayed).

Symbols
< maximum : nnn >

The following symbols are only possible in the tree structure display:
the maximum memory requirement (in bytes) of the local data is given in the
roott off the
th tree
t
structure.
t t
per path, the maximum memory requirement (in bytes) of the local data is
stated at the last block of every program path.

[ nnn ]

Training Center
for Automation and Drives

Page 24

ST-7PRO1
Troubleshooting

Introduction

You can compare blocks between online and offline data management or between
t
two
user programs on the
th hard
h d di
disk
k off th
the PG
PG.
With this function, you can determine whether, for example, program corrections
were made in the CPU later on and in which network the blocks differ.

What to Do

With the right mouse button, select the block folder of an S7 program.
Select the menu option Compare Blocks.
Choose whether you want to compare online/offline or between 2 offline
programs and acknowledge with the "OK" button.
I the
In
th follow-up
f ll
screen, the
th blocks
bl k th
thatt diff
differ are lilisted.
t d
Select the line in which a difference was determined and then select the
"Details" button.
In the "Compare Blocks - Details" window you can ascertain when the block
was modified and if the block length was changed.
After selecting the "Go To..." button, the differing block, for example, is
opened online and offline in two windows and the network, in which the first
difference was determined is displayed.
Note: Program corrections can only be made in the offline window.

Training Center
for Automation and Drives

Page 25

ST-7PRO1
Troubleshooting

Differences

After selecting the "Go To..." button (see previous page), the Program Editor is
opened
d with
ith ttwo windows
i d
side-by-side,
id b id iin which
hi h th
the network
t
k with
ith th
the fifirstt diff
difference
is displayed.

Example

In the above example, M8.5 is used in the offline block and M8.6 is used in the
online block as the auxiliary memory marker for the RLO edge detection of I 8.5.
That means, that after the block was downloaded into the CPU, a correction was
made either to the offline or to the online block.
You can identify which of the two blocks was modified last by reading out the the
time stamp
p in the "Compare
p
Blocks - Results" screen ((see previous
p
p
page).
g )

Training Center
for Automation and Drives

Page 26

ST-7PRO1
Troubleshooting

Goal

So far you have corrected all the errors which caused the CPU to go into the Stop
mode.
d
Now you are to check the function of the bottling plant and eliminate any remaining
logical errors. You are to use the checklist in the slide to do so.
The functioning of the plant corresponds to the program which you yourself have
created up until now.

What to Do

Check the functions of the bottling plant according to the checklist and eliminate the
remaining errors. Use the program for troubleshooting (Errors that lead to the Stop
mode), which can still be found in the CPU and eliminate the errors.

Result

The bottling plant is fully functional.

Training Center
for Automation and Drives

Page 27

ST-7PRO1
Troubleshooting

Contents
e

Pag

Displaying CPU Messages


............................................................................................................
Writing User Messages in the Diagnostics Buffer
.........................................................................
Configuring Your Own Message Texts
............................................................................................
Calling the SFC 52 Block
.................................................................................................................
Structure of the EVENTN Parameter of the SFC 52 Block
..............................................................
Diagnostics-Capable
g
p
Modules
.........................................................................................................

29
30
31
32
33
34

Displaying the Hardware Diagnostics in the SIMATIC Manager


.............................................. 35
Exercise: Enabling Diagnostic Messages
........................................................................................ 36
Exercise: Outputting User Messages
............................................................................................. 37
Exercise: Enabling Diagnostic Interrupts and Simulating Hardware Faults
.................................. 38

Training Center
for Automation and Drives

Page 28

ST-7PRO1
Troubleshooting

CPU Messages

With this function you can immediately display an error message for sporadic errors in
th system
the
t
on a programming
i device
d i or an HMI d
device.
i
A message window
i d
pops up
on the PG or OP as soon as the connected CPU goes into Stop because of an error
(see bottom left of the slide).
User messages can also be output with a system function.

Registered Modules

The list contains all CPUs called in the SIMATIC Manager with the menu options
PLC -> CPU Messages. The list is divided into four columns:
1. In the first column, an icon displays whether a connection was interrupted by
the external partner.
p
2. In the column "W", system diagnostic and user diagnostic messages are
activated /deactivated.
3. In the column "A", interrupt messages are activated / deactivated.
The "CPU Messages" application checks if the module in question even
supports diagnostic and interrupt messages. If this is not the case, a message
is output.
4. In the column "Module", the name of the module or the path of the S7 program
is entered.

Incoming Messages

Archive

Training Center
for Automation and Drives

Top: As soon as a message is received, the "CPU Messages" window pops up


on top, the message is displayed and at the same time it is entered in the
message archive.
Background: The receiving of the messages takes place in the background.
Messages are displayed in the window, but the window remains in the
background. The messages are archived and can be displayed as required.
Ignore: Messages are neither displayed nor archived.

You can modify the size of the archive (40 to 2000 messages) or empty the archive by
selecting the "Archive" button.

Page 29

ST-7PRO1
Troubleshooting

Introduction

The FC 52 system function permits you to write your own messages, for example,
l
lower
lilimitit ffor h
hydraulic
d li pressure violated,
i l t d iin th
the di
diagnostic
ti b
buffer.
ff P
Parallel
ll l tto thi
this,
the message can also be displayed on the programming device or OP. The
diagnostics messages must be enabled for this purpose.

Program

The SFC 52 system function is called and assigned parameters in the user
program. Certain standard texts are stored in the CPU. A parameter of SFC selects
these texts. You will find more information in the Standard and System Functions
manual, or in the Online Help.

Example

SFC 52 is called in the program example, if the analog value of peripheral input
word 352 exceeds the value of 2000 units. The message is output only once as a
result of logic edge detection. The block is assigned parameters in such a way that
a diagnostic message is also output on the PG (SEND = TRUE). The EVENTN
parameter determines the text to be output.
L PIW 352
L 2000
>I
FP M 30.1
30 1
JCN
none
call SFC 52
SEND: TRUE
EVENTN: W#16#9B83
INFO1: MW 100
INFO2: MD 102
RETVAL: MW 31
none: BE

Training Center
for Automation and Drives

// Read in analog value


// analog value >2000
// RLO edge
d d
detection
t ti
// User entry in the diagnostic buffer
// external, incoming, limit value exceeded
// Additional information 1
// Additional information 2
// Return value with error information

Page 30

ST-7PRO1
Troubleshooting

Aufruf

With the right mouse button, click on an S7 program and select the menu options
S
Special
i l Obj
Objectt P
Properties
ti ->
> Message.
M

Configuring Message You begin with the "New Message" button. The next free message number, for
example, A003 is suggested.
In the "Text" tab, you can enter the message text for incoming and outgoing
messages.
You can change the message number in the "Identification" tab.
Wildcards

Up
p to two wildcards can be inserted in the message
g text. These values are p
passed
via the parameter "INFO1/INFO2" of the SFC 52.
In the example, the value of INFO 2 is output as a real number.
To insert a wildcard, you begin with the @ character. This is followed by 1 or 2,
depending on whether you want to display the value from INFO1 or INFO2. The
format declaration then follows with, for example, %e.
The following format declarations are possible:

Training Center
for Automation and Drives

%ix hexadecimal number with i places


%i
%iu
unsigned
i
dd
decimal
i l number
b with
ith i places
l
%id signed decimal number with i places
%e
normalized floating-point number, signed value of the form
%E normalized floating-point number, as for format %e, but an upper-case
letter stands before the exponent (E instead of e)

Page 31

ST-7PRO1
Troubleshooting

Introduction

In the slide you can see a program example, in which a user message is entered in
th diagnostic
the
di
ti b
buffer
ff and
d iis di
displayed
l
d th
through
h th
the CPU messages.

Description

The SFC 52 block is called conditionally through the input "EN" if the analog value
exceeds the limit value of 5000.
The "SEND" input has the signal state "1" and as a result, the message is sent to a
PG logged-in with CPU Messages.
At input "EVENTN" it was specified that the first message of group A is to be
displayed as an incoming event.
Y can enter
You
t wildcards
ild d iin th
the message ttextt th
through
h th
the iinputs
t "INFO1/INFO2"
"INFO1/INFO2". IIn
the example, the analog value is to be displayed as well.
The "RET_VAL" output delivers an error message if:
the message cannot be sent because no node is logged-in or the buffer is
full, or
the SFC52 was assigned parameters with invalid values or formats in the
call.

Training Center
for Automation and Drives

Page 32

ST-7PRO1
Troubleshooting

General

Training Center
for Automation and Drives

You can see the structure of the EVENTN parameter in the slide. It is an input
parameter
t off the
th SFC 52 block,
bl k with
ith which
hi h you specify
if which
hi h message ttextt iis tto b
be
entered in the diagnostic buffer.

Page 33

ST-7PRO1
Troubleshooting

General

The signal modules also have modules with diagnostics capability. Errors on the
module
d l or external
t
l errors such
h as wirebreak,
i b k are id
identified
tifi d and
d iindicated
di t d b
by an "SF"
LED on the module. In case of an error, the module triggers a diagnostic interrupt
OB 82 on the CPU. You can refer to the technical data in the ST 70 catalog or the
manuals to determine which modules have diagnostics capability.

Parameter
Assignment

To activate the diagnostics on a module, click on the box in front of Diagnostic


Interrupt when assigning parameters and specify which channels are to be monitor.
Then the fields with the errors to be monitored, for example, wirebreak, are enabled.
The slide shows the example of the diagnostics capable analog module 335, which
i used
is
d iin V
Version
i A off th
the ttraining
i i unit.
it

Diagnostic Interrupt

If no OB 82 is present in the CPU, the CPU goes to the Stop state if there is a
module error.
The start information for OB 82 contains additional information about the error
cause, which can be evaluated by the software (see Online help).

Training Center
for Automation and Drives

Page 34

ST-7PRO1
Troubleshooting

Introduction

With this function, you obtain a quick overview of the state of the PLC system. If, for
example,
l th
there iis a h
hardware
d
ffaultlt iin a di
diagnostics-capable
ti
bl module,
d l you can identify,
id tif
through the use of a symbol, which module is faulty and where it is located. When you
double-click on the faulty module, additional information is displayed.

Opening the Tool

Select the menu options PLC -> Diagnose Hardware in the SIMATIC Manager or in
the HW Config tool, by opening the station online with a click on the
icon in
the toolbar.

Description
p

When yyou open


p the system
y
diagnostics,
g
the hardware configuration
g
is read out from
the CPU (see left-hand screenshot). In this view, all modules present (even those in
expansion racks or distributed I/O) are displayed.
If the CPU is in Stop mode or if there is a fault in a module, this is indicated with
symbols.
You can double-click the CPU or a faulty module to obtain further diagnostic
information (see right-hand screenshot). In the example, there is a power failure in the
analog module.

Note

If yyou have selected the menu options


p
Options
p
-> Customize -> View in the SIMATIC
Manager and activated (checked) the "Display Quick View when Diagnosing
Hardware" checkbox, only a list of faulty modules will be displayed instead of the full
"Diagnosing Hardware" window.

Training Center
for Automation and Drives

Page 35

ST-7PRO1
Troubleshooting

Goal

When the CPU goes into STOP because of a sporadic error, a message is to
appear immediately
i
di t l on th
the PG
PG. Y
You th
then h
have th
the chance
h
tto carry outt an error
analysis right away.

What to Do

Result

Training Center
for Automation and Drives

Switch over to the SIMATIC Manager and choose the S7 program "My
Program" from the "My Project" project and select the menu options PLC =>
CPU Messages.
In the window that now appears "Customize - CPU Messages", activate the
"W" option in front of the project.
Now using the keyswitch
Now,
keyswitch, switch the CPU to STOP and monitor the reaction
on the PG.

A screen pops up with the cause of the Stop.

Page 36

ST-7PRO1
Troubleshooting

Goal

A system is to be monitored as to whether and when manual operation was


switched
it h d on. A message iis tto b
be entered
t d iin th
the di
diagnostics
ti b
buffer
ff ffor an edge
d att th
the
"Manual" flip-flop.

What to Do

Result

Training Center
for Automation and Drives

Use the reference list for the S7 program "FILL" to determine which output is
used as the memory for the manual operating mode.
Insert a new network at the end of FC 15 (S7 program "FILL").
Create a program that enters a message in the diagnostics buffer when the
manual operating mode is switched on (RLO edge detection).
The assignment of the SFC 52 system function is shown in the slide (with
the exception of the call condition).
Download the FC 15 to the CPU and test the program.

A message is entered in the diagnostic buffer when the manual operating mode is
switched on. If the "CPU Messages" tool is still active, the user message is also
displayed on the PG.

Page 37

ST-7PRO1
Troubleshooting

Goal

The diagnostics are to be activated at the analog module so that hardware faults,
such
h as power supply
l ffailure,
il
can b
be d
detected.
t t d

What to Do

Carry out the steps given in the slide.

Result

You obtain additional information about hardware faults through the "Diagnose
Hardware" tool.

Training Center
for Automation and Drives

Page 38

ST-7PRO1
Troubleshooting

Contents
e

Pag

System Information - Overview


........................................................................................................
Module Information: "Memory" Tab
.............................................................................................
Module Information: "Scan Cycle Time" Tab ..................................................................................... 42
Module Information: "Time System" Tab
........................................................................................
Module Information: "Performance Data" Tab
.................................................................................
Performance Data: Blocks
..............................................................................................................
Exercise: Reading Out System Information
.....................................................................................

Training Center
for Automation and Drives

Page 39

40
41
43
44
45
46

ST-7PRO1
Troubleshooting

Module Information

The display of system information is started in the SIMATIC Manager or in the


LAD/STL/FBD Editor
Edit by
b selecting
l ti th
the menu options
ti
PLC ->
> Module
M d l IInformation...
f
ti
.
Information about module information is summarized in the following tabs:
General
Diagnostic Buffer
Memory
Scan Cycle Time
Time System
Performance Data
Communication
Stacks

"General" Tab

This tab gives you information about:


Module data (Version, Order No.)
Location
Module Status

Training Center
for Automation and Drives

Page 40

ST-7PRO1
Troubleshooting

Load Memory

The load memory is integrated in the CPU (RAM). The usage is displayed in the
left bar graph.
If a memory card is inserted in the CPU, the middle bar graph is relevant.
Additional information is also stored in the load memory. For that reason, the
usage of the load memory is always higher than that of the work memory.

Work Memory

Only the information required for program execution in the CPU is stored in the
work memory
memory.

Compressing

Gaps that exist in the work memory can be eliminated by selecting the
"Compress" button.
These gaps are caused by program corrections in the CPU. With block
corrections, the old blocks are not overwritten, rather they are only declared as
invalid. The modified blocks are added to the free end of the memory and thus
occupy new memory after every correction.
Compressing is only required with the S7
S7-400.
400 The work memory is automatically
compressed with the S7-300.

Training Center
for Automation and Drives

Page 41

ST-7PRO1
Troubleshooting

General

Scan cycle time is defined as the time that the CPU requires to update the process
i
image
ttables,
bl
execute
t th
the user program, carry outt allll di
diagnostic
ti ffunctions,
ti
and
d
communicate with the programming devices.

"Scan Cycle Time"


Tab

The "Scan Cycle Time" tab gives you the following information about cyclic
program execution:
Longest cycle time duration since the last switch from STOP to RUN,
Shortest cycle time duration since the last switch from STOP to RUN,
Current / p
previous cycle
y
time duration,
Display of the Configured scan cycle monitoring time (maximum scan cycle
time) and
Display of the Configured minimum scan cycle time (only for S7-400).
That way, you can implement constant cycle times. A new cycle always
begins when the minimum scan cycle time has run out.

Training Center
for Automation and Drives

Page 42

ST-7PRO1
Troubleshooting

Clock

This box only displays the data from the integrated real-time clock in the CPU. (See
b l
below
ffor notes
t on setting
tti the
th time.)
ti
)

Correction Factor

The correction factor for adjusting the clock is entered in the "HW_Config" window
(see the chapter "Hardware Configuration").

Clock
Synchronization

There are several ways of synchronizing the clock:


within a PLC system, for example, with multicomputing,
on the MPI network between Master and Slave
with
ith MFI (multifunctional
( ltif
ti
l interface)
i t f
) for
f point-to-point
i tt
i t connection.
ti

Run-time meter

For measuring the operating time of an apparatus.


The following system functions exist in the CPU for a run-time meter:
SFC2
set to a default value
SFC3
starting and stopping
SFC4
reading out the current elapsed hours.
The number
Th
b off run-time
ti
meters
t
depends
d
d on th
the ttype off CPU ((max. 8)
8). Th
The value
l
range lies between 0 and 32767 hours.

Set Date and Time

Training Center
for Automation and Drives

There are two ways of setting the date and time on the module:
1. In the SIMATIC Manager by selecting the menu options PLC -> Set Date
and Time
2. Using the system function SFC0 to set the date and time.

Page 43

ST-7PRO1
Troubleshooting

Application

The information on the available memory lets you determine before you download
your program, whether
h th th
the program you d
developed
l
d offline
ffli can b
be executed
t db
by th
the
target CPU.

Performance Data

This tab page contains the following information:


size of the work memory
size of the integrated load memory
size of the maximum slot-in load memory
size of the address areas: process image inputs
inputs, process image outputs
outputs, bit
memory, timers, counters and local data

Properties
"Block Folder"

You can determine how much memory the user program requires in the CPU by
selecting the Properties of the block folder in the SIMATIC Manager.

Training Center
for Automation and Drives

Page 44

ST-7PRO1
Troubleshooting

Blocks

Training Center
for Automation and Drives

When you click on the "Blocks" button, the Performance Data tab also gives you
i f
information
ti about
b t which
hi h bl
blocks
k can b
be d
downloaded
l d d iinto
t th
the available
il bl CPU
CPU.
The following information is displayed:
Organization blocks
System functions
the maximum possible number of FCs, FBs, DBs, and
the maximum length of the blocks.

Page 45

ST-7PRO1
Troubleshooting

Goal

Becoming familiar with the available system information using the menu options
PLC ->
> Module
M d l IInformation.
f
ti

What to Do

1. In the SIMATIC Manager or in the LAD/STL/FBD Editor, select the menu


options PLC -> Module Information.
2. Choose the tab page you want.
3. Ascertain how much memory is still available in the work memory.
4. Determine what the longest scan cycle time has been up until now.

Result

You become familiar with a tool that will give you important diagnostic information
when dealing with faults.

Training Center
for Automation and Drives

Page 46

ST-7PRO1
Troubleshooting

You might also like