List – Rockwell Automation 1771-DB BASIC MODULE User Manual
Page 139
Chapter
Commands
10
10 -9
Use the LIST command to print the program to the console device.
Spaces are inserted after the line number and before and after statements.
This helps in the debugging of BASIC module programs. You can
terminate the listing of a program at any time by pressing
Ctrl
+
C
(page 10 -4) on the console device. You can interrupt and continue the
listing using
Ctrl
+
S
(page 10 -6) and
Ctrl
+
Q
(page 10 -5 ).
Important:
Ctrl
+
C
terminates the listing if
Ctrl
+
C
checking
is enabled.
Ctrl
+
S
halts the listing until
Ctrl
+
Q
is pressed if
software handshaking in enabled.
Syntax
Command variation
Description
LIST
Return
lists the entire program
LIST
ln num
Return
lists the line number specified to the end
of the program
LIST
ln num – ln num
Return
lists the program from the first designated
line number to the second designated
line number
Important: you must separate the two
line numbers with a dash (–)
Use the
LIST@
command to print the program to the device attached to
port PRT1. Use the
LIST#
command to print the program to the device
attached to port PRT2. You must configure the port parameters to match
your particular list device. These parameters (communication rate, parity,
stop bits, and so on) can be set using the MODE statement (page 11 -20).
Example
>LIST
10 PRINT “LOOP PROGRAM”
20 FOR I = 1 TO 3
30 PRINT I
>LIST 20-40
40 NEXT I
20 FOR I = 1 TO 3
50 END
30 PRINT I
READY
40 NEXT I
READY
>LIST 30
30 PRINT I
40 NEXT I
50 END
READY
LIST