| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → xPC Target |
| Contents | Index |
| Learn more about xPC Target |
| On this page… |
|---|
The following are some issues you might encounter while running xpctest to check the xPC Target installation and configuration. xpctest runs eight subtests.
This topic assumes that you have read Testing and Troubleshooting the Installation in the xPC Target Getting Started Guide.
First, perform the procedure described in the Test 1, Ping Target System Standard Ping section in the xPC Target Getting Started Guide.
Note You can ignore this topic if you are using a serial connection. Test 1 is skipped for serial connections. |
If you are using a TCP/IP connection and need more help with Test 1, check the following:
Be sure to use only supported Ethernet cards on the target PC. See Hardware for Network Communication of the xPC Target Getting Started Guide for further details, including supplied Ethernet cards.
Verify that your hardware is operating correctly. For example, check for faulty network cables and other hardware.
If you run xpctest from a UNC network folder, such as \\Server\user\work, a workaround is to change the current MATLAB folder to a local folder and run the test again.
First, follow the procedure described in Test 2, Ping Target System xPC Target Ping section in the xPC Target Getting Started Guide.
If you need more help with Test 2, check the following:
Use the PC MATLAB command to check the environment variables, in particular Target PC IP address. If Test 1 passes but Test 2 fails, you might have entered an incorrect IP address.
If you have a TCP/IP connection, make sure you are using a supported Ethernet card (see xpctest: Test 1 Fails).
For an RS-232 connection,
Use a null modem cable (see Hardware for Serial Communication section in the xPC Target Getting Started Guide). If you do not use a null modem cable for an RS-232 connection, communication between the host and target PCs will fail. A null modem cable is shipped with the product.
If you do have a null modem cable, check the COM ports on the host and target PC. For example, ensure that the ports are enabled, you have connected the appropriate COM port, and the COM port matches that for which it is specified
Ensure that the COM ports on the host and target PCs are enabled in the BIOS. If they are disabled, Test 2 fails.
First, follow the procedure in Test 3, Reboot Target Using Direct Call in the xPC Target Getting Started Guide.
If you need more help with Test 3, check the following:
Did you get the following error?
ReadFile Error: 6
Older xPC Target releases might receive this error. This message might occur if the host PC initiates communication with the target PC while the target PC is rebooting, but the kernel on the target PC has not yet loaded. As a workaround, run xpctest with the noreboot option. For example,
xpctest('-noreboot')This command runs the test without trying to reboot the target PC. It displays the following message:
### Test 3, Software reboot the target PC: ... SKIPPED
If you directly or indirectly modify the xpcosc demo mode that is supplied with the product, Test 3 is likely to fail. To pass this test, restore the original xpcosc demo model, using one of the following methods:
(Preferred) Download a new copy of the model from the MathWorks FTP site (ftp://ftp.mathworks.com/pub/tech-support/xpcosc_model/). Overwrite the old xpcosc model with this new one in the folder
matlabroot\toolbox\rtw\targets\xpc\xpcdemos
Recreate the original model.
Reinstall the software.
Note Do not modify any of the files that are installed with the xPC Target software. If you want to modify one of these files, copy the file and modify the copy. |
First, follow the procedure in the Test 4, Build and Download Application in the xPC Target Getting Started Guide.
If you need more help with Test 4, check the following:
Verify that a supported compiler is being used.
If the communication between the host PC and target PC is TCP/IP, set the host PC network interface card (NIC) card and hub to half-duplex mode. Do not set the mode to full-duplex mode.
Verify the specified path to the supported compiler. You need only the root path to the compiler, not the full path. If you incorrectly specify a path, you might get the following error:
Error executing build command: Error using ==> make_rtw Error using ==> rtw_c (SetupForVisual) Invalid DEVSTUDIO path specified
or the following error:
Error executing build command: Error using ==> make_rtw Error using ==> rtw_c Errors encountered while building model "xpcosc"
with the following MATLAB Command Window error:
NMAKE: fatal error U1064: MAKEFILE not found and no target specified Stop.
To correct these errors,
Ensure that your compiler is properly installed. For example, all Microsoft Visual compiler components must be in the Microsoft® Visual Studio® folder after installation.
xpcexplr
In the Select C compiler field, select the appropriate compiler type (VisualC or Watcom).
In the Compiler Path field, enter the root path to the compiler. For example,
d:\applications\microsoft visual studio
Do not add a terminating back slash (\) at the end of the path.
If you still have problems, and you see the following MATLAB Command Window error:
ReadFile failed while reading from COM-port
Check the state of your target PC. If it is unresponsive, you might need to reboot the target PC.
In the xPC Target Explorer, try to connect to the target PC again. Be sure to also check the serial connection between the host PC and target PC.
This error occurs only when the environment variable settings are out of date.
To correct this, perform the following. See xPC Target Boot Options in the xPC Target Getting Started Guide for instructions on how to work with boot options.
At the MATLAB prompt, start xPC Target Explorer. For example,
xpcexplr
Inspect the environment variables for the problem target PC.
If you have xPC Target Embedded Option installed, ensure that, in the Configuration section, you have selected the Standalone tab.
Select the tab for your boot mode. For example, CD Boot.
Reboot the target PC.
If this procedure does not resolve the issue, perform the following:
At the MATLAB command line, type updatexpcenv. For example,
updatexpcenv
Recreate the boot disk or image using xpcbootdisk.
This test runs the basic target object constructor, xpc. This error rarely occurs unless an earlier test has failed.
To correct this, perform the following,
At the MATLAB command line, refer to and read the xpc reference page. For example,
help xpc
Rerun and check the results of earlier tests and make the necessary corrections.
This test executes a target application (xpcosc) on the target PC. This test will fail if you change the xpcosc model start time to something other than 0, such as 0.001. This change causes the test, and the MATLAB interface itself, to halt. To correct this, set the xpcosc model start time back to 0.
This test executes a target application (xpcosc) on the target PC. This test might fail if you change the xpcosc model (for example, if you remove the Outport block).
To correct this, perform one of the following:
Set the model back to the original configuration.
Download a new copy of the model from the MathWorks Web site, depending on the desired version.
http://www.mathworks.com/access/pub/xpcosc_model/R12p1version.zip
http://www.mathworks.com/access/pub/xpcosc_model/R13version.zip
http://www.mathworks.com/access/pub/xpcosc_model/R14version.zip
Overwrite the old xpcosc model in the folder
matlabroot\toolbox\rtw\targets\xpc\xpcdemos
Reinstall the software.
Other issues might also cause this test to fail. If you still need more help, check the following:
There is a known issue with xPC Target software version 1.3. It might occur when you run xpctest two consecutive times. See the known issue and solution documented in http://www.mathworks.com/support/solutions/data/1-18DTB.html.
If you are running a new xPC Target release, be sure that you have a new boot disk or image for this release. See Are You Working with a New xPC Target Release?.
If you are installing another version of the xPC Target software on top of an existing version, check the version number of the current installation. At the MATLAB command line, type xpclib. The version number appears at the bottom of the xPC Target block library pop-up window. If the version number is not the one to which you want to upgrade, reinstall the software.
The following are some questions you might have when building target applications.
If you boot up a target PC with a boot disk or image from a previous release, then build and download a target application from a host PC running a later release of the xPC Target software, the host PC might indicate a successful download. However, the target PC might display an error message like the following:
rt_init timing engine not found
This is because the xPC Target software on the boot disk or in the boot image did not match the version of xPC Target software running on the host PC. As a general rule, you must always create a new boot disk or image with a new xPC Target release or upgrade.
To resolve this, create a new boot disk or image, using the host PC xPC Target software, and reboot the target PC with the new boot disk or image.
The procedure to build a model with CAN blocks differs as follows:
In releases prior to R14SP1 (xPC Target software version 2.6.1), if you want to use the target PC in a CAN network, set up the xPC Target environment for a CAN library. If you do not configure a CAN library into the system, you will get CAN errors when building the target application.
In xPC Target software version 2.6.1 and later, the software selects the appropriate CAN library for you.
More Help. If the preceding procedures do not resolve the issue, and if you can build a target application with the CAN board in your model but cannot download that application to the target,
Ensure that you are using a supported CAN board.
In releases prior to R14SP1 (xPC Target software version 2.6.1), ensure that you selected the correct choice from the Can Library parameter in the xPC Target Explorer.
A target ping failure might occur when you build a target application that has a long initialization process (for example, models that use thermocouple boards). You might need to increase the time-out value. See Increasing the Time-Out Value of the xPC Target Getting Started Guide.
If you have target ping failures and the MATLAB interface freezes, this is likely the combined result of an active firewall and a long initialization process. To correct this problem, see Is There Communication Between Your PCs?.
![]() | Communications | General xPC Target Troubleshooting | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |