Technical data
Diagnostics
23.9 Program Measures for Handling Errors
Programming with STEP 7
514 Manual, 05/2010, A5E02789666-01
23.9.8 Diagnostic Interrupt (OB82)
Description
The operating system of the CPU calls OB82 when a module with diagnostics capability on which
you have enabled the diagnostic interrupt detects an error and when the error is eliminated (the OB
is called when the event comes and goes).
Programming OB82
You must create OB82 as an object in your S7 program using STEP 7. Write the program to be
executed in OB82 in the generated block and download it to the CPU as part of your user program.
You can, for example, use OB82 for the following purposes:
• To evaluate the start information of OB82.
• To obtain exact diagnostic information about the error that has occurred.
When a diagnostic interrupt is triggered, the module on which the problem has occurred
automatically enters 4 bytes of diagnostic data and their start address in the start information of the
diagnostic interrupt OB and in the diagnostic buffer. This provides you with information about when
an error occurred and on which module.
With a suitable program in OB82, you can evaluate further diagnostic data for the module (which
channel the error occurred on, which error has occurred). Using SFC51 RDSYSST, you can read
out the module diagnostic data and enter this information in the diagnostic buffer with SFC52
WRUSRMSG. You can also send a user-defined diagnostic message to a monitoring device.
If you do not program OB82, the CPU changes to STOP mode when a diagnostic interrupt is
triggered.
You can find detailed information on OBs, SFBs, and SFCs in the corresponding Help on Blocks.