Interrupt Processing Details - Omron SYSMAC CV500-BSC11 Operation Manual

Basic units
Table of Contents

Advertisement

Interrupts
Error Processing

6-1-5 Interrupt Processing Details

96
Error processing is slightly different than other interrupt processing. If the BASIC
Unit encounters an error (for example, if the program attempts to divide by zero),
execution is normally terminated and an error message is printed. If an er-
ror-handling "interrupt" routine is defined with the ON ERROR GOTO statement,
the BASIC Unit will instead execute that routine. The routine can take whatever
action is necessary to correct the error and continue.
The ON ERROR GOTO statement defines an interrupt routine to be executed if
the BASIC Unit encounters an error. For example:
100 ON ERROR GOTO 1000
If the BASIC Unit encounters an error, the interrupt routine starting at line 1000
will be executed. To restore the default error action, specify line 0.
The line number on which the error occurred and a number indicating the error
type can be obtained with the ERL and ERR functions. (For a list of error codes
and corresponding error conditions, see Section 8-1-1 Error Messages.)
To exit from the error processing routine, use the RESUME statement instead of
the RETURN statement. RESUME can take one argument, which can be a line
number where execution should continue, 0 to indicate that the error line should
be re-executed, or NEXT, to resume execution at the line after the error. If no ar-
gument is supplied to RESUME, the BASIC Unit attempts to execute the error line
again.
Note There is no ERROR ON, ERROR OFF, or ERROR STOP statement. Error process-
ing is always enabled.
The BASIC Unit maintains three system variables, INTRB, INTRL, and INTRR,
which can be examined in an interrupt service routine to find information about
the current interrupt. INTRR contains a number indicating the interrupt source:
Interrupt source
User-defined signal (1 to 5)
Communication port COM (1 to 3)
Signal (STOP)
Signal (PC watchdog timer error)
Signal (cyclic error)
Signal (battery error)
Alarm
Timer
Time
SRQ (service request from GP-IB)
FINS (network)
Numeric key input (0 to 9)
PC (1 to 15)
INTRB contains the number of the line to be executed next when the interrupt
occurred; when the service routine returns, execution will continue at that line.
INTRR
1 to 5
6 to 8
10
11
12
13
14
15
16
17
18
20 to 29
31 to 45
Section 6-1

Advertisement

Table of Contents
loading

Table of Contents