| Embedded IDE Link™ CC | ![]() |
run(cc,'state',timeout)
run(cc,'main')
run(cc,'tofunc','functionname')
run(ff)
run(ff,input1,value1,input2,value2,...,inputn,valuen)
output = run(ff)
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 strings that set the state of the processor:
| state String | Run Action |
|---|---|
main | Reset the program counter then run the program until the PC reaches main. Stop at main. |
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® software 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. |
tofunc | Run the program from the current position of the program counter to the start of a specified function functionname. |
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 time-out period expires, run returns a time-out error.
run(cc,'main') resets the program counter in your project then runs the program linked to cc until the counter reaches the start of main.
run(cc,'tofunc','functionname') runs the program from the current position of the program counter until the counter reaches the function functionname. Compare this to run(cc,'main') which resets the program counter before executing the program. Using the tofunc option does not reset the program counter.
run(ff) runs the function ff and puts the return value in the appropriate location. run performs a goto followed by execute to run ff.
run(ff,input1,value1,input2,value2,...,inputn,valuen) writes the input values for ff before running the function, where valuen is the value for the input argument inputn. You can pass up to 10 input arguments and their values when you call run.
output = run(ff) puts the return value from running ff in output.
When your target board contains more than one processor, run calls the program running function for each processor represented by cc, running the program loaded on each processor.
This is the same as calling run for each processor individually through ticcs objects for each one. The other information about run on a single processor applies to each processor in the multiple processor target cases.
After you build and load a program to your target, use run to start execution.
cc = ticcs('boardnum',0,'procnum',0); % Create a link to CCS
% IDE.
cc.load('tutorial_6xevm.out'); % Load an executable file to the
% target.
cc.rtdx.configure(1024,4); % Configure four buffers for data
% transfer needs.
cc.rtdx.open('ichan','w'); % Open RTDX channels for read and
% write.
cc.rtdx.enable('ichan');
cc.rtdx.open('ochan','r');
cc.rtdx.enable('ochan');
cc.restart; % Return the PC to the beginning of the current
% program.
cc.run('run'); % Run the program to completion.
This example uses a tutorial program included with Embedded IDE Link™ CC. 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 path name 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
rx = cc.rtdx;
to the program, you can replace
cc.rtdx.configure(1024,4);
with
configure(rx,1024,4);
![]() | resume | save | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |