Publication 1747-RM001G-EN-P - November 2008
11-4 Understanding Interrupt Routines
User Interrupt Routine Application Example
Suppose you have a program in which you want to control major errors 0020h
(MINOR ERROR AT END OF SCAN) and 0034h (NEGATIVE VALUE
IN TIMER PRE OR ACC) under the following conditions.
• Prevent a processor shutdown if the overflow trap bit S:5/0 is set.
Permit a processor shutdown when S:5/0 is set more than five times.
• Prevent a processor shutdown if the accumulator value of timer T4:0
becomes negative. Reset the negative accumulator value to zero.
Energize an output to indicate that the accumulator has gone negative
one or more times.
• Allow a processor shutdown for all other user faults.
A possible method of accomplishing this is shown in the following examples.
The user fault routine is designated as file 3.
When a recoverable or non-recoverable user error occurs, the processor scans
subroutine file 3. The processor jumps to file 4 if the error code is 0020 and it
jumps to file 5 if the error code is 0034h. For all other recoverable and
non-recoverable errors, the processor exits the fault routine and halts
operation in the fault mode.