halt - Halt program execution by processor

Syntax

halt(id)
halt(id,timeout)

Description

halt(id) stops the program running on the processor. After you issue this command, MATLAB® waits for a response from the processor that the processor has stopped. By default, the wait time is 10 seconds. If 10 seconds elapses before the response arrives, MATLAB returns an error. In this syntax, the timeout period defaults to the global timeout period specified in id. Use get(id) to determine the global timeout period. However, the processor usually stops in spite of the error message.

To resume processing after you halt the processor, use run. Also, the read(id,'pc') function can determine the memory address where the processor stopped after you use halt

halt(id,timeout) immediately stops program execution by the processor. After the processor stops, halt returns to the host. timeout defines, in seconds, how long the host waits for the processor to stop running.

timeout defines the maximum time the routine waits for the processor to stop. If the processor does not stop within the specified timeout period, the routine returns with a timeout error.

Examples

Use one of the provided demonstration programs to show how halt works. From the Green Hills MULTI® demonstration programs, load and run one of the demonstration projects.

At the MATLAB prompt, create an object that refers to Green Hills MULTI

id = ghsmulti

Check whether the program is running on the processor.

isrunning(id)

ans =

     1

id.isrunning % Alternate syntax for checking the run status.

ans =

     1
halt(id) % Stop the running application on the processor.
isrunning(id)

ans =

     0

Issuing the halt stops the process on the processor. Checking in Green Hills MULTI confirms that the process has stopped.

See Also

isrunning

reset

run

  


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