To watch local and global variables while debugging code is a standard debug practice. There are various methods for doing this in CCS, such as memory views and watch views. Additionally, CCS has the ability to make time (and frequency) domain plots. This ability allows the user to view waveforms using the graph tool.
- Click View → Expressions on the menu bar to open an Expressions watch window . Move the mouse to the Expressions window to view the variables being used in the project. Add variables to the Expressions window as shown in Figure 3-24. The window uses the number format associated with variables during declaration, and Figure 3-24 shows an example of the Expressions window. Select a desired number format for the variable by right clicking on expressions and choosing.
- Alternately, a group of variables can be imported into the Expressions window by right clicking within the Expressions window and clicking Import, and browse to the directory of the project at <install_location>\solutions\tida_010265_wminv\src_control\common\debug and pick BuildLevel1.txt and click the OK button to import the variables shown in Figure 3-24.
Note: Some of the variables have not been initialized at this point in the main code and can contain some useless values.
- The structure variables motorVars_M1[] have references to most variables that are related to controlling the motor. By expanding this variable, you can see and edit all the variables, as needed.
- Click on the Continuous Refresh button in the expressions window. This enables the window to run with real-time mode. By clicking the down arrow in this Expressions window, you can select Customize Continuous Refresh Interval and edit the refresh rate of the expressions window. Choosing too fast an interval can affect performance.