131
MG.10.J8.02 – VLT is a registered Danfoss trade mark
Programmable SyncPos motion controller
NB!
The instruction for ON INT GOSUB is edge
and not level triggered.
NB!
During the execution of a subroutine called
by an interrupt NOWAIT is automatically
set to ON.
Command group
I NT
Cross Index
SUBPROG…R ETURN, ON ERROR GOSUB,
WAITI
Syntax-Example
ON INT 4 GOSUB posin
/* Definition of Input 4 (positive edge) */
ON INT -5 GOSUB negin
/* Definition of input 5 (negative edge) */
command line 1
command line n
subroutine must be defined
SUB MAI N P ROG
SUBPROG posin
command line 1
command line n
RETURN
SUBPROG negin
command line 1
command line n
RETURN
ENDPROG
Program sample
ONINT_01.M
DELAY_01.M, GSVEL_01.M
■
■
■
■
■
ON MAPOS .. GOSUB
It is possible to call up a subprogram with the in-
struction ON MAPOS, if a specific master position
(MU) has been passed in positive or negative direc-
tion. For example, in order to set an output at any
point in the case of a linear drive (slave) with a
traversing range from 0 to 10000 UU.
NB!
An ON MAPOS Interrupt can be deleted with
the command ON DELETE .. GOSUB ...
Summary
Call up a subprogram when the master position xxx
(MU) is passed.
Syntax
ON sign MAPOS xxx GOSUB name
Parameter
sign =
+
when the master position xxx is
passed in positive direction
–
when the master position xxx is
passed in negative direction
xxx =
master position in MU
name =
name of the subprogram
100
xxx
0
<- - - - - -
- - - - - -
- - - - - -
- - - - - -
- - - - - - positive direction
- - - - - - >
- - - - - - >
- - - - - - >
- - - - - - >
- - - - - - > negative direction
Peculiarities
The subroutine to be called up must be defined
within the SUBMAINPROG and ENDPROG identified
program.
NB!
During the execution of subprograms
triggered by an interrupt, NOWAIT ON is set
automatically.
Command group
I NT
Cross index
SUBPROG…RETURN, DISABLE ENABLE, Priorities
of interrupts, ON DELETE .. GOSUB
Syntax Example
ON +MAPOS 1200 GOSUB name
// Always call up subprogram at position 1200
Software Reference