| Contents | Index |
You can boot your target computer with the xPC Target kernel using one of the following methods from the xPC Target Explorer. Target boot drives and boot images include the xPC Target kernel specific for either serial or network communication.
Tip
|
| On this page… |
|---|
Booting Target Computers from CD or DVD Booting Target Computers Within a Dedicated Network |
Configure your xPC Target system before you create your boot drive or boot image. At a minimum, perform the following configurations. You can optionally set the other xPC Target Explorer configuration options; however, their default values should suffice.
Confirm that the boot tab on the Configuration pane is set to your desired boot mode:
CD Boot
Network Boot
Boot Floppy
DOS Loader
Embedded Target
Check the C compiler specification (see Configuring the Host Computer for Your C Compiler).
If you are using TCP/IP communication, check your network connections. Also check the xPC Target Explorer settings (see Network Communication).
If you are using serial communication, check your physical connections. Also check the xPC Target Explorer settings (see Serial Communication).
Check your target computer BIOS settings (see Target Computer BIOS Settings).
You use the target boot CD or DVD to load and run the xPC Target kernel. After you make changes to the xPC Target environment properties, you must create a target boot CD or DVD. This topic assumes you are using default environment parameter settings for the boot CD or DVD creation. If this is not the case, see Configuring Environment Parameters for Target Computers in the xPC Target User's Guide for further details.
Use the following procedure to create a boot CD or DVD for the current xPC Target environment. This procedure describes how to create a target boot CD for the target TargetPC1. Before you start:
Acquire an empty, writable CD or DVD.
Acquire a CD/DVD-RW drive.
Choose a process for creating a boot CD or DVD. You can create a boot CD or DVD in one of the following ways:
The xPC Target Explorer Create CD Boot Image can create a boot CD or DVD for you. To use this capability, your host computer must have one of the following Windows systems:
Microsoft Windows 7
Microsoft Windows Vista™
Microsoft Windows XP Service Pack 2 or 3 with Image Mastering API v2.0 (IMAPIv2.0), available at http://support.microsoft.com/kb/KB932716.
You can use third-party CD/DVD writing software to write ISO image files. Use this method if you do not have Microsoft Windows 7, Microsoft Windows Vista, or Microsoft Windows XP Service Pack 2 or 3.
Warning Writing the CD ISO image to a CD or DVD is not the same as copying the ISO image to a CD or DVD. When you write an ISO image to a CD or DVD, you create a bootable CD or DVD from the ISO image by burning the image to the CD or DVD. When you copy the ISO image, you just copy the ISO image to the CD or DVD as data; you cannot use a copied CD or DVD as a boot drive. |
Insert the empty CD or DVD in the host computer.
If the xPC Target Explorer is not open, open it now. At the MATLAB Command Window, type
xpcexplr
Note xPC Target Explorer runs only on 32-bit host computers. On 64-bit computers, use the MATLAB command-line interface. For further information, see Configuring Environment From the MATLAB Command Line. |
In the xPC Target Explorer xPC Target Hierarchy pane, select a target computer Configuration node. For example, select the Configuration node for TargetPC1.
A TargetPC1 Configuration pane appears in the rightmost pane. This pane contains a series of tabs.
In the location parameter, enter a path in which you want xPC Target Explorer to write the xPC Target CD/DVD boot ISO image. For example, enter C:\Work\matlab.

Click the Apply button.
Click the Create CD Boot Image button.
Note At this point, you have defined how xPC Target will communicate with the target computer. RS-232 Host-Target communication mode will be removed in a future release. Use TCP/IP instead. |
The software creates a CD/DVD image file named cdboot.iso in this location.
Perform one of the following depending on your software:
If you have Microsoft Windows 7, Microsoft Windows Vista, or Microsoft Windows XP Service Pack 2 or 3 with Image Mastering API v2.0 (IMAPIv2.0), xPC Target Explorer prompts you to insert a CD/DVD.

