xPC Target / Host Configuration

Configuration of xPC Target / Host


  1. Host
    1. Installation of OS / drivers
    2. Installation of Matlab
    3. Other software installed
    4. Setting up Network for Crossover Connection to Target
  2. xPC Target
    1. Formatting the Hard Drive
    2. Network Boot
    3. Special Notes
    4. BIOS adjustments to Optimize CPU processing
    5. Network Considerations



Configuration of xPC Target / Host

  1. Host
    1. Installation of OS / drivers

      1. The Host computer came from PC's for anyone with a Windows XP 64 operating system installed. After installing the full MATLAB, I discovered that Real-Time Windows Target kernel will not run on Windows XP 64, so I needed to reinstall the operating system with Windows XP 32 bit. This is the procedure I took to install Windows XP32:
        1. Installed Windows XP (32 bit) SP2
        2. Inserted the 'MSI Drivers and Utilities' CD and installed the following:

          1. MSI – chip drivers
          2. High Definition sound drivers
          3. Real – Tek Ethernet drivers
          4. Intel Gigabit CT Desktop Ethernet drivers

        3. Inserted the 'MSI Afterburner' CD and installed the drivers for the NVIDIA GEForce 220
        4. Inserted the 'Nero 9' CD to install the CD/DVD burning drivers and software
        5. Ran Windows Update to update the Windows XP installation to current

      2. Installation of MATLAB

        1. Installed the following toolboxes off the internet for license 379262:


          MATLAB Version 7.10.0.499 (R2010a)
          MATLAB License Number: 379262
          Operating System: Microsoft Windows XP Version 5.1 (Build2600: Service Pack 2)
          Java VM Version: Java 1.6.0_12-b04 with Sun Microsystems Inc. Java HotSpot(TM) Client VM mixed mode
          MATLAB Version 7.10 (R2010a)
          Simulink Version 7.5 (R2010a)
          Control System Toolbox Version 8.5 (R2010a)
          Curve Fitting Toolbox Version 2.2 (R2010a)
          Data Acquisition Toolbox Version 2.16 (R2010a)
          Filter Design Toolbox Version 4.7 (R2010a)
          Gauges Blockset Version 2.0.5 (R2010a)
          Image Acquisition Toolbox Version 3.5 (R2010a)
          Image Processing Toolbox Version 7.0 (R2010a)
          Optimization Toolbox Version 5.0 (R2010a)
          Real-Time Windows Target Version 3.5 (R2010a)
          Real-Time Workshop Version 7.5 (R2010a)
          Robust Control Toolbox Version 3.4.1 (R2010a)
          Signal Processing Blockset Version 7.0 (R2010a)
          Signal Processing Toolbox Version 6.13 (R2010a)
          Simulink Control Design Version 3.1 (R2010a)
          Simulink Design Optimization Version 1.1.1 (R2010a)
          Spline Toolbox Version 3.3.8 (R2010a)
          Stateflow Version 7.5 (R2010a)
          Stateflow Coder Version 7.5 (R2010a)
          Statistics Toolbox Version 7.3 (R2010a)
          Symbolic Math Toolbox Version 5.4 (R2010a)
          System Identification Toolbox Version 7.4 (R2010a)
          Wavelet Toolbox Version 4.5 (R2010a)
          xPC Target Version 4.3 (R2010a)

        2. Installed Microsoft Visual C++ Express 2008 . . . a Real-Time compatible compiler which is free
        3. After installation ran the MATLAB command: 'rtwintgt
          -setup' to install the Real-Time Windows Target compiler

      3. Other software installed

        1. I then installed the following software:

          1. USB_FORMAT.ZIP - a tool for formatting usb drives
          2. Cygwin
          3. RealVNC
          4. Slik SVN
          5. Mozilla Firefox
          6. WireShark 1.2.9 – A network analyzer tool
          7. Win Hex 15.6 – Computer Forensics & Data Recovery Software, Hex Editor, Disk Editor
          8. OpenOffice.org
          9. VirusScan Enterprise 8.7i for Windows (MIT distribution)


      4. Setting up Network for Crossover Connection to Target

          Used a 3' long Ethernet Crossover cable to create a direct ethernet connection from the Host PC to the Target. I configured this on the Host PC side using the New Connection Wizard, for the Intel Gigabit CT Desktop Ethernet adapter. I used the following parameters:

          IP Address: 10.10.10.10
          Subnet Mask: 255.255.255.0
          Default Gateway: (left empty deliberately)



  1. xPC Target

    1. Formatting the Hard Drive

        I formatted the hard drive in the xPC Target system using the
        Windows XP CD as a boot CD without installing the operating
        system. I set up a FAT-32 partition which is 32 GB in size (the
        maximum FAT32 size for Windows XP), and I left the rest of the
        disk unpartitioned (with the hopes of installing a 64 bit Ubuntu
        installation later on). The xPC Target Kernel will only recognize
        the 32 GB partition (it won't recognize any NTFS partitions
        either).

    2. Network Boot

      1. xPC Target 4.3 which comes with MATLAB R2010a has several
        new features, among which are booting from a CD, as well as
        booting from a network connection to the host. I was unable to
        create a boot CD which would boot successfully, so I decided to
        use the Network Boot option so that I could play with the boot
        parameters until I could successfully find the parameter
        configuration that would successfully boot on the purchased PC.
      2. The successful boot was installed with the following
        Communication Settings:

        Note that the TCP/IP gateway address field is empty this is
        typical for a cross-over connection, since there is no gateway. In
        addition, it is useful to note that the target driver is set to
        Auto.


      3. The Network Boot Settings were as depicted below:


        The IP address I assigned to the xPC Target PC is 10.10.10.11
        which is one number above the IP I assigned to the Intel Gigabit
        CT Desktop Ethernet Adapter on the Host machine. The MAC address
        gets set the first time a Target Machine tries to boot over the
        network.


      4. Note when configuring a boot be certain that 'Multicore
        CPU Support' is DISABLED
        . The Intel I5-750 LGA 1156 CPU in the
        xPC Target machine is not compatible with this feature of the xPC
        Target Kernel. You will not be able to boot if you enable this
        feature (which is enabled by default).

    3. Special Notes
      The xPC Target display seems a bit messed up (see example):

      I do not know if this is because of the NVIDIA video card, or because
      the display of the R2010a version of xPC Target is buggy. I will
      contact Mathworks to find out.

      ( I may add some special
      notes here at a later time) Special Note - swapped the video card for
      an older one, and the problem was solved


    4. BIOS adjustments to Optimize CPU processing
      After setting up the xPC target kernel, I tested it with a
      high-load *.mdl program, and was running tests that should have
      lasted 60 seconds, I found out that the xPC Target kernel was
      conking out after about 8 seconds with the error CPU OVERLOAD,
      which means that the CPU was unable to perform the specified
      calculations within the sample period which in this case was 0.0001
      seconds. This was very bad. After a bit of research, I discovered
      the possible causes, and did the following to address this issue:

      1. Cause: Excessive interrupts hitting the CPU, delaying processing . . .
        Went into the BIOS setup and made the following changes:

        1. [Ai Tweaker] → [CPU Level Up] set to [Crazy-3.2 G]
        2. [Ai Tweaker] → [OC Tuner] set to [Better Performance]
        3. [Advanced] → [CPU Configuration] → [Active Processor Cores] set to [1]
          (The xPC Target kernel does not support multicore CPUs)

        4. [Advanced] → [On Board Devices Configuration] → [HDA
          Controller] set to [Disabled]
          (minimize interrupts and work
          the CPU might need to perform)
        5. [Advanced] → [On Board Devices Configuration] →
          [RealTek LAN 1] set to [Disabled]
          (minimize interrupts and work the CPU might need to perform – this ethernet device is unused)
        6. [Advanced] →
          [On Board Devices Configuration] → [USB Controller] set to [Disabled]
          (minimize interrupts and work the CPU might need to perform)
        7. [Advanced] → [PCIPnp] → [ Plug And Play OS] set to [No]

        These changes had a significant effect . . . in further tests,
        I was able to run for 120 seconds (1,200,000 samples), and the
        highest TET (Task Execution Time) was 0.000074 s, which is
        definitely better than before. I will need to pay attention to
        this, since we get a CPU OVERLOAD error at 0.0001 s and a TET of
        0.000074 s is about 75% of the way there.
      2. Cause: Ethernet traffic work load
        Excessive ethernet activity during target run-time will take up
        a lot of CPU time, and will definitely increase the average TET.
        As of yet, I have done nothing to address this issue.

    5. Network Considerations

      1. The model of two good dedicated matching xPC-compatible
        ethernet cards (Intel Gigabit CT Desktop Ethernet Adapter)
        connected by a cross-over cable does not seem to be as 'sturdy' a
        connection as anticipated. I have been getting ethernet
        disconnects. This impression is subjective, however, and I have
        not analyzed this as of yet.
      2. I have run a network analyzer and have discovered the
        following: If you have the MATLAB tool 'xpcexplr' open, running,
        and connected to the Target PC, this tool will be sending an
        enormous amount of network traffic constantly, as it is constantly
        querying the target PC for updates.
      3. As mentioned previously, excessive network traffic causes
        the ethernet card on the Target PC to consume a lot of CPU time
        which can lead to an increased TET.
      4. Putting (ii) and (iii) together I concluded that running
        'xpcexplr' while the target is executing is bad!!