Debugging
Epson RC+ 8.0 supports source level debugging. You can set breakpoints and step through your source code. You can also pause / continue a program or halt a task using the Task Manager.
Setting and clearing breakpoints
Open the program where you want to set a breakpoint, and then click on the line where you want to stop. Use one of the following methods to set a breakpoint:
When the mouse hovers over the left edge of a line (row), a gray circle appears. When clicked, it changes to a breakpoint icon.
Press the [F9] key.
Epson RC+ 8.0 menu - [Run] - [Toggle Breakpoint]
Breakpoints are cleared when setup is performed again on lines where the breakpoints were set. To clear all breakpoints, select [Clear All Breakpoints] from the [Run] menu.
You cannot set a breakpoint on non-executing statements, such as #define, #include, or blank lines.
After setting a breakpoint, the task will halt when the execution line is reached the breakpoint. You can set or clear a breakpoint while a task is running.
When reached a breakpoint, the program window containing the program source line at the breakpoint is opened and the line is highlighted in yellow. Task numbers are displayed in the [Halted tasks] menu.
When multiple tasks have reached a breakpoint, you can confirm each task from [Halted tasks]. When you switch tasks in [Halted tasks], the location where the breakpoint stopped is displayed.
If you select task 1 from [Halted tasks] :
If you select task 2 from [Halted tasks] :
Stepping through a program
There are three commands on the [Run] Menu that are used for stepping through code.
- [Step Into] steps through each line and also steps into functions when a step is executed on a Call statement.
- [Step Over] steps through each line but when a Call statement is encountered, the function in the statement is executed completely.
- Walk executes lines until after the next motion command and then halts the task. It will halt after the next output command if the [Setup]-[System Configuration]-[Controller]-[Preferences]-[Walk stops for outputs] checkbox is checked.
To step through code, you must set a breakpoint and run until the breakpoint is reached, or suspend a task from the Task Manager using the [Halt] button.
Viewing the Call Stack
Sometimes you may want to examine the call stack for the current task after you halt the task from the task manager, or reach a break point.
To view the call stack, select [Call Stack] from the [Run] Menu. The [Call Stack] list will be displayed, as shown below.
After you double click a function in the Call Stack list, the function will be displayed in a program window. The cursor moves to the line in the call stack where the next called function is located. In the example below, the SingleCycle function points to the Gripper On statement, indicating that Gripper was called from SingleCycle.
Displaying variables
To view variable values, you can do one of the following:
When a task is halted by halt or breakpoint, you can view the value for a variable by moving the mouse cursor over the variable name. The value will be displayed in a tool tip type window above the variable name.
Select [Display Variables] from the [Run] menu to display the variable display dialog. This dialog has the following tabs: [Global], [Preserved], [Module], and [Local].
KEY POINTS
Up to 600 variables can be displayed on each tab.
You can change the value of a variable by checking the [Edit] checkbox. Enter the new value in the [Value] column. Next, click the [Write] button to change the variable. When the [Edit] box is checked, the variable values are not automatically updated. You can update all values by clicking the [Refresh] button.