Debugging
a Program
The ICON program is always running
unless stopped in Debug Mode. Notice the status indicator in
the upper middle of the screen. This indicates whether the program
is running or stopped. When you exit Debug Mode, the program
automatically begins running should you forget to restart it.
Also, if your computer crashes or loses connection with the
ICON, it will restart the program in two minutes.
To enter Debug mode, click on
the "Debug" tab. Now the following functions are available to
you by Right Clicking on the program:
Inspect Variable
(Ctrl V)
Select the instruction whose variable
values you want to view. Select Inspect Variables from the right
click menu (or Ctrl V). A window will appear listing
all the variables for that instruction and their values. Click
the button under "Expand" to see the entire subset of values
for a subscripted variable (up to 128 subscripts). You can change
the values for any or all variables. Clicking "Update" will
write your new values to the variables without closing the window.
If the program is in "Run" mode
the variable values will be continuously and automatically updated.
If the program is stopped you may use the "Step" button. Clicking
the "Step" button will cause the next instruction to execute
and update the variable value window to show the variables and
values for that instruction.
Step (Ctrl
S)
This function can be called directly
as well as from the Inspect Variable window as described above.
Again, Step will only work if the program is stopped. This function,
on its own, allows you to move through several instructions
quickly. Use Inspect Variables to see the results of instruction
execution.
Run (Ctrl
R)
This function starts the program
from its beginning. Certain instructions "initialize" themselves
on start-up, meaning that the variables are given an initial
value the first time through the program. The Run function causes
these instructions to initialize. The Continue function does
not. Run does not initialize all variables to 0 as is done after
a program load, however.
Stop (Ctrl
P)
This function stops the program
from executing. The last instruction to be executed is brought
to the top of the screen. Where you place your cursor before
using this function has no effect on where the program stops.
Continue (Ctrl
C)
This function starts the program
where it left off when the Stop function was used. It does not
cause instructions to initialize as described under Run.
Set Break (Ctrl
B)
Highlight the last instruction
you want executed. Use the Set Break function. The program will
run until the selected instruction is executed. Then the program
stops and the selected line moves to the top of the screen.
Notice the "Break Point" status in the lower left. This function
allows you to run the program live, stop it at a pre-determined
point and analyze what happened. Often Inspect Variable is used
at this point.
Delete Break
(Ctrl D)
This function simply removes the
Break Point you have set. Select Continue or Run to start program
running if stopped.
Loop Position,
Module Position and Instruction Position
These functions are the same as
in Program Mode and are used to rapidly move to a new position
in the program for single step or break point operations.
|