AKD BASIC User Guide | 6 AKD BASIC Parameters, Operators, Statements
6.20.2 Interrupt...End Interrupt
General Information
Type Statement
Description
The interrupt feature permits execution of a user-defined subroutine upon receipt
of a hardware interrupt signal or a pre-defined interrupt event.
Units N/A
Range N/A
Default
Value
N/A
Data Type N/A
Description
The Interrupt statment marks the beginning of an Interrupt Service Routine. The Interrupt Serv-
ice Routine is defined by a program structure resembling a subroutine. The interrupt feature per-
mits execution of a user-defined subroutine upon receipt of a hardware interrupt signal or a pre-
defined interrupt event.
Interrupts are triggered by pre-defined events or external hardware sources. The interrupt-
source-name and interrupt enable flag are unique for each interrupt source.
Receiving an interrupt will suspend program execution and the interrupt service routine will be
executed. Then program execution will resume at the point that it was interrupted.
Interrupts are enabled (or disabled) by setting (or clearing) the associated interrupt enable flag.
Interrupts are disabled until explicitly enabled. After an interrupt is triggered it is automatically
disabled until it is enabled again in your program.
Example
Main
DRV.TIME = 0
INTR.DIN1LO = 1
while 1
pause(0.5)
DOUT1.STATE=0 : Pause(0.005) : DOUT1.STATE=1
wend
end main
'-------------- Interrupt Routines ------------
-------
Interrupt DIN1LO
print "I'm awake"
If DRV.TIME > 10 then
print "OK. That's it."
else
INTR.DIN1LO = 1
end if
End Interrupt
Related Topics
Interrupt {Source} | Sub...End Sub | Restart
Kollmorgenâ„¢ | March 30, 2012 332