Insert the CD or DVD in the drive, then click Burn Disk.
If you do not have Microsoft Windows 7, Microsoft Windows Vista, or Microsoft Windows XP Service Pack 2 or 3 with Image Mastering API v2.0 (IMAPIv2.0), use your third-party CD creation software to write the cdboot.iso image to the empty CD/DVD.
Insert the bootable CD/DVD into your target computer CD/DVD drive and reboot that computer.
Your next task is to test your installation. See Running the Confidence Test.
You use the boot CD/DVD to load and run the xPC Target kernel. After you make changes to the xPC Target environment properties, you must create a CD/DVD bootable ROM. Before you start:
Acquire an empty, writable CD or DVD.
Acquire a CD/DVD-RW drive.
Choose a process for creating a bootable CD or DVD. You can create a boot CD or DVD in one of the following ways:
The xPC Target software can create a boot CD or DVD for you. To use this capability, your host computer must have one of the following Windows systems:
Microsoft Windows 7
Microsoft Windows Vista
Microsoft Windows XP Service Pack 2 or 3 with Image Mastering API v2.0 (IMAPIv2.0), available at http://support.microsoft.com/kb/KB932716.
Third-party CD/DVD writing software can write ISO image files for you. Use this method if you do not have Microsoft Windows 7, Microsoft Windows Vista, or Microsoft Windows XP Service Pack 2 or 3.
To create a boot CD/DVD for the TargetPC2 environment:
Insert the empty CD or DVD in the host computer.
In the MATLAB window, type
tgs=xpctarget.targets
tgs.makeDefault('TargetPC2')
env=tgs.Item('TargetPC2')Verify the following property settings:
TargetBoot — CDBoot
CDBootImageLocation — Your host computer CD/DVD disk drive location
If these properties are not set to the required values, set them. For example:
env.TargetBoot='CDBoot' env.CDBootImageLocation='c:\work\xpc\cdimage'
In the MATLAB Command Window, type
xpcbootdisk
Note At this point, you have defined how xPC Target will communicate with the target computer. RS-232 Host-Target communication mode will be removed in a future release. Use TCP/IP instead. |
The xPC Target software displays the following message and creates the CD/DVD boot ISO image.
Current boot mode: CDBoot CD boot image is successfully created
Perform one of the following, depending on your software:
If you have Microsoft Windows 7, Microsoft Windows Vista, or Microsoft Windows XP Service Pack 2 or 3 with Image Mastering API v2.0 (IMAPIv2.0), xpcbootdisk prompts you to insert a CD/DVD.
Insert an empty CD/DVD. Available drives: [1] z:\ [0] Cancel Burn
Insert the CD or DVD in the drive, then press the Enter key.
If you do not have Microsoft Windows 7, Microsoft Windows Vista, or Microsoft Windows XP Service Pack 2 or 3 with Image Mastering API v2.0 (IMAPIv2.0), use your third-party software to write the cdboot.iso image to the empty CD/DVD.
Your next task is to test your installation. See Running the Confidence Test.
Alternatively, if you have a single target computer system, you can use the setxpcenv function.
This topic describes how to boot target computers on a dedicated network. You do not need a boot drive. You do need to set up the host computer and target computer. This topic assumes that you know how to:
Set up a dedicated network.
Use the xPC Target Explorer to configure the target computer and host environments. You should be familiar with the following sections:
Caution Do not boot a target computer on a corporate or nondedicated network. Doing so might interfere with dynamic host configuration protocol (DHCP) servers, which will cause problems with the network. |
Identify the target computer that you want to boot over the dedicated network.
Install the Ethernet card or USB-to-Ethernet adapter.
Verify that:
The xPC Target product supports your Ethernet card (see Hardware for Network Communication).
Your Ethernet card has a boot ROM that is compatible with the Preboot eXecution Environment (PXE) specification.
Connect the host computer and the target computers within the dedicated network. For example, connect one end of a crossover cable to the dedicated network card of the host computer and connect the other end of this cable to the dedicated network card of the target computer.
Turn on the target computer.
Enter BIOS and set up the target computer for a LAN or network boot. If the BIOS allows you to change the boot order, consider setting the boot order so that the removable/boot floppy disk is the first option and the LAN is the second. This allows you to boot the target computer from a network kernel even if the target computer does not have an xPC Target boot disk or removable drive.
This procedure is similar to configuring a target boot drive. If you have previously created a target boot drive, you might not need to perform this procedure. However, you should still read the following instructions to verify that your configuration allows you to boot a target computer in the dedicated network. You can configure multiple target computers for your network.
Verify that the host computer has a network card available for the dedicated network. If no card is available, insert a new card and configure it for the dedicated network. This step includes assigning the host computer a unique IP address (for example, 10.10.10.10) in the same subnet as the target computer.
If the xPC Target Explorer is not open, open it now. At the MATLAB Command Window, type
xpcexplr
Note xPC Target Explorer runs only on 32-bit host computers. On 64-bit computers, use the MATLAB command-line interface. For further information, see Configuring Environment From the MATLAB Command Line. |
Add a target computer, for example, TargetPC3.
In the Communication Component pane for TargetPC3,
In the Host target communication field, select TCP/IP.
Enter a target computer IP address in the dedicated network, for example, 10.10.10.11. The subnet of this IP address must be the same as the host computer, otherwise Network Boot will fail.
Enter values for the remaining fields.
Click the Apply button.
In the TargetPC3 Configuration pane, select Network Boot.

