![background image](http://html1.mh-extra.com/html/omron/r88a-mcw151-drt-e/r88a-mcw151-drt-e_operation-manual_742243222.webp)
207
Motion Perfect Tools
Section 7-5
Replacing Text
Text found in an Editor Window can be replaced with a specified text string.
Enter both strings in the appropriate fields. The following buttons are available
in the Find and Replace Window:
Run, Step and Stop
These operations are used to run the program, run a single line in the pro-
gram and stop the program. These operations can also be found on the con-
trol panel (same buttons).
Add breakpoint
In the Editor Window breakpoints can be added to enable easy debugging.
Debugging is explained in the Debugging part of this section below.
Compiling
This operation forces the program to be compiled.
Debugging
The Motion Perfect debugger allows you to run a program directly from the
Editor Window in a special trace mode, executing one line at a time (known as
stepping) whilst viewing the line in the window. It is also possible to set break-
points in the program, and run it at normal speed until it reached the break-
point.
Any open Editor Windows will automatically enter the 'Debug Mode - Read
Only' when programs are running on the Motion Controller. Hence, break-
points are set in the Editor Window, and the code viewed in the same window
in debug mode when the program is running.
Stepping Through a
Program
The next line in a program can be executed by doing one of the following:
• Use the Step button (yellow) alongside the required program name in the
Program List box on the Control Panel.
• If the required program is currently selected, see Selected Program box
of the Control Panel, then push the Step button of this box.
• Push the Step button of the Editor Window toolbar.
• Selecting Start Stepping... from the Program menu. If one program is exe-
cuting on several tasks, then the task number can also be specified.
The next program line to be executed will be highlighted in the Editor Window
with a green background. The operation can be repeated to step multiple
lines.
Breakpoints
Breakpoints are special place markers in the code which allow us to identify a
particular section (or sections) of the program when debugging the code. At
the point on which the breakpoint is inserted, the program will pause and
return control to Motion Perfect. This is enabling to check the current state of
the controller or single step through the code of the program. Breakpoints are
indicated in the program using the TRON command.
Breakpoints can be set by moving the cursor to the required line, and then
either
• Typing command TRON on this line.
• Pushing the Add Breakpoint button on the Editor Window toolbar.
• Selecting Toggle Breakpoint from the Program Menu.
• Pressing Ctrl–B from the keyboard.
A TRON command will be inserted at the current line in the program, indi-
cated by highlighting. The breakpoint can be removed to selecting the same
Button
Function
FindNext
A simple search will be made for the specified string.
Replace
A specified search string will be replaced with a replace string.
ReplaceAll All occurrences of the search string will be replaced from the
current cursor position to the beginning or end of the program,
depending upon the search direction.