Rockwell Automation 1747-PBASE BASIC Development Software Programming Manual User Manual

Page 113

Advertising
background image

Publication 1746-PM001A-US-P

Communicating with the Module 9-13

14. Move the cursor down to anywhere on the line

next x

and then press [

F4

].

This causes the program to execute until it reaches the line you marked (

next

x

in this case). The Terminal mode screen appears, and the executing program

prompts you to enter a number.

15. Type the number

3

and press

[Enter]

. The Debugger screen returns, the line

next x

is highlighted, the value for

x

in the watch window is

1

, and the value

for

y

is

3

. You are stopped during program execution at the first encounter of

the line

next x

.

16. Press [

F4

] again. This time

x

is

2

. Continue pressing [

F4

] until you fall through

the for/next loop, get the number is odd message, and are prompted to enter
another number.

17. Type the number

6

and press

[Enter]

. The Debugger screen returns, the value

for

x

in the watch window is

1,

and the value for

y

is

6

.

18. Press [

F7

]. This traces you through the program one line at a time, flashing to

the Terminal mode screen to execute, and then returning to the debugger.
There you see the value for

x

changing each time the trace passes through the

for/next loop.

19. Keep pressing [

F7

] until you trace through the program to completion. Note

that the debugger is terminated and you are returned to Terminal mode.

20. Repeat steps 4 and 5 to return to the debugger.

21. Press [

F5

]. This temporarily returns you to the Terminal mode screen. Press

any key to bring the debugger back.

22. Press [

F6

]. You see a search screen identical to the one in the BASIC

Development Software. You can use this to search for any characters in your
program, such as the variables you want to enter into the watch window. To
cancel the search press [

Esc

].

23. Press [

F8

]. Your screen is now split into three sections, with the translated

BASIC program at the top, your .BDL file in the middle, and the watch
window at the bottom.

24. Press

[Tab]

to move the cursor to each of the three windows. You can now

select variables from either the .BAS file or the .BDL file appearing on the
screen, prior to pressing [

F2

] (to examine) or pressing [

F3

] (to watch).

25. Press [

F8

] again. Now only the BASIC program is on the screen with the watch

window. To return to the original debugger screen, press [

F8

] again.

26. Press [

F9

] to run the program to completion and exit the debugger. You also

can exit the debugger at any time by pressing [

Esc

] or [

F10

].

Advertising