5 building a program, 6 running a program, 7 debugging – ElmoMC SimplIQ Servo Drives Composer User Manual User Manual

Page 89

Advertising
background image

When error messages occur during program execution and the program source needs to
be fixed, you can double-click on the error message to locate the error in your program.
When a Build operation finishes successfully with no errors, you can then execute the
program (

section

4.2.6

) or run it using the Debug option (

section

4.2.7

).

4.2.5 Building a Program

The Build option enables you to have the Elmo Studio compile the program and
automatically download it to the connected drive. To build a program, click or select
Build - Build. The Elmo Studio will first compile the program. If no errors occur, it will
then send the program to the Servo drive where it will be saved in the drive memory. If
errors do occur during compiling, the Elmo Studio will record the errors and enter
pointers in the program at locations where the errors occurred. It will then halt and will
not download the program.

4.2.6 Running a Program

To run a program after it has been downloaded to a drive, click or select Build -
Execute
. The program will run independently of all debug options (such as Breakpoint
and Step-by-step).

To stop a program while it is running, click or select Build - Kill Program.

4.2.7 Debugging

The Elmo Studio contains powerful tools for debugging the programs that you create and
edit. It enables you to mark your program with breakpoints, and to control the
debugging process according to your needs. Basically, you perform debugging according
to the following steps:
1. Identify the section of the program where you suspect that a problem lies. This may

be according to run-time error messages that you receive from the drive.

2. Mark the first instruction of that section with a breakpoint, clicking anywhere in the

line and then clicking , pressing <F9> or selecting Build - Debug - Set/Reset
Breakpoint
. (You can cancel a breakpoint by repeating this action.)

3. You may also drag-and-drop variables from the program into the Watch window at

the bottom. These are variables whose values you wish to know each time the
program is suspended.

4. Start the debugging operation by clicking or selecting Build - Debug - Go. The

debugger will execute the program until it reaches the first breakpoint, at which time
program execution is halted. Each time the program you are debugging stops at a
breakpoint, the debugger will update the Debug tag of the Output window with the
relevant progress message. It will also indicate — with a yellow arrow and red
highlight — the line of code at which the program stopped. Functions not yet
returned will be displayed in the Stack window.

5. From here, you can use the relevant toolbar buttons or Build - Debug options (

Table

4-4

) to step through the program and continue the debugging operation manually.

Elmo Composer User Manual

Using the Elmo Studio

MAN-COMPUM (Ver. 1.9)

4-10

Advertising