Download Print this page

Danfoss MCO 305 Design Manual page 133

Hide thumbs Also See for MCO 305:

Advertisement

MCO 305 Design Guide
ON INT . . GOSUB
Summary
Syntax
Parameter
Description
Priority
Command Group
Cross Index
Syntax Example
Program Sample
__ Software Reference __
Defining an interrupt input
ON INT n GOSUB name
n =
number of the input to be monitored; (input area –8 ... 8 and FC 300
inputs 18 ... 33 and –33 ... –18)
positive input numbers (1 ... 8) = reaction to the rising edge
negative input numbers (–1 ... 8) = reaction to the falling edge
name =
subroutine name
By using the ON INT GOSUB instruction, a subroutine 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, following this definition, a corres-
ponding interrupt occurs, then the accompanying subroutine is called up and pro-
cessed. After the last subroutine command (RETURN), the program will continue
from the point of interrupt.
NB!:
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 FC 300 input add additional
2 ms, in worst case.
A minimal signal length of 1 ms is necessary for the sure identification of a level
change! The chapter input/output terminal contains more information concerning
the input circuit and input technical data.
NB!:
The instruction for ON INT GOSUB is edge and not level triggered.
During the execution of a subroutine called by an interrupt NOWAIT is
automatically set to ON.
If a number of interrupts occur simultaneously, the subprogram assigned to the
lowest bit is worked through first. The other interrupts will be processed after-
wards. If, during an interrupt subroutine, the same interrupt occurs (exception:
error interrupt), then it will be ignored and thus lost.
INT
SUBPROG..RETURN, ON ERROR .. GOSUB, WAITI, DISABLE interrupts, ENABLE
interrupts, Priorities of Interrupts, NOWAIT
ON INT 4 GOSUB posin
ON INT –5 GOSUB negin
command line 1
command line n
SUBMAINPROG
SUBPROG posin
command line 1
command line n
RETURN
SUBPROG negin
command lines 1 ... n
RETURN
ENDPROG
ONINT_01.M, DELAY_01.M
®
MG.33.L4.02 – VLT
is a registered Danfoss trademark
/* Definition of Input 4 (positive edge) */
/* Definition of input 5 (negative edge) */
/* subroutine must be defined */
133

Advertisement

loading