
MCO 305 Design Guide
__ Software Reference __
MG.33.L4.02 – VLT
®
is a registered Danfoss trademark
131
Re-routing of an
ON ... APOS ...
GOSUB
It is possible to ‘re-route’ a position interrupt to another subprogram. This does not
define a new interrupt, but just modifies the subprogram, which has to be
executed in case of interrupt detection.
The command syntax is the same like for the ON APOS command:
ON sign APOS xxx GOSUB newname
The parameters ‘sign’ and ‘xxx’ have to be exactly the same like within the original
definition. The position which is concerned is identified by these two parameters.
The parameter ‘newname’ has to hold the updated name of the subprogram, which
has to be called up in case of the interrupt, takes place. Please see sample 2.
NB!:
Only position interrupts can be re-routed, but no other type of interrupt .
Command Group
INT
Cross Index
ON APOS .., ON MAPOS .., ON MCPOS .., ON INT ..
Syntax Example 1
ON – APOS 20000
GOSUB hitinfo
// Interrupt #1
ON – APOS 10000
GOSUB hitinfo
// Interrupt #2
ON + APOS 10000
GOSUB hitinfo
// Interrupt #3
ON + APOS 0
GOSUB hitzero
// Interrupt #4
ON – APOS 0
GOSUB hitzero
// Interrupt #5
ON INT 3
GOSUB hitinfo
// Interrupt #6
…
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 interrupts
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
// Interrupt #1
ON + APOS 10000 GOSUB hitinfo
// Interrupt #2
…
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” definition of interrupt #1 ‘ON – APOS 10000 GOSUB hitinfo’ is still
valid without any modification.
Summary of Contents for MCO 305
Page 4: ......