Programmable SyncPos motion controller
MG.10.J8.02 – VLT is a registered Danfoss trade mark
130
NB!
The ON ERROR GOSUB xx routine does not
terminate the HOME and INDEX command.
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
I NT
Cross Index
SUBPROG…RETURN, ERRCLR, ERRNO,
CONTINUE, EXIT
Syntax-Example
ON ERROR GOSUB errhandle
/* definition of an error subroutine */
command line 1
command line n
SUBMAINPROG
/* subroutine errhandle must be defined */
SUBPROG errhandle
command line 1
command line n
RETURN
ENDPROG
Program sample
ERROR_01.M
IF_01.M, INDEX_01.M
■
■
■
■
■
ON INT .. GOSUB
By using the ON INT GOSUB instruction, a subrou-
tine must be defined which will be called up when
an edge is detected at the monitored input.
A maximum of one subroutine per input can be
defined. It is not possible to define an interrupt for
the falling and the rising edges of the same input
This definition can take place at any time. If, follo-
wing this definition, a corresponding interrupt occurs,
then the accompanying subroutine is called up and
processed. After the last subroutine command
(RETURN), the program will continue from the point
of interrupt.
Summary
Defining an interrupt input
Syntax
ON INT n GOSUB name
Parameter
n
= number of the input to be monitored;
(input area –8 … 8
and VLT inputs 16 … 33 and –33 …–16)
positive input numbers (1 … 8) =
reaction to the rising edge
negative input numbers (–1 … 8) =
reaction to the falling edge
name
= subroutine name
Priority
If a number of interrupts occur simultaneously, the
subprogram assigned to the lowest bit is worked
through first. The other interrupts will be processed
afterwards. If, during an interrupt subroutine, the
same interrupt occurs (exception: error interrupt),
then it will be ignored and thus lost.
Peculiarities
The ON INT GOSUB instruction should be at the
start of the program, so that it has validity for the
entire program.
The subroutine to be called up must be defined
within the SUBMAINPROG and ENDPROG identified
program.
The identification of an interrupt and the call up of
the corresponding subroutine requires a maximum
of 2 milliseconds. Interrupt from VLT input add addi-
tional 2 ms, in worst case.
A minimal signal length of 1 msec is necessary for
the sure identification of a level change! The chapter
input/output terminal contain more information con-
cerning the input circuit and input technical data.
Software Reference