The Target PC Ethernet Configuration section of the configuration pane allows you to either associate a physical target computer MAC address with the xPC Target Explorer target computer name, or allow the software to automatically find target computer MAC addresses. If you want to associate your physical target computer MAC address,
Click Manual.
In the six fields, enter the physical target computer MAC address (in hexadecimal).
Click the Create Network Boot Image button.
The software creates and starts a network boot server process on the host computer. You will boot the target computer using this process.
A minimized icon (
) representing the network boot server
process appears on the bottom right host computer system tray.
Your next task is to boot the target computer from the network. See Booting the Target Computer From the Network
Reboot the target computer.
The host computer network boot server displays a pop-up from the system tray indicating that the boot server is being downloaded to the target computer.
If the target computer is not already associated with a physical target computer MAC address, the first time that the network boot server process detects a viable target computer, it displays a dialog that contains the target computer names and the IP addresses for those names. From this list, select the physical target computer you want to associate with the target computer name.

Select the target computer name with which you want to associate the physical target computer.
The target computer receives the xPC Target kernel and boots with this kernel.
If you click the Cancel button instead of selecting a target computer name, the next time you try to boot the target computer across the network, the kernel will ignore the target computer boot request for 90 seconds.
Note the following behavior:
If the target computer name has a MAC address, and there is a physical target computer whose MAC address matches the target computer name MAC address, the software matches the two and the xPC Target Network Boot dialog does not display.
If the connection between the target computer and host computer is an RS-232 one, you cannot boot the target computer across the network.
If the StandAlone mode is enabled, you cannot boot the target computer across the network.
Your next task is to test your installation. See Running the Confidence Test.
You use a removable boot drive to load and run the xPC Target kernel. After you make changes to the xPC Target environment properties, you need to create or update a boot drive. Note that this topic assumes you are using default environment parameter settings for the target boot drive creation. If this is not the case, see Configuring Environment Parameters for Target Computers in the xPC Target User's Guide for further details.
To create a target boot drive for the current xPC Target environment, use the following procedure. This procedure describes how to create a target boot drive for the target TargetPC2. Alternatively, see Creating a Target Boot Drive with a Command-Line Interface.
Tip If you are creating a target boot drive from a USB flash drive, you must create a bootable partition on the drive before performing this procedure. See Creating a Bootable Partition. |
If the xPC Target Explorer is not open, open it now. At the MATLAB Command Window, type
xpcexplr
Note xPC Target Explorer runs only on 32-bit host computers. On 64-bit computers, use the MATLAB command-line interface. For further information, see Configuring Environment From the MATLAB Command Line. |
In the xPC Target Explorer xPC Target Hierarchy pane, select a target computer Configuration node. For example, select the Configuration node for TargetPC2.
A configuration pane for that target computer appears in the rightmost pane.
From the tab list, select the Boot Floppy tab.

Change the drive letter to a valid removable drive. Include the backslash, such as a:\.
Click the Apply button.
Click the Create boot disk button.
The following message box opens.

Insert a formatted removable drive in the host computer, and then click OK.
Note At this point, you have defined how xPC Target will communicate with the target computer. RS-232 Host-Target communication mode will be removed in a future release. Use TCP/IP instead. |
All data on the disk is erased as the xPC Target software writes the xPC Target kernel and other required files to the drive.
The xPC Target software displays the following dialog box while creating the boot drive. The process takes about 1 to 2 minutes.

