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
clear
--remove all RTDX objects and handles associated with a CCS and RTDX link. When you finish a session with RTDX, clear
removes all traces of the specified link, or all links when you use the 'all
' option in the syntax. When you clear one or more links, they no longer exist and cannot be reopened or used. If you are ending your programming session and do not want to retain any of the channels or links you created, use clear
to end the RTDX communications and links and release all channels and resources associated with existing CCS IDE and RTDX links. You do not need to use the close
or disable
functions first.
close
--close the specified RTDX channel. To use the channel again, you must open and enable the channel. Compare close
to disable
. close('rtdx')
closes the communications provided by RTDX. After you close RTDX, you cannot communicate with your target.
disable
--remove RTDX communications from the specified channel, but does not remove the channel, or link. Disabling channels may be useful when you do not want to see the data that is being fed to the channel, but you may want to read the channel later. By enabling the channel later, you have access to the data entering the channel buffer. Note that data that entered the channel while it was disabled is lost.
halt
--stop a running processor. You may still have one or more messages in the host buffer.
Use the following procedure to shut down communications between MATLAB and the target, and end your session:
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.
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.
all
' option to close all open channels.
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.
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.
You have completed the tutorial using RTDX. During the tutorial you:
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 | ![]() |