Technical data

Basics of Designing a Program Structure
4.2 Blocks in the User Program
Programming with STEP 7
Manual, 05/2010, A5E02789666-01 111
Using OBs for Synchronous Errors
Synchronous errors occur during the execution of a particular instruction. When these errors occur,
the operating system makes an entry in the I stack and starts the OB for synchronous errors.
The error OBs called as a result of synchronous errors are executed as part of the program in the
same priority class as the block that was being executed when the error was detected. The details
about the error that triggered the OB call are in the start information for the OB. You can use this
information to react to the error condition and then to return to processing your program (for
example, if an access error occurs on an analog input module, you can specify a substitute value in
OB122 using SFC44 RPL_VAL). The local data of the error OBs, do, however, take up additional
space in the L stack of this priority class.
With S7-400 CPUs, one synchronous error OB can start a further synchronous error OB. This is
not possible with S7-300 CPUs.
Using OBs for Asynchronous Errors
If the operating system of the CPU detects an asynchronous error, it starts the corresponding error
OB (OB70 to OB73 and OB80 to OB87). The OBs for asynchronous errors have the highest priority
as default and they cannot be interrupted by other OBs if all asynchronous error OBs have the
same priority. If more than one asynchronous error OB with the same priority occurs
simultaneously, they are processed in the order they occurred.
Masking Start Events
Using system functions (SFCs), you can mask, delay, or disable the start events for several OBs.
For more detailed information about these SFCs and the organization blocks, refer to the "System
Software for S7-300 and S7-400, System and Standard Functions" Reference Manual.
Type of Error OB SFC Function of the SFC
SFC36 MSK_FLT Masks individual synchronous errors. Masked errors do
not start an error OB and do not trigger programmed
reactions
Synchronous error OBs
SFC37 DMSK_FLT Unmasks synchronous errors
SFC39 DIS_IRT Disables all interrupts and asynchronous errors.
Disabled errors do not start an error OB in any of the
subsequent CPU cycles and do not trigger programmed
reactions
SFC40 EN_IRT Enables interrupts and asynchronous errors
SFC41 DIS_AIRT Delays higher priority interrupts and asynchronous
errors until the end of the OB
Asynchronous error OBs
SFC42 EN_AIRT Enables higher priority interrupts and asynchronous
errors
Note
If you want interrupts to be ignored, it is more effective to disable them using an SFC, rather than to
download an empty OB (with the contents BE).