Siemens SIMATIC S7-1500 fault OB121: Programming error

Siemens SIMATIC S7-1500faultSTEP 7 (TIA Portal) V21 documentation

The operating system calls OB121 when a programming error occurs while an instruction of the user program executes, provided the block does not use local error handling (GET_ERROR or GET_ERR_ID). If neither OB121 nor local error handling catches the error, the S7-1500 changes from RUN to STOP and writes an entry in the diagnostics buffer. Fault_ID identifies the error, e.g. 16#3A access to a DB that is not loaded, 16#22/16#23 area length errors, 16#75 maximum block nesting depth exceeded.

Diagnose this with AI

Upload a keypad photo, the fault history or a parameter export from your Siemens SIMATIC S7-1500. InduQT compares the evidence and suggests the next useful checks.

Try Free PLC Fault Diagnostic

When it happens

Likely causes and checks

1Access to a DB, FC or FB that is not loaded or does not exist

Points to it
Fault_ID 16#3A, 16#3B, 16#3C or 16#3E; follows a partial download or a deleted block.
Check
Compare blocks in the CPU with the project (online/offline comparison) and download the missing block.

2Area or length error from an indirect address or array access

Points to it
Fault_ID 16#22–16#25; the diagnostics buffer names the block and the access.
Check
Read the index or pointer value at the error and compare it with the area it addresses.

3Block call nesting or local data exceeded

Points to it
Fault_ID 16#00/16#75 (nesting depth) or 16#76 (local data).
Check
Review call depth and recursion in the block named in BlockNr.

Telling it apart

Evidence to collect

Work on fuel trains, burners, pressure vessels and electrical equipment must be done by qualified personnel following the manufacturer’s documentation and local codes. Never bypass a safety device or interlock.

Related