Insert the boot drive into your target computer disk drive and reboot the target computer.
Your next task is to test your installation. See Running the Confidence Test.
You use the target boot drive to load and run the xPC Target kernel. After you make changes to the xPC Target environment properties, you need to create or update a boot drive. The following makes changes to the TargetPC2 environment.
Tip If you are creating a target boot drive from a USB flash drive, you must create a bootable partition on the drive before performing this procedure. See Creating a Bootable Partition. |
In the MATLAB window, type
tgs=xpctarget.targets
tgs.makeDefault('TargetPC2')
env=tgs.Item('TargetPC2')Set the following xPC Target properties as follows:
TargetBoot — BootFloppy
BootFloppyLocation — Your host computer removable drive location
If these properties are not set to the required values, set them. For example:
env.TargetBoot='BootFloppy' env.BootFloppyLocation='a:'
In the MATLAB Command Window, type
xpcbootdisk
Note At this point, you have defined how xPC Target will communicate with the target computer. RS-232 Host-Target communication mode will be removed in a future release. Use TCP/IP instead. |
The xPC Target software displays the following message.
Current boot mode: BootFloppy Insert a formatted floppy disk into your host PC's disk drive and press a key to continue
Insert a formatted removable drive in the host computer, and then press any key.
The write procedure starts and, while creating the boot drive, the MATLAB Command Window displays the following status information.
Creating xPC Target boot disk ... Please wait xPC Target boot disk successfully created.
Alternatively, if you have a single target computer system, you can create a target boot drive with the setxpcenv function.
Your next task is to test your installation. See Running the Confidence Test.
Before you create a target boot drive from a USB flash drive, you must create a bootable partition on the drive.
On the host computer, open a DOS command window.
In the DOS command window, type
diskpart
At the diskpart prompt, type
list disk
Make a note of the disk numbers of the existing host computer disks.
Insert the flash drive. Wait for the host computer to recognize the drive. Make a note of the drive device name.
At the diskpart prompt, type
list disk
Make a note of the new disk number N. This number is the disk number of the drive.
Type
select disk N
All of the next steps change disk N.
Type
clean
Type
create partition primary
Type
select partition 1
Type
active
Type
format fs=fat32 quick
Type
exit
In the host computer task bar, click Safely remove hardware and eject media and select the device name of the flash drive.
Remove the drive from the host computer.
DOSLoader mode allows you to boot the xPC Target kernel on a target computer from a fixed or removable device with DOS boot capability, such as a hard disk or flash memory. After booting the target computer, you can download your application from the host computer over the serial or network communication between the host and target computers. See DOSLoader Mode Setup for details.
The following is a step-by-step procedure for using DOSLoader mode. This procedure assumes you have serial or network communication between your host and target computers. Also note that to use this mode, you need a minimal DOS system on the target computer boot device. See Creating a DOS System Disk for details.
In the MATLAB Command Window, type:
xpcexplr
Note xPC Target Explorer runs only on 32-bit host computers. On 64-bit computers, use the MATLAB command-line interface. For further information, see Configuring Environment From the MATLAB Command Line. |
The xPC Target Explorer window opens.
In the xPC Target Hierarchy pane, expand the node of the target computer that you want to set up for DOSLoader mode and select the Configuration node.
In the Configuration pane, select the DOSLoader tab.
In the Location field, enter or browse to the directory where you want to create the DOSLoader boot files and click OK. This location can be a local directory on the host computer or a removable storage device that you will use to boot the target computer. By default, the directory is the current working directory.
Click Apply.
Click Create DOS Loader.
Note At this point, you have defined how xPC Target will communicate with the target computer. RS-232 Host-Target communication mode will be removed in a future release. Use TCP/IP instead. |
This operation creates the following boot files in the specified location:
| autoexec.bat |
| xpcboot.com |
| *.rtb |
If you create boot files on a local hard disk, copy these files to a floppy disk, CD/DVD, or any other removable storage media.
Transfer the boot files to your target computer or insert the removable media containing the boot files for booting the target computer.
Place the autoexec.bat file on the DOS boot path, which is typically the root directory.
Select the required boot device in the BIOS of the target computer.
Boot the target computer.
When the target computer boots, it loads DOS, which starts the autoexec.bat file. This file starts the xPC Target kernel (*.rtb). The target computer then awaits commands from the host computer.
To use DOSLoader mode, your DOS environment must comply with the following restrictions:
The CPU must execute in real mode.
While loaded in memory, the DOS partition must not overlap the address range of a target application.
To satisfy these restrictions:
Do not use additional memory managers like emm386 or qemm.
Avoid any utilities that attempt to load in high memory (for example, himem.sys). If the target computer DOS environment does not use a config.sys file or memory manager entries in the autoexec.bat file, there should typically be no problems when starting the xPC Target software.
After booting the target computer using DOSLoader mode, create a target application on a host computer and download it to the target computer.
Set the Simulink and Simulink Coder parameters for code generation with the xPC Target software in your Simulink model. Next, build and download the application to the target computer.
In the MATLAB Command Window, type the name of a Simulink model. For example:
xpc_osc3
A Simulink window opens with the model.
From the Tools menu, select Code Generation, and then click Build Model.
The Simulink Coder and xPC Target products create a target application and download it to your target.
To create DOSLoader files for the current xPC Target environment and use them to boot the target computer, use the following procedure:
For a specific target computer, retrieve the specific target computer environment object from the xpctarget.targets class. Then, set the value of the object properties TargetBoot and DOSLoaderLocation. For example:
tgs = xpctarget.targets;
tgEnv = tgs.Item('TargetPC2');
set(tgEnv, 'TargetBoot', ‘DOSLoader');
set(tgEnv, 'DOSLoaderLocation', 'c:\work\xpc\dosloader_files');Alternatively, if you have a single target computer environment, you can use the setxpcenv functions, as follows to set the object properties TargetBoot and DOSLoaderLocation:
setxpcenv('TargetBoot','DOSLoader')
setxpcenv('DOSLoaderLocation','c:\work\xpc\dosloader_files')In the MATLAB Command Window, type:
xpcbootdisk
Note At this point, you have defined how xPC Target will communicate with the target computer. RS-232 Host-Target communication mode will be removed in a future release. Use TCP/IP instead. |
The xPC Target software displays the following message and creates the DOSLoader files:
Current boot mode: DOSLoader xPC Target DOS Loader files are successfully created
Transfer the DOSLoader files as described in DOSLoader Mode Setup.
To use the DOSLoader mode, you need a minimal DOS system on the target computer boot device. MathWorks has tested the xPC Target product with FreeDOS Beta 8 ("Nikita") distribution, MS-DOS (6.0 or higher), PC DOS, and Caldera OpenDOS. You can use a copy of any of these DOS systems to boot the target computer.
Note xPC Target software does not include a DOS license. You must obtain a valid DOS license for your target computer. |
To create a DOS system disk, use the following DOS command to copy the DOS system files and command interpreter from drive1 to the boot device, drive2.
sys drive1 drive2
It is helpful to copy additional DOS utilities to the boot device, including:
A DOS editor to edit files
The format program to format a hard disk or flash memory
The fdisk program to create partitions
The sys program to transfer a DOS system onto another drive
Once you have created the DOS System disk, you can transfer the DOSLoader files created using xpcexplr or the MATLAB command line to the disk. A config.sys file is not required.
The xPC Target Embedded Option Standalone Mode software allows you to bundle the kernel and target application into one entity on the target computer independent of the host computer. You can configure a target computer to automatically start execution of your embedded application for continuous operation each time the system is booted. You can control the target application with the command-line interface using the target computer keyboard. You can also control it from the host using custom GUIs or the Web browser interface. You can deploy host-side GUIs developed with the xPC Target C, COM and .NET APIs on any Microsoft Windows host computer without installing MATLAB software. See the xPC Target API Guide for more information.
Introduction. The xPC Target Embedded Option software extends the xPC Target base product with Standalone mode. Standalone mode enables you to deploy control systems, DSP applications, and other systems on PC hardware for use in production applications using PC hardware. Typically these production applications are found in systems where production quantities are low to moderate.
Use this mode to load the target computer with both the xPC Target kernel and a target application. This mode of operation can start the kernel on the target computer from a flash disk or hard disk. After starting the kernel on the target computer, Standalone mode also automatically starts the target application that you loaded with the kernel. Standalone mode eliminates the need for a host computer and allows you to deploy real-time applications on target computers. See Standalone Mode Embedded Option for further details.
Regardless of the mode, you initially boot your target computer with DOS from any boot device, then the xPC Target kernel is started from DOS. The xPC Target software only needs DOS to boot the target computer and start the xPC Target kernel. DOS is no longer available on the target computer unless you reboot the target computer without starting the xPC Target kernel.
Note The xPC Target Embedded Option software requires a boot device with DOS installed. It otherwise does not have any specific requirements as to the type of boot device. You can boot the xPC Target software from any device that has DOS installed. DOS software and license are not included with the xPC Target or xPC Target Embedded Option software. |
Without the xPC Target Embedded Option software, you can only download real-time applications to the target computer after booting the target computer from an xPC Target boot disk or network boot image.
The following are some instances where you might want to use the xPC Target Embedded Option product. You might have one of these situations if you deploy the target computer in a small or rugged environment.
Target computer does not have removable drive.
Target computer removable drive must be removed after setting up the target system.
Target computer does not support network boot from host computer.
If you do not want to view signals on the target computer, you do not need a monitor for the target computer, nor do you need to add target scopes to the application. In this instance, your xPC Target system operates as a black box without a monitor or keyboard. Standalone applications are automatically set to continue running for an infinite time duration or until the target computer is turned off.
Workflow. The following summarizes the workflow for Standalone mode. For a more detailed procedure, see Standalone Target Setup.
Verify that the target computer has a supported version of DOS on the target computer hard drive.
Create a standard boot device from CD ROM, 3.5–inch floppy drive, flash drive, or hard drive using the DOS command:
sys A:
At this time, it is helpful to copy additional DOS utilities to the boot disk, such as:
DOS editor — to edit text files on the target computer
format program — to format a hard disk or flash memory
fdisk program — to create partitions
sys program — to transfer a DOS system onto another drive, such as the hard disk drive
Boot the target computer.
From the host computer MATLAB window, type xpcexplr.
Note xPC Target Explorer runs only on 32-bit host computers. On 64-bit computers, use the MATLAB command-line interface. For further information, see Configuring Environment From the MATLAB Command Line. |
In the xPC Target Explorer xPC Target Hierarchy pane, select a target computer Configuration node.
Click the Enable Standalone Mode check box.
This step creates a directory in the current working folder named modelname_xpc_emb.
Copy the contents of model_name_emb to the target computer hard drive.
The target computer hard drive should now contain the following files:
DOS files — DOS operating system and utilities (see step 1).
*.rtb — xPC Target kernel, plus applicable options such as serial or TCP/IP communications and the IP address of the target computer.
xpcboot.com — xPC Target code that loads and executes the *.rtb file.
autoexec.bat — xPC Target-specific code that calls the xpcboot.com executable to boot the xPC Target kernel.
When you boot the target computer, the target computer loads DOS, which then calls the xPC Target autoexec.bat file to start the xPC Target kernel (*.rtb) and the associated target application. If you set up the boot device to run the xPC Target autoexec.bat file upon startup, the target application starts executing as soon as possible. The xPC Target application executes entirely in protected mode using the 32-bit flat memory model.
Restrictions. To use the Standalone mode, your DOS environment must comply with the following restrictions:
The CPU must execute in real mode.
While loaded in memory, the DOS partition must not overlap the address range of a target application.
To satisfy these restrictions,
Do not use additional memory managers like emm386 or qemm.
Avoid any utilities that attempt to load in high memory (for example, himem.sys). If the target computer DOS environment does not use a config.sys file or include memory manager entries in the autoexec.bat file, there should be no problems when running xpcboot.com.
Before You Start. Standalone mode combines the target application with the kernel and boots them together on the target computer from the hard drive (or, alternatively, flash memory). The host computer does not need to be connected to the target computer.
Before you start, set up your system as described.
Create a standard boot disk or network boot image for serial or network communication (depending on your configuration). You will need to do this so that you can copy your Standalone mode files to the target computer. See Serial Communication, Network Communication, Booting Target Computers from Removable Boot Drives, and Target Boot Method in the Installation and Configuration chapter of the xPC Target Getting Started Guide.
Boot the target computer.
Verify that your target computer hard drive is a serial ATA (SATA) or parallel ATA (PATA)/Integrated Device Electronics (IDE) drive. The xPC Target product supports file systems of type FAT-12, FAT-16, or FAT-32. Verify that the hard drive is not cable-selected and that the BIOS can detect it.
After you create the standalone target application files, you will copy them to the target computer hard drive using the File Transfer Protocol (FTP) functions of the xPC Target file system. You do not need to be familiar with the xPC Target file system before you start, but for further information on this feature, see Logging Signal Data with FTP and File System Objects.
Updating Environment Properties. The xPC Target software uses the environment properties to determine what files to create for the various target boot modes.
This procedure assumes you have serial or network communication between your host computer and a target computer.
xpcexplr
Note xPC Target Explorer runs only on 32-bit host computers. On 64-bit computers, use the MATLAB command-line interface. For further information, see Configuring Environment From the MATLAB Command Line. |
The xPC Target Explorer window opens.
In the xPC Target Explorer xPC Target Hierarchy pane, select a target computer Configuration node.
The xPC Target software updates the environment properties, and the build process is ready to create a standalone kernel/target application. See Creating a Kernel/Target Application. For Standalone mode, you do not create an xPC Target boot disk or network boot image. Instead, you copy files created from the build process to the target computer hard drive.
Creating a Kernel/Target Application. Use the xPC Target software with Standalone mode to create a combined kernel and target application with utility files. A combined kernel and target application allows you to disconnect your target computer from a host computer and run standalone applications.
After you set the Simulink and Simulink Coder parameters for code generation with the xPC Target software in your Simulink model, you can use the xPC Target software with Standalone mode to create a target application:
In the MATLAB window, type the name of a Simulink model. For example, type
xpc_osc3
A Simulink window opens with the model.
From the Tools menu, point to Code Generation, and then click Build Model.
Simulink Coder and xPC Target software create a folder xpc_osc3_xpc_emb with the following files:
autoexec.bat — This file is automatically invoked by DOS. It then runs xpcboot.com and the *.rtb file.
xpc_osc3.rtb — This image contains the xPC Target kernel and your target application.
xpcboot.com — This file is a static file that is part of the xPC Target Embedded Option software.
Refer to Copying the Kernel/Target Application to the Target Computer Flash Disk for a description of how to transfer these files to the target computer.
Note If the size of the compiled target application (DLM) exceeds the Maximum model size you selected in xPC Target Explorer, the software will generate an error during the build process. |
Copying the Kernel/Target Application to the Target Computer Flash Disk. You build a target application on a host computer using the Simulink Coder and xPC Target products, and a C/C++ compiler. One method for transferring the files from the host computer to a target computer is to use the FTP functions of the xPC Target file system.
After you build a standalone application on a host computer, you can copy files from the host computer to the target computer hard drive or flash disk. If you have not already created these files, see Creating a Kernel/Target Application.
Verify that your target computer is still booted from a target computer boot disk.
In the MATLAB Command Window, change folder on the host computer to the folder that contains the kernel/target application files.
Create the folder C:\xpcfiles and copy files to that folder. For example, type
f=xpctarget.ftp
f.mkdir('xpcfiles')
f.cd('xpcfiles')
f.put('autoexec.bat')
f.put('xpcboot.com')
f.put('xpc_osc3.rtb')If you want your standalone application to run when you reboot your target computer, remove the 3.5-inch disk or CD from the target computer, reboot the target computer, and bring up the DOS prompt. For example, if you see the message for selecting the operating system to start, select Microsoft Windows.
Note If the target computer that you want to boot in Standalone mode was previously booted from the network boot image, selecting the Enable Standalone Mode check box should disable the network boot capability. |
The boot process is stopped and a DOS prompt is displayed.
At the DOS prompt, save a copy of the target computer file C:\autoexec.bat to a backup file, such as C:\autoexec_back.wrk.
Edit the target computer file C:\autoexec.bat to include the following lines. Adding these commands to C:\autoexec.bat directs the system to execute the autoexec.bat file located in C:\xpcfiles.
cd C:\xpcfiles autoexec
Reboot the target computer.
The sequence of calls during the boot process is
C:\autoexec.bat
C:\xpcfiles\autoexec.bat
C:\xpcfiles\xpcboot.com
C:\xpcfiles\<application>.rtb
The standalone target application should now be running on the target computer.
![]() | Serial Communication | Running the Confidence Test | ![]() |

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 |