
MCO 305 Design Guide
__ Software Reference __
132
MG.33.L4.02 – VLT
®
is a registered Danfoss trademark
ON ERROR GOSUB
Summary
Definition of an error subroutine
Syntax
ON ERROR GOSUB name
Parameter
name = name of the subroutine
Description
By using the ERROR GOSUB instruction, a subroutine will be defined, which can be
called up in case of error. If an error occurs after the definition, then an automatic
program abort will not take place – instead, the defined subroutine will be called
up.
Within this subroutine, it is possible to target the re-action to the error, to wait for
user intervention via ERRCLR (clear error) or, in the case of non-correctable errors,
to abort the program via the EXIT instruction.
If the program is not aborted, then the processing will continue from the point
where the interruption occurred.
By using the CONTINUE command, it is possible to continue the error-interrupted
motion. (Exception: synchronization commands)
NB!:
The ON ERROR GOSUB instruction should be at the start of a program, so that it
has validity for the entire program.
The subroutine to be called up must be defined within the identified SUBMAINPROG
and ENDPROG program.
The identification of an error condition and the call up of the corresponding sub-
routine requires a maximum of 2 milliseconds.
NB!:
–
Error subroutines cannot be interrupted through any other interrupts.
–
During the execution of an error routine NOWAIT is automatically set to ON.
If the error subroutine is exited with the error still active because e.g. ERRCLR was
not carried out or another error has occurred, then a new call takes place.
NB!:
The ON ERROR GOSUB xx routine does not terminate the HOME and INDEX com-
mand. This means they will be executed after the error has been cleared. To
prevent this an ON TIME 1 can be included in the error routine.
Command Group
INT
Cross Index
SUBPROG…RETURN, ERRCLR, ERRNO, CONTINUE, EXIT, Priorities of Interrupts, ON
TIME, NOWAIT
Syntax Example
ON ERROR GOSUB errhandle /* definition of an error subroutine */
command lines 1 … n
SUBMAINPROG
/* subroutine errhandle must be defined */
SUBPROG
errhandle
command lines 1 … n
RETURN
ENDPROG
Program Sample
ERROR_01.M, IF_01.M, INDEX_01.M
Summary of Contents for MCO 305
Page 4: ......