The S7-CPU modules are able to recognize the following types of error:
- Synchronous errors
These errors are triggered by a specific operation during processing and can be assigned to a specific part of the user program.
- Asynchronous errors
These errors cannot be assigned directly to the processing user program. These are priority class errors or errors in the automation system (module defects) or redundancy errors.
The table below gives you an overview of the organization blocks (OBs) that are called and processed when asynchronous and synchronous errors occur. If the relevant OB is not loaded, the CPU goes into the STOP state (exceptions: OBs 70, 72, 73 and 81).
Übersicht_Organisationsbausteine.pdf ( 8 KB )
Which error OBs are enabled in your CPU and which you can thus insert in a STEP 7 project is given in the Properties of your CPU in the "Interrupts" tab.
The Hardware Configuration provides a convenient alternative to manually incorporating error OBs via the menu command "Options > Report System Error...".
Note on using error OBs
You should program error handling for reliable and error-free plant operation or at least program that a message is generated in case of an error, because you must take into account that the CPU might no longer go into "STOP" and thus dangerous plant statuses might remain unnoticed.
- OB 70 and OB 72 are supported only by H CPUs.
- OB 73 is available only for CPU 417-4H V2.0.X.
- More information about individual error OBs is available in the STEP 7 Online Help under
- "Change in the error evaluation in the OB 122 with series 400 CPUs" - Entry ID: 5708202.
- Keyword "Generated error OBs".
- Keyword "Settings for reporting system errors".
- The following entry gives you information about which OBs have to be loaded in the CPU to ensure that the CPU does not go into the "STOP" status when a remote IO fails: 19350076.
Example of a power supply failure
The operating system of the CPU calls the OB81 when an event occurs that is triggered by a power supply failure (only in S7-400) or buffering fault. After clearing the error the OB81 is called again. If there is a battery fault in the S7-400 the OB81 is called only if battery checking is activated with the BATT.INDIC switch. If OB 81 is not programmed, the CPU does not go into STOP mode. If the OB81 is not available, the CPU continues running if there is a power supply failure.
In the sample program the temporary variable "OB81_FLT_ID" from OB81 is evaluated to determine a battery failure. In this example the variable has the error code "22hex". If the condition is fulfilled in a comparative query (battery failure), the marker M81.1 is addressed. Two event classes can be recognized with the "OB81_EV_CLASS" variable:
- B#16#39: incoming event, battery has failed.
- B#16#38: outgoing event, battery failure has been cleared.
Evaluation of these variables sets and resets the marker M81.0.
The marker M81.0 is set if the markers M81.1 and M81.2 have the signal status "TRUE" (in the case of power failure and incoming event). The marker M81.0 is reset when the query of the ID is an outgoing event. The example described above is for the case when the battery failure occurs when the CPU is running. If the battery failure occurs in the STOP operating mode, the incoming event (call of OB81) is triggered only when the CPU goes into RUN mode again. If the power supply is switched off, the incoming event (battery failure) is not triggered.
Detailed information about programming the error OBs is also available in the STEP 7 Online Help or in the manual "System Software for S7-300/400 System and Standard Functions" in Entry ID: 1214574.
OB80, OB81, OB82, OB83, OB84, OB85, OB86, OB87, OB121, OB122