Skip to Main Content Skip to Search
Product Documentation

run - Execute program loaded on processor

Syntax

IDE_Obj.run
IDE_Obj.run('runopt')
IDE_Obj.run(…,timeout)

IDEs

This function supports the following IDEs:

Description

IDE_Obj.run runs the program file loaded on the referenced processor, returning immediately after the processor starts running. Program execution starts from the location of program counter (PC). Usually, the PC is positioned at the top of the executable file. However, if you stopped a running program with halt, the PC may be anywhere in the program. run starts the program from the PC current location.

If IDE_Obj references more the one processor, each processors calls run in sequence.

IDE_Obj.run('runopt') includes the parameter runopt that defines the action of the run method. The options for runopt are listed in the following table.

runopt stringDescription
'run'Executes the run and waits to confirm that the processor is running, and then returns to MATLAB.
'runtohalt'Executes the run but then waits until the processor halts before returning. The halt can be the result of the PC reaching a breakpoint, or by direct interaction with the IDE, or by the normal program exit process.
'tohalt'Waits until the running program has halted. Unlike the other options, this selection does not execute a run, it simply waits for the running program to halt.
'main'This option resets the program and executes a run until the start of function 'main'.
'tofunc'This option must be followed by an extra parameter funname, the name of the function to run to:
IDE_Obj.run('tofunc',funcname)
This executes a run from the present PC location until the start of function funcname is reached. If funcname is not along the program's normal execution path, funcname is not reached and the method times out.

In the 'run' and 'runtohalt' cases, a halt can be caused by a breakpoint, a direct interaction with the IDE, or by a normal program exit.

The following table shows the availability of the runopt options by IDE.

 CCS IDEEclipse IDEMULTI IDEVisualDSP++ IDE
'run'YesYesYesYes
'runtohalt'YesYesYesYes
'tohalt'Yes Yes 
'main'Yes Yes 
'tofunc'Yes Yes 

IDE_Obj.run(…,timeout) adds input argument timeout, to allow you to set the time out to a value different from the global timeout value. The timeout value specifies how long, in seconds, MATLAB waits for the processor to start executing the loaded program before returning.

Most often, the 'run' and 'runtohalt' options cause the processor to initiate execution, even when a timeout is reached. The timeout indicates that the confirmation was not received before the timeout period elapsed.

See Also

halt | load | reset

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS