halt - Halt program execution by processor

Syntax

halt(vd)
halt(vd,timeout)

Description

halt(vd) 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 time-out period defaults to the global time-out period specified in vd. Use get(vd,'timeout') to determine the global time-out 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(vd,'pc') function can determine the memory address where the processor stopped after you use halt.

halt(vd,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 time-out period, the routine returns with a time-out error.

Examples

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

At the MATLAB prompt, create an object that refers to a VisualDSP++ IDE session.

vd = adivdsp

Check whether the program is running on the processor.

isrunning(vd)

ans =

     1

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

ans =

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

ans =

     0

Issuing the halt stops the process on the processor. Checking in VisualDSP++ IDE 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