How do I set up the xPC TargetBox so that at boot time, I can select between booting to the DOS command prompt or the xPC Target Kernel?

2 views (last 30 days)
I would like to set up the xPC TargetBox such that at boot time, I can select booting to the DOS prompt or directly launching the xPC Target Kernel.
However, every time I RESET the TargetBox I would like a menu which permits me to select if I want to boot to DOS or the xPC Target Kernel.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
To set up a multi-boot option on the xPC TargetBox, you need to edit the batch file 'C:\AUTOEXEC.BAT' by performing the following steps:
1. On the xPC TargetBox, press the "Reset" button.
2. When you see the message for loading DOS, press Ctrl+C repeatedly until you see the message:
Terminate batch file 'C:\AUTOEXEC.BAT' (Yes/No/All)?
3. Type Y.
4. Open the 'C:\AUTOEXEC.BAT' file using the command:
e c:\autoexec.bat
[NOTE]: Depending on the version of DOS installed on the TargetBox you may have use a different command to edit the batch file instead of "e".
5. Add the following lines of code to the bottom of 'C:\AUTOEXEC.BAT' file and save it.
ECHO 1. Select 1 to boot to DOS
ECHO 2. Select 2 to boot to xPC
CHOICE /C:12 /N /T:1,10
IF errorlevel 2 GOTO xPC
IF errorlevel 1 GOTO END
:xPC
xpcboot filename.rtb
: END
After modifying the batch file, pressing the RESET button on the xPC TargetBox will cause the boot operation to pause and echo the following two options at the command prompt:
1. Select 1 to boot to DOS
2. Select 2 boot to xPC
The application can be launched by pressing 2 or the DOS prompt can be accessed by pressing 1. If no selection is entered at the command line in 10 seconds, the TargetBox will automatically boot to DOS.
The functionality of the DOS statements used to program the batch file are as follows:
ECHO: Displays the command in the batch file on the screen.
CHOCE: Accepts user-inputs and defaults to the specified boot option if no input is provided.
xpcboot: Launches the xPC Target Kernel and starts the stand-alone application.
For detailed help documentation on the DOS commands used in batch file programming, you may refer to any of the available online resources.
[NOTE]: There are two things that have to be ascertained before modifying the batch file:
1. The Simulink model has to be compiled for the Embedded Target Option in the StandAlone mode.
2. The files necessary to run the application, for example, filename.rtb, must reside on the hard drive of the xPC TargetBox.

More Answers (0)

Categories

Find more on Multicore Processor Targets in Help Center and File Exchange

Products


Release

No release entered yet.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!