Program Trace With The Block Stack ("Bstack") Function - Siemens SIMATIC S5 Manual

Hide thumbs Also See for SIMATIC S5:
Table of Contents

Advertisement

S5-115F Manual
5.2.2

Program Trace with the Block Stack ("BSTACK") Function

During program scanning, jump operations enter the following information in the block stack:
The data block that was valid before program scanning exited a block
The relative return address. This address indicates the location at which program scanning
continues after it returns from the block that was called.
The absolute return address. This address indicates the location in the program memory at
which program scanning continues after it returns from the block that was called.
You can call the information listed above using the "BSTACK" programmer function in the "STOP"
mode if the CPU has entered this mode as the result of a malfunction. The "BSTACK" reports the
status of the block stack at the time the interruption occurred.
Example:
Program scanning was interrupted at function block FB 2. The CPU went into the
"STOP" mode with the error message "TRAF" because of incorrect access. (DB 5 is
two words long. DB 10 is twelve words long.)
You can use the "BSTACK" function to determine the path used to reach FB 2 and to
determine which block has passed the wrong parameter. The "BSTACK" contains the
three return addresses.
OB 1
00 L FW 0
02 L KF+1
06 +F
08 T FW 0
:
:
:
:
28 JU PB2
2A
2C JU PB3
:
:
:
:
:
xx
BE
Figure 5-5. Program Trace with the "BSTACK" Function
EWA 4NEB 811 6149-02
PB 1
00
:
:
xx
BE
PB 2
00
PB 4
:
:
00
:
10 A DB5
:
12 JU PB4
18 JC FB2
14
1A
xx
BE
xx
PB 3
00
:
:
24 C DB10
26 JU FB2
28 L PW 10
:
xx
BE
Interruption
with the "TRAF"
error message
FB 2
BE
00
:
:
26
L DW4
:
:
:
xx
BE
Error Diagnostics
5-7

Advertisement

Table of Contents
loading

This manual is also suitable for:

S5-115f

Table of Contents