Call 38 – expanded onerr restart, Call 38 – expanded onerr restart -5, Syntax – Rockwell Automation 1746-BAS BASIC LANGUAGE User Manual

Page 101: Example, Purpose

Advertising
background image

Publication 1746-RM001A-US-P

Execution Control and Interrupt Support Functions 8-5

The POP shows the status of the SLC processor:

0 - SLC processor acknowledges the interrupt but may not have executed the
interrupt routine yet

1 - SLC processor aborted the interrupt

2 - SLC processor is not in Run mode

3 - SLC 500 fixed and SLC 5/01

processor cannot support interrupts

Syntax

CALL 26

POP[ SLC processor status]

Example

>1

REM EXAMPLE PROGRAM

>10 REM ENABLE MODULE INTERRUPT TO THE SLC PROCESSOR TO EXECUTE

THE ISR FILE

>20 CALL 26

>30 POP S : REM SLC PROCESSOR STATUS

CALL 38 – Expanded
ONERR Restart

Purpose

Use CALL 38 to expand the type of errors trapped and handled by the ONERR
function. One argument is PUSHed and no arguments are POPped. The ONERR
restart allows the module to jump to an error handling routine when the arithmetic
overflow, divide by zero, and bad argument errors are encountered. All other errors
cause the module to enter the Command mode and stop the execution of the
program. When CALL 38 is enabled, all errors other than hardware-specific
failures (watchdog, RAM failure, etc.), cause the program to enter the routine
defined in the ONERR function, instead of returning to the Command mode.
This routine may be used to reset the error and resume normal program operation.
If any error occurs that causes a restart, stacks are cleared and variables and ports are
not re-initialized. This CALL has no effect until the ONERR command is executed
within the program.

The PUSH determines if this expanded ONERR function is enabled or disabled as
shown below:

0 - Disable the expanded ONERR restart

1 (or any other number) - Enable the expanded restart

This CALL is reset when the module returns to the Command mode. CALL 38
must be re-executed every time Run mode is entered.

Advertising