Specifications
Adding a Probe Point for File I/O
4-6
4.3 Adding a Probe Point for File I/O
In this section, you add a Probe Point, which reads data from a file on your
PC. Probe Points are a useful tool for algorithm development. You can use
them in the following ways:
❏
To transfer input data from a file on the host PC to a buffer on the target
for use by the algorithm
❏
To transfer output data from a buffer on the target to a file on the host PC
for analysis
❏
To update a window, such as a graph, with data
Probe Points are similar to breakpoints in that they both halt the target to
perform their action. However, Probe Points differ from breakpoints in the
following ways:
❏
Probe Points halt the target momentarily, perform a single action, and
resume target execution.
❏
Breakpoints halt the CPU until execution is manually resumed and cause
all open windows to be updated.
❏
Probe Points permit automatic file input or output to be performed;
breakpoints do not.
This chapter shows how to use a Probe Point to transfer the contents of a PC
file to the target for use as test data. It also uses a breakpoint to update all the
open windows when the Probe Point is reached. These windows include
graphs of the input and output data. Chapter 7 shows two other ways to
manage input and output streams.
1) Choose Project
→
Rebuild All or click the (Rebuild All) toolbar button.
2) Choose File
→
Load Program. Select the program you just rebuilt,
volume.out, and click Open.
3) Double-click on the volume.c file in the Project View.
4) Put your cursor in the line of the main function that says:
dataIO();
The dataIO function acts as a placeholder. You add to it later. For now, it
is a convenient place to connect a Probe Point that injects data from a PC
file.
5) Click the (Toggle Probe Point) toolbar button. The line is highlighted
in blue.