MATLAB Link for Code Composer Studio Development Tools    

Closing the Links or Cleaning Up

One of the most important programmatic processes you should do in every RTDX session is to clean up at the end. Cleaning up includes stopping your target processor, disabling the RTDX channels you enabled, disabling RTDX and closing your open channels. Performing this series of tasks ensures that future processes avoid trouble caused by unexpected interactions with left-over handles, channels, and links from your earlier development work. Best practices suggest that you include the following tasks (or an appropriate subset that meets your development needs) in your development scripts and programs.

We use four functions in this section; each has a purpose--the operational details in the following list explain how and why we use each one. They are

Use the following procedure to shut down communications between MATLAB and the target, and end your session:

  1. Begin the process of shutting down the target and RTDX by stopping the target processor. Type the following functions at the prompt.
  1. Your processor may already be stopped at this point. In a script, you might put the function in an if-statement as we have done here. Consider this test to be a safety check. No harm comes to the processor if it is already stopped when you tell it to stop. When you direct a stopped processor to halt, the function returns immediately.

  1. You have stopped the processor. Now disable the RTDX channels you opened to communicate with the target.
  1. If necessary, using disable with channel name and target identifier input arguments lets you disable only the channel you choose. When you have more than one board or processor, you may find disabling selected channels meets your needs.

    When you finish your RTDX communications session, disable RTDX to ensure that the MATLAB Link for Code Composer Studio releases your open channels before you close them.

  1. Use one or all of the following function syntaxes to close your open channels. Either close selected channels by using the channel name in the function, or use the 'all' option to close all open channels.
  1. Consider using the 'all' option with the close function when you finish your RTDX work. Closing channels reduces unforeseen problems caused by channel objects that may exist but do not get closed correctly when you end your session.

  1. When you created your RTDX link (cc = ccsdsp('boardnum',1) at the beginning of this tutorial, the ccsdsp function opened CCS IDE and set the visibility to 0. To avoid problems that occur when you close the link to RTDX with CCS visibility set to 0, be sure to make CCS IDE visible on your desktop. The following if-statement checks the visibility and changes it if needed.

  1. You have finished the work in this tutorial, type the following to close all your remaining links to CCS IDE and release all the associated resources.
  1. Note that clear all (without the parentheses) removes all variables from your MATLAB workspace.

You have completed the tutorial using RTDX. During the tutorial you:

  1. Opened links to CCS IDE and RTDX and used those links to load an executable program to your target processor.
  2. Configured a pair of channels so you could transfer data to and from your target.
  3. Ran the executable on the target, sending data to the target for processing and retrieving the results.
  4. Stopped the executing program and closed the links to CCS IDE and RTDX.

In future development work with your signal processing applications you follow the same set of tasks. Thus the tutorial provided here gives you a working process for using the MATLAB Link for Code Composer Studio and your signal processing programs to develop programs for a range of Texas Instruments digital signal processors. While the target may change, the essentials of the process remain the same.


  Running the Application Listing the Functions for Links