Ondf1 – Rockwell Automation 1771-DB BASIC MODULE User Manual

Page 174

Advertising
background image

Chapter
Statements

11

11 -22

Use the ONDF1 statement to enable or disable the DF1 packet interrupt
capability. (ONDF1 is equivalent to CALL 16, page 12 -10). You process
the packet in an interrupt routine. Input the line number you want the
program to jump to when a PRT2 receives a valid DF1 packet after the
ONDF1 statement. Once you enable the DF1 packet interrupt, the BASIC
module processor checks the port PRT2 receive buffer for a DF1 packet at
the end of each line of BASIC. Execute a RETI (page 11 -33) within the
interrupt routine to return to the point in the program before the interrupt
occurred. To disable the DF1 packet interrupt input line number 0 after the
DF1 statement. This statement has no effect if the DF1 protocol is not
enabled (see CALL 108, page 13 -38) and JW4 (page 1 -6) is not in the
correct position.

If the DF1 packet arrives due to a CALL 122 (page 13 -58) or 123
(page 13 -66), when ONDF1 is enabled, you receive the DF1 packet
interrupt, but the DF1 packet has already been removed from the receive
buffer.

When you enter Run mode ONDF1 is disabled until you enable it.
ONDF1 is disabled when the BASIC module is in Command mode.

Syntax

ONDF1

ln num

Example

>1 REM EXAMPLE PROGRAM

>10 REM ENABLE DF1 PACKET INTERRUPT

>20 ONDF1 800:REM LINE NUMBER OF START OF INTERRUPT ROUTINE

>800 (BEGINNING OF INTERRUPT ROUTINE)

.

. (PROCESS THE PACKET)

.

>850 RETI

ONDF1

Advertising