Elmo HARSFEN0602 Network Hardware User Manual


 
HARSFEN0602
6 Program Development and Execution
The process of program development includes the following steps:
Program editing – Writing\editing the program.
Compilation – Let the Compiler process the program and find errors
Program loading – Load the program to the Amplifier Flash memory.
Debugging – Observe the program behavior, and correct where necessary
Running the program
Save to flash – Make the program reside permanently in the Amplifier.
6.1 Editing a Program
The Amplifier program is a simple text. Any text editor can be used to write the Amplifier program.
The Composer program has a development environment for Amplifier programs, which includes a program
editor. We recommend using the development environment of the Composer, since it provides several
services like downloading the program to the Amplifier, compiling the program and running it.
6.2 Compilation
Each user program after editing must be compiled.
The Compiler is described here, although id does not reside in the DSP software. The compiler is external
stand-alone software that may be called, for example by the Composer software. User can write and compile
program in the off-line mode (without communication establishing with Amplifier)
The Compiler compiles a program in order to produce address maps and run-time code. If in the course of
the compilation it finds syntax errors, it stops the compilation and informs the user about errors and presents
them in convenient form.
The compiler accepts the user program as text file and several files with Target Harmonica Information. This
information is required to assure that the produced compiled code can run on the Harmonica.
The Compiler outputs are two files:
CompileStat.txt and CompileCode.img.
The
CompileStat.txt file tells the compilation status. It reports success or failure and if the compilation failed
it tells what were the errors.
The
CompileCode.img exists only if compilation succeeded. It contains the compiled image file, to be
downloaded directly to the Harmonica. The description of the contents image file see at User Partition of the
Flash
The compiler catches syntax errors. It cannot catch:
Out of range command arguments
Bad command contexts like an attempt to begin a motion while the motor is off.
Such errors must be corrected in the debugging stage.
6.2.1 Compilation Error List
The list of the compilation errors is represented below:
Error
code
Error string Meaning and example
0 No errors Successful compilation without errors
1 Bad format This is general error for bad syntax at right or left hand expression.
For example,
for k = 1::10
There is double colon symbol between ‘1’ and ‘10’
b = a + ()