Download Print this page

Danfoss MCO 305 Design Manual page 132

Hide thumbs Also See for MCO 305:

Advertisement

MCO 305 Design Guide
ON ERROR GOSUB
Summary
Syntax
Parameter
Description
Command Group
Cross Index
Syntax Example
Program Sample
132
__ Software Reference __
Definition of an error subroutine
ON ERROR GOSUB name
name = name of the subroutine
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.
INT
SUBPROG...RETURN, ERRCLR, ERRNO, CONTINUE, EXIT, Priorities of Interrupts, ON
TIME, NOWAIT
ON ERROR GOSUB errhandle
command lines 1 ... n
SUBMAINPROG
SUBPROG errhandle
command lines 1 ... n
RETURN
ENDPROG
ERROR_01.M, IF_01.M, INDEX_01.M
®
MG.33.L4.02 – VLT
is a registered Danfoss trademark
/* definition of an error subroutine */
/* subroutine errhandle must be defined */

Advertisement

loading