Overview: S5-115U ISTACK Stop Conditions
The ISTACK (Interrupt Stack) is the diagnostic heart of the Siemens SIMATIC S5-115U programmable controller. When the CPU transitions from RUN to STOP, the operating system copies the current stack state, accumulator contents, and a coded stop reason into the ISTACK buffer, which is preserved across power cycles when the lithium backup battery is healthy. Reading this buffer with PG2000 PLC V5.1 is the first action any service engineer should take on a stopped S5-115U.
A classic field failure pattern matches the symptoms reported on the S5-115U: the program executes correctly in Manual mode but transitions to STOP immediately when the operator selects Automatic. The ISTACK shows BATPUF, STOPZUS, STOANZ, and ASPNEP set, while the BSTACK is empty. The combination of empty BSTACK and ISTACK active is diagnostic: the operating system has not been interrupted mid-block (which would populate the BSTACK), but rather an Organization Block (OB) error handler has fired, executed a STOP statement, and brought the CPU down without leaving a normal call stack behind.
ISTACK Bit Definitions for the S5-115U
The S5-115U ISTACK is structured as a multi-page diagnostic display. Each page contains status bits, accumulator images, and the address that triggered the stop. The following bit names are decoded as they appear on a PG2000 PLC V5.1 online session.
| Bit | Name | Meaning | Engineering Implication |
|---|---|---|---|
| BATPUF | Battery Backup | Lithium backup battery on the CPU is present and healthy; RAM contents are retained through power-off. | If BATPUF is not set, the program in RAM is lost on every power cycle and the CPU will boot to STOP. Replace the battery before debugging. |
| STOPZUS | Stop Zusatz (Stop Cause) | The CPU has received a stop request — either from the program, from the programmer, or from a SINEC L1 master. | Look for the STP (or STS) statement in the OB that fired. Identify which OB contains the active stop request. |
| STOANZ | Stop Anzeige (Stop Display) | Stop indicator bit. Confirms the ISTACK display is currently showing a stop event. | Always set when a stop has occurred. Reset by selecting RUN on the programmer or cycling power in cold-restart mode. |
| ASPNEP | Anwender-Speicher EPROM (User Memory EPROM) | The user memory submodule plugged into the CPU is an EPROM (or a flash-equivalent module), not a writable RAM card. | The on-line edit (modify/transfer) functions in PG2000 will be refused. To change the program you must erase the EPROM under UV light and re-burn, or remove the submodule and work from internal RAM if available. |
| STS | Software Stop | A software stop request was issued from inside the user program via the STP instruction, or a stop was requested from the programmer, or from the SINEC L1 bus master. |
Open the OB indicated by the ISTACK pointer (typically OB19, OB23, OB24) and look for the literal STP or STS block. Comment it out temporarily to confirm the cause. |
BSTACK Interpretation on the S5-115U
The BSTACK (Block Stack) records the call hierarchy of program blocks (FB/PB/SB/DB) at the moment a stop or error occurred. PG2000 displays the stack as a list of block numbers with their associated DBs and return addresses.
An empty BSTACK with an active ISTACK is significant. It means the CPU was not executing a user block when it stopped. This rules out typical in-program faults such as:
- Division by zero in a calculation FB
- Access to a non-existent DB (DB not loaded)
- Periphery access to an I/O slot that has no module installed
- Timeout in a timer/counter FB with a zero preset
What it points to is an OB-level error handler that has been triggered, executed, and stopped the CPU before any application block was re-entered. The OB itself is the block you must open and inspect.
Common Stop Causes on the S5-115U
The S5-115U operating system calls specific Organization Blocks in response to fault conditions. Each of these OBs, if programmed with an STP statement, will halt the CPU the moment the fault occurs.
| OB | Trigger Condition | Typical Field Symptom |
|---|---|---|
| OB19 | Periphery access error — read or write to an I/O address with no P-bus module present, or a module that has signalled a fault. | Stop immediately after a peripheral write; often the first time a new sensor or valve is wired. |
| OB23 | Programming error — invalid operation, illegal accumulator value, or a substitute operation (SUB) that fails. | Stop the first time the affected FB is called after program change. |
| OB24 | PLC fault — battery failure detected by the CPU, or a stop request from the programmer / SINEC L1 bus. | Stop immediately after power-up, after a battery is removed, or when a remote master sends a stop frame. |
| OB21 / OB22 | Restart (manual / automatic) errors — wrong restart type for the loaded program, or DB inconsistency. | CPU will not leave RESTART; the ISTACK shows the fault that aborted the restart sequence. |
Accessing the ISTACK in PG2000 PLC V5.1
PG2000 PLC V5.1 is the on-line test front-end for the S5-115U and the rest of the SIMATIC S5 family. Use the following sequence to display the diagnostic information:
- Connect the PG to the S5-115U via the MPI/AS511 port (serial) and power on the programmer.
- From the project navigator, select PLC > Connect Online Target System.
- Confirm the connection by reading the CPU status; the CPU should report STOP with ISTACK.
- Open PLC > Diagnosis > ISTACK (the menu path may appear as Test Functions > Stack Display in localized versions).
- Page through all ISTACK screens with PgDn / PgUp. Capture every screen, including the page that lists the active OB and the page showing accumulator and status word.
- Open PLC > Diagnosis > BSTACK and record the block list. In this failure mode the BSTACK is normally empty, but capturing it confirms that no user block was interrupted.
Make a hard copy (PG2000 supports printing the screen with Shift+Print) and archive the ISTACK pages. They are the only forensic record of the failure once the CPU is restarted.
Locating the Faulty Organization Block
The ISTACK pointer identifies which OB was active when the stop was issued. With that OB known, apply the following systematic procedure to confirm the cause.
- Open the OB indicated by the ISTACK pointer in PG2000 (OB19, OB23, OB24, or whichever the ISTACK reports).
-
Search for the literal
STPstatement. In STEP 5 / PG2000 this is the assembly equivalent of "Stop Program" and is the only instruction that issues a software stop from within an OB. Search with the editor's Find function for the three-letter stringSTP. -
Comment the
STPout by replacing it with a no-op such asNOP 0. If you are working on the EPROM submodule (ASPNEP set), you cannot do this on-line; see the EPROM handling section below. - Transfer the change to the CPU and place the CPU in RUN. If the CPU stays in RUN for at least one full OB1 cycle, the OB you just modified is the source of the stop.
- If the CPU still stops, the ISTACK will now show a different active OB. Repeat the procedure from step 1 on the new OB.
-
If the CPU no longer stops, restore the original
NOP 0lines one at a time, restarting the CPU after each change, to confirm the original stop trigger. Once confirmed, the originalSTPcan either be left asNOP 0(with a maintenance note in the program header) or replaced with a controlled fault-handling routine such as setting a flag and continuing.
STP statement inside an error OB is sometimes intentional — for example, to force the machine to a safe state on a critical sensor failure. Removing it should only be done after consulting the machine's safety documentation. The diagnostic procedure above is meant to locate the cause, not to permanently disarm a safety function.Handling the EPROM Submodule (ASPNEP)
The ASPNEP bit is set whenever the user memory is an EPROM submodule (the classic plug-in memory card on the S5-115U front panel). This has direct consequences for the diagnostic workflow:
- On-line editing is rejected. PG2000 will not transfer program changes to an EPROM. The Modify, Transfer, and Block Delete functions are disabled when ASPNEP is active.
- UV erase is required. The EPROM must be physically removed from the CPU, erased under a UV eraser (typically 20–30 minutes), and re-burned with an EPROM programmer before it can be re-installed.
- RAM fallback. If the CPU has internal RAM (most S5-115U CPUs do, in addition to the submodule slot), the on-line edit can be performed against RAM by leaving the EPROM submodule out. The next cold restart will then load from RAM, allowing diagnostic edits. Always verify the CPU variant supports this; some lower-tier CPUs (e.g., CPU 941 in early revisions) require a submodule to boot at all.
- Battery interaction. With ASPNEP set, the lithium backup battery is no longer needed for the user program. BATPUF is still relevant for the internal flags, timers, and counters. Removing the battery will not affect the program code on the EPROM but will reset all retentive flags.
Why Manual Mode Runs but Automatic Mode Stops
The reported behaviour — the program runs in manual mode but stops the moment automatic mode is selected — almost always points to one of three root causes:
| Root Cause | Diagnostic Signature | Resolution |
|---|---|---|
| An input that is forced in manual mode is de-energised in automatic mode, triggering a periphery fault (OB19). | ISTACK shows OB19 active; the pointer identifies the exact I/O address (byte/bit). | Verify the wiring of the address listed in the ISTACK. Add the input to the standard manual-mode forcing list if it is intentionally bypassed in manual. |
| A subroutine that is skipped in manual mode is called in automatic mode and contains an error such as division by zero or a bad DB reference. | ISTACK shows OB23 active; BSTACK lists the FB/PB at the point of failure. | Fix the calculation or load the referenced DB before the call. |
The error OB itself contains a hard-coded STP statement that was added for a previous failure mode and never removed. |
ISTACK shows the OB with the stop pointer inside the OB body; BSTACK is empty. | Replace the STP with a flag set and a structured handler. Document the change in the program header. |
Verification and Restart Procedure
After the offending OB is identified and the cause is resolved, perform the following verification sequence before returning the machine to production:
- Power-cycle the CPU with the selector in STOP to clear the ISTACK.
- Set the selector to RUN with no program executing. The CPU should remain in RUN (or transition to RUN after a clean cold restart on a CPU that does so automatically).
- Select Manual on the operator panel and run a full manual cycle. Confirm no stop.
- Select Automatic and run a full automatic cycle. Confirm no stop. Repeat the cycle at least three times to rule out an intermittent trigger.
- Re-read the ISTACK in PG2000 after the test runs. It should show a clean state with no
STOPZUSset. - Save the modified program to the project file and to the EPROM submodule (if ASPNEP was the working environment). Label the EPROM with the program name, version, and date.
- Document the ISTACK pages, the OB that was modified, the change made, and the test results in the machine's maintenance log.
Preventive Recommendations
- Never leave a hard-coded
STPin an error OB without a comment block explaining the failure mode it protects against. - Replace battery proactively — lithium batteries on the S5-115U have a typical service life of 5 years. A weak battery will appear as
BATPUFmomentarily clear and re-set, often producing confusing ISTACK states. - Keep a printed copy of the ISTACK bit definitions for the specific CPU revision mounted on the inside of the cabinet door. Field engineers will find this faster than the manual during a night shift stop.
- For EPROM-based CPUs, maintain a programming workstation (PG with EPROM eraser and burner) on site. EPROM handling is the single most common cause of extended downtime on legacy S5-115U systems.
What does BATPUF tell me on the S5-115U ISTACK?
BATPUF indicates the lithium backup battery on the CPU is installed and healthy, which means the RAM contents (flags, timers, counters, retentive data) survive a power cycle. If BATPUF is not set, the CPU will boot to STOP on every power-up because it cannot guarantee program retention. Replace the battery before further debugging.
Why is my BSTACK empty even though the CPU is in STOP?
An empty BSTACK with an active ISTACK means the CPU was not executing a user block (FB, PB, SB, DB) when it stopped. The stop was issued by an Organization Block error handler that has already returned. The ISTACK pointer will identify which OB (typically OB19, OB23, or OB24) fired; open that OB in PG2000 and search for the literal STP statement.
Can I edit the program on-line when ASPNEP is set?
No. ASPNEP indicates the user memory is an EPROM submodule, and PG2000 refuses on-line edits against an EPROM. Either remove the EPROM and run from internal RAM (if the CPU supports it), or erase the EPROM under UV light, re-burn it with the modified program, and re-install it. Refer to the CPU-specific manual on the Siemens Industry Online Support portal for the exact procedure.
How do I tell whether the stop came from my program or from the programmer?
Check the STS bit on the ISTACK. If STS is set, the stop was issued by a software STP statement in the user program, by a stop request from the programmer, or by a SINEC L1 master. The ISTACK pointer on the relevant page identifies the source. A stop issued from the programmer is recorded with a distinct stack frame that does not point to a user OB.
Why does the S5-115U run in manual mode but stop immediately in automatic?
This is a classic symptom of an error OB that contains a hard-coded STP statement being triggered by a condition unique to the automatic sequence — usually a periphery input that is forced or bypassed in manual mode, or a subroutine that is skipped in manual but called in automatic. Identify the active OB from the ISTACK, open it in PG2000, and confirm the STP location. Fix the underlying trigger (wiring, I/O assignment, or DB load) rather than removing the STP without addressing the fault.