Cross Index
ON APOS ... GOSUB, ON MAPOS ... GOSUB, ON
MCPOS ... GOSUB
Syntax-Example 1
ON - APOS 20000 GOSUB hitinfo
ON - APOS 10000 GOSUB hitinfo
ON + APOS 10000 GOSUB hitinfo
ON + APOS 0
GOSUB hitzero
ON - APOS 0
GOSUB hitzero
ON INT 3 GOSUB hitinfo
...
ON DELETE 0 GOSUB hitinfo
...
ON + APOS 99999 GOSUB hitinfo
// New defined position interrupt
Result:
All the position interrupts (#1, #2, #3) belonging to
the subprog hitinfo are deleted as soon as 'ON
DELETE 0 GOSUB hitinfo' is executed. These inter-
rupts don't count anymore for the maximum number
of available interrupts and can not be enabled or
disabled anymore. All other non-position interrupts,
even the ones belonging to the same subprogram
(e.g. ON INT 3) are still valid!
As soon as the command line 'ON + APOS 99999
GOSUB hitinfo' is executed, this defines a new
position interrupt, which is "linked" to the given
subprogram (that has been already in use before).
Syntax-Example 2
ON - APOS 10000 GOSUB hitinfo
ON + APOS 10000 GOSUB hitinfo
...
ON + APOS 10000 GOSUB hitposdir
// Re-routed interrupt #2
Result:
As soon as the second definition of the 'ON + APOS
10000 ...' is executed, the interrupt #2 is "re-routed"
to the newly defined subprogram 'hitposdir'. It is still
the same interrupt (i.e. not an additional one), which
calls up another subprogram now. The "old" defini-
tion of interrupt #1 'ON - APOS 10000 GOSUB
hitinfo' is still valid without any modification.
MG.10.J8.02 – VLT is a registered Danfoss trade mark
Programmable SyncPos motion controller
■ ■ ■ ■ ■ ON ERROR GOSUB
By using the ERROR GOSUB instruction, a sub-
routine 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
// Interrupt #1
– instead, the defined subroutine will be called up.
// Interrupt #2
Within this subroutine, it is possible to target the re-
// Interrupt #3
action to the error, to wait for user intervention via
// Interrupt #4
ERRCLR (clear error) or, in the case of non-
// Interrupt #5
correctable errors, to abort the program via the EXIT
// Interrupt #6
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)
Summary
Definition of an error subroutine
Syntax
ON ERROR GOSUB name
Parameter
name = name of the subroutine
Priority
Error subroutines cannot be interrupted through any
other interrupts.
Peculiarities
// Interrupt #1
The ON ERROR GOSUB instruction should be at the
// Interrupt #2
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 subroutine requires a
maximum of 2 milliseconds.
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!
During the execution of an error routine
NOWAIT is automatically set to ON.
129
Need help?
Do you have a question about the VLT5000 SyncPos and is the answer not in the manual?
Questions and answers