Reti – Rockwell Automation 1771-DB BASIC MODULE User Manual

Page 185

Advertising
background image

Chapter
Statements

11

11 -33

Use the RETI statement to exit from an interrupt (ONDF1 (page 11 -22),
ONTIME (page 11 -25), CALL 16 (page 12 -10,) or CALL 32 (page
12 -12) that is processed in a BASIC module program. The RETI
statement functions the same as the RETURN statement (page 11 -34)
except that it also clears a software interrupt flag so interrupts can again be
acknowledged. If you do not execute the RETI statement in the interrupt
procedure, all future interrupts are ignored.

Syntax

RETI

Example

>1 REM EXAMPLE PROGRAM

>10 TIME=0 : CLOCK1 : ONTIME 2, 100 : DO

>20 WHILE TIME<10 : END

>100 PRINT “TIMER INTERRUPT AT -”, TIME,“ SECONDS”

>110 ONTIME TIME+2, 100 : RETI

>RUN

TIMER INTERRUPT AT - 2.045 SECONDS

TIMER INTERRUPT AT - 4.045 SECONDS

TIMER INTERRUPT AT - 6.045 SECONDS

TIMER INTERRUPT AT - 8.045 SECONDS

TIMER INTERRUPT AT - 10.045 SECONDS

READY

RETI

Advertising