Communications

Is There Communication Between Your PCs?

Use the following MATLAB® commands from the host PC to validate the host/target setup:

The xpctargetping command performs a basic communication check between the host and target PC. This command returns success only if the xPC Target™ kernel is loaded and is running and the communication between host and target PC is working properly. Use this command for a quick check of the communication between the host PC and target PC.

The xpctest command performs a series of tests on your xPC Target system. These tests range from performing a basic communication check to building and running target applications. At the end of each test, the command returns an OK or failure message. If the test is inappropriate for your setup, the command returns a SKIPPED message. Use this command for a thorough check of your xPC Target installation.

Communication errors might also occur in the following instances:

Why Does the xPC Target™ System Lose Connection with the Host PC When Downloading Some Models?

If you are using xPC Target hardware in a model, downloading the model might cause a loss of communication between the target PC and host PC if either of the following is true:

xPC Target™ I/O Boards with Slow Initialization Times

Some xPC Target boards have an initialization time that is too slow. This might cause software to run out of time before a model downloads, causing the host PC to disconnect from the target PC.

By default, if the host PC does not get a response from the target PC after downloading a target application and waiting 5 seconds, the host PC software times out. The target PC responds only after downloading and initializing the target application.

Usually 5 seconds is enough time to initialize a target application, but in some cases it might not be sufficient. The time to download a target application mostly depends on your I/O hardware. For example, thermocouple hardware (such as the PCI-DAS-TC board) takes longer to initialize. With slower hardware, you might also get errors when building and downloading an associated model. Even though the target PC is fine, a false time-out is reported and you might get an error like the following:

"cannot connect to ping socket"

This is not a fatal error. You can reestablish communication with the following procedure:

  1. At the MATLAB Command Window, issue the xpctargetping command. For example,

    xpctargetping
  2. Wait for the system to return from the xpctargetping.

  3. Restart the target object.

Alternatively, you can increase the time-out value, using the following procedure:

  1. In your MATLAB working directory, create a file called xpcdltimeout.dat.

  2. In this file, put an integer value. For example, enter

    20

    In this case, the host PC waits for about 20 seconds before declaring that a time-out has occurred. Note that it does not take 20 seconds for every download. The host PC polls the target PC about once every second, and if a response is returned, declares success. Only in the case where a download really fails does it take the full 20 seconds.

If the file xpcdltimeout.dat exists, it is read once before every download. To change the time-out value, change the number in this file. Setting the time-out to 5 is the same as the default. Note also that simply removing the file does not change the time-out to the default value. The xPC Target software uses the last value you entered until you restart the MATLAB interface.

xPC Target™ Driver Software Issues

If there really is an error in a driver that causes the xPC Target system to crash, a time-out occurs and xpctargetping fails with an error message. In such an event, you need to reboot the target and reestablish communication between the host PC and target PC.

To get yourself back up and running,

  1. Remove the reference to the problem driver from the model.

  2. Reboot the target PC.

  3. At the MATLAB command line, issue xpctargetping to reestablish communications.

  4. If the driver with which you are having problems is one provided by The MathWorks, try to pinpoint the problem area (for example, determine whether certain settings in the driver block cause problems).

Alternatively, you can exit and restart the MATLAB interface.

How Can I Diagnose Network Problems with the xPC Target™ System?

If you experience network problems when using this product, refer to The MathWorks Support xPC Target Web site (http://www.mathworks.com/support/product/XP). This Web site has the most up-to-date information about this topic.

  


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