Danfoss VLT 5000 Series Manual page 96

Synchronizing and positioning option onizing and positioning option
Hide thumbs Also See for VLT 5000 Series:
Table of Contents

Advertisement

I I I I I 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)
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.
96
VLT
®
5000 SyncPos option
A minimal signal length of 1 msec is necessary for
the sure identification of a level change! The chap-
ter input/output terminal contain more information
concerning the input circuit and input technical
data.
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
INT
Cross Index
SUBPROG...RETURN, 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
SUBMAINPROG
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
MG.10.J4.02 – VLT is a registered Danfoss trade mark

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents