Program Trace With The "Bstack" Function - Siemens SIMATIC S5-95F Manual

Table of Contents

Advertisement

Testing the User Program and Storing It on the Memory Submodule

14.3.2 Program Trace with the "BSTACK" Function

During program scanning, the following information is entered in the block stack (BSTACK) for each
block called:
Block type and block number
Absolute block start address. The absolute block start address is the start address of the block
in the program memory.
Absolute return address. The absolute return address is the memory address at which the block
was exited.
Relative return address. The relative return address is the relative address at which the block
was exited.
Data block valid when the block was exited.
This information can be called up via the programmer's "BSTACK" function while the PLC is at
"STOP", but only if the PLC went to "STOP" because of a fault. "BSTACK" then shows the
contents of the block stack at the time of interruption.
Example:
The program scan was interrupted in FB2, and the PLC went to STOP with a "TRAF"
error (illegal DB access operation, e.g. DB5 is two words long, DB3 ten words long).
The "BSTACK" function helps the user determine the path the program took to reach
FB2, and tells him which DB was open at the time FB2 was invoked. It contains the
three (marked) block start addresses.
OB1
00 JU PB1
02
04 JU PB2
06
08 JC PB3
10
xx
BE
14-12
PB1
00
xx
BE
PB2
00 C DB5
02 JU PB4
04
xx
BE
PB3
00 C DB3
16 JU FB2
18
BE
Figure 14-5. Program Trace with the "BSTACK"
PB4
00
08 JC FB2
10
xx
BE
S5-95F
Interrupt with
"TRAF" error
FB2
00
2A
L DW4
xx
BE
EWA 4NEB 812 6210-02

Advertisement

Table of Contents
loading

Table of Contents