beautypg.com

ProSoft Technology MVI56-BAS User Manual

Page 37

background image

MVI56-BAS ♦ ControlLogix Platform

BASIC Programming

BASIC Module (DB/BAS Compatible)

User Manual

ProSoft Technology, Inc.

Page 37 of 234

December 13, 2011

3.4

ControlLogix Processor Interrupt

The MVI56-BAS allows the ControlLogix to interrupt the current BASIC program

using CALL 20 (Enable Processor Interrupt). When word 0 bit 15 in the output

image (Local:x:O:Data[0].15) toggles from OFF to ON, the program jumps to the

line number specified by the CALL 20 parameter.
Use the

RETI

command in order to return to the point the program was before

being interrupted.
The following BASIC program shows how to use CALL 20:

10 PUSH 50: REM JUMPS TO LINE NUMBER 50
20 CALL 20
30 GOTO 30
35 PRINT "LINE 35"
40 PRINT "LINE 40"
50 PRINT "LINE 50"
60 PRINT "LINE 60"
70 RETI
80 END

While the program is running, the following ladder logic is executed:

The result is:

LINE 50
LINE 60

To disable the processor interrupt, use CALL 21 (Disable Processor Interrupt).

This routine has no arguments and does not return any value.
Refer to BASIC CALLs Syntax (page 105) for more information about CALLs 20

and 21.