It is standard debug practice to watch
local and global variables while debugging code. There are various methods for doing
this in CCS, such as memory views and watch views. Additionally, CCS has the ability
to create time (and frequency) domain plots. This ability allows the user to view
waveforms using the graph tool. For information on how to set up and configure the
graph tool, see Section 3.4.1. For information on setting up the Expressions window, see the instructions
below.
- Setup watch window: Click
View → Expressions on the menu bar to open an Expressions watch
window. Variables can be added to the Expressions window by clicking Add new
expression within the Expressions window and typing the name of the
variable and then pressing enter. The number format that the variable value is
displayed in is based on the number format associated with the variable when it
was declared. You can change the desired number format for a particular variable
by right clicking on the variable and navigating to Number Format and
selecting the desired format.
- Alternately, a group of variables
can be imported into the Expressions window by right clicking within the
Expressions window and clicking Import, browse to the directory of the project
at
<install_location>\solutions\universal_motorcontrol_lab\common\debug\,
select the universal_lab_level1.txt file, and click OK to import the
variables shown in Figure 3-30.
Note: Some of the
variables have not been initialized at this point in the main code and may
contain some useless values.
Note: The structure of variables motorVars_M1 has
references to most variables that are related to controlling motor
drive.
- Click on the Continuous Refresh
button in the top right corner of the Expressions Window
tab to enable periodic capture of data from the Microcontroller. By clicking the
"View Menu" button (the three dots in the upper right hand corner of the
Expressions window),you can select Continuous Refresh Interval and edit
the refresh rate of the Expressions window. Note that choosing too fast an
interval may affect performance.