Call 16 – enable df1 packet interrupt, Call 16 – enable df1 packet interrupt -2, Purpose – Rockwell Automation 1746-BAS BASIC LANGUAGE User Manual

Page 98: Syntax, Example

Advertising
background image

Publication 1746-RM001A-US-P

8-2 Execution Control and Interrupt Support Functions

CALL 16 – Enable DF1
Packet Interrupt

Purpose

Use CALL 16 to enable the DF1 packet interrupt capability. One argument is
PUSHed and no arguments are POPped. The input argument is the BASIC line
number of the beginning of the interrupt routine that the program should jump to,
when a valid DF1 packet is received in the port PRT2 buffer. You should process
the packet within the interrupt routine. A RETI executed within the routine
returns you to the point in the program before the interrupt occurred. This
command has no effect if the DF1 protocol is not enabled (CALL 108). Also,
jumper JW4 must be in a position enabling DF1 for port PRT2.

Once this CALL is enabled, port PRT2 is checked by the processor at the end of
each line of BASIC code for a DF1 message received.

If the DF1 packet arrives due to CALL 122 or CALL 123 when CALL 16 is
enabled, you will receive the DF1 packet interrupt but the DF1 packet will have
been removed from the input buffer.

Interrupts are disabled when the module is in Command mode. CALL 16 disabled
is the default of the module when entering Run mode. CALL 16 must be
re-executed every time Run mode is entered.

Syntax

PUSH [BASIC line number]
CALL 16

Example

>1

REM EXAMPLE PROGRAM

>10

REM ENABLE DF1 PACKET INTERRUPT

>20

PUSH 800: REM LINE NUMBER OF START OF DF1 INTERRUPT ROUTINE

>30

CALL 16

>800 (BEGINNING OF INTERRUPT ROUTINE)

:

(PROCESS THE PACKET)

>850 RETI

Advertising