MATLAB Link for Code Composer Studio Development Tools    
run

Execute the program loaded on the target processor

Syntax

Description

run(cc,state,timeout) starts to execute the program loaded on the target processor referred to by cc. Program execution starts from the location of the program counter. After starting program execution, the input argument state determines when you regain program control.

To define the action of run, state accepts three strings that set the state of the processor:

State String
Run Action
'run'
Start to execute the program. Wait until the program is running, then return. The program continues to run. If you omit the option argument, run defaults to this setting. Sets the processor to the running state and returns. This is useful when you want to continue to work in MATLAB while the processor executes a program.
'runtohalt'
Start to execute the program. Wait to return until the program encounters a breakpoint or the program execution terminates. Sets the processor to the running state and returns when the processor halts.
'tohalt'
Changes the state of a running process to 'runtohalt', and waits for the processor to halt before returning. Use this when you want to stop a running process cleanly. If the processor is already stopped when you use this state setting, run returns immediately.

To allow you to specify how long run waits for the processor to start executing the loaded program before returning, the input argument timeout lets you set the waiting period in seconds. After you use run, the routine returns after confirming that the program started to execute, or after timeout seconds elapses, whichever comes first. If the timeout period expires, run returns a timeout error.

Examples

After you build and load a program to your target, use run to start execution.

This example uses a tutorial program included with DKTI. Set your CCS IDE working directory to be the one that holds your project files. The load function uses the current working directory unless you provide a full pathname in the input arguments.

Rather than using the dot notation to access the RTDX functions, you can create an alias to the cc link and use the alias in later commands. Thus, if you add the line

to the program, you can replace

with

See Also
halt, isrunning, restart


  restart save