ITNG:XPCtarget

From SSEC

Jump to: navigation, search

Setup for XPC target


How to set up and use XPC target

By Tom Smith

Software setup

  1. Install matlab R2008b
  2. Install visual studio 2008 pro or better (note express versions will not work)
  3. In matlab:
    1. a.Type “mbuild –setup” (must be typed not cut and pasted.)
    2. b.Select visual studio installed compiler
  4. (Type xpcobsoletelib)
    1. (a.This enables support for sensoray 626 in new versions)
  5. Type xpcexplr
    1. a.This is the main tool for setting up xpc
  6. In xpcexplr go to host pc root->Compiler configuration
    1. a.Set compiler path to: C:\Program Files\Microsoft Visual Studio 9.0
  7. you need to set up a system variable that lets the matlab compiler find variables
    1. a.Go to control panel, system or start menu and right click on my computer, left click properties.
    2. b.Go to advanced link on menu to the left of the screen, if applicable otherwise skip this, and advanced tag in resulting menu
    3. c.Click environment variables
    4. d.Click new in system variables section
    5. e.Set variable name MSSdk
    6. f.Set contents to c:\program files\Microsoft SDKs\[Latest version] ie C:\Program Files\Microsoft SDKs\Windows\v7.0A
    7. f.i.You need to replace [latest version] with the highest version directory in Microsoft sdks
    8. g.Reboot pc
  8. Network setup:
    1. a.You need to be connected to the uni network to get matlab licences (if you are not it will just hang)
    2. b.You need to be on a private network to talk to the target machine via TCPIP
    3. c.So you need a pc with two network cards!
    4. d.On the second card (the one for talking to the target pc), set a static ip address, eg 192.168.1.81.

How to use xpcexplr with our mini-itx systems:

  1. You will need:
    1. a.CF to usb adaptor
    2. b.Compact Flash card
  2. Plug in cf adaptor and card, check it shows up as a drive in my computer
  3. Go to control panel, administrative tools
  4. Go to computer management
  5. Select Storage->Disk management
  6. Locate the volume that represents the CF card (will be marked as removable in list
  7. Right click on item, select change drive letter and paths
  8. Assign A: to the CF card (note may have to disable floppy drive in Device manager first)
  9. Load matlab, run command xpcexplr
  10. In xpcexplr select TargetPC1->Configuration->Communication
    1. a.Set Host target communication: TCP-IP
    2. b.Set TCPIP target driver: I82559 or for sweex cards r8139
    3. c.TCPIP target bus: PCI
    4. d.Set ip address to the ip you want, eg 192.168.1.80
    5. e.Set netmask to 255.255.255.0
  1. In xpcexplr select TargetPC1->Configuration
    1. a.Select bootfloppy as target mode
    2. b.Click create bootdisk
  2. Put CF in target machine
    1. a.WITH MACHINE OFF, don’t remove or add cards with the machine on, you will break things
  3. Boot target, matlab loader should show up on screen
  4. In matlab command prompt type xpctest, this will run diagnostics and check everything is ok, you should get each test returning OK if it worked.


How to set up models

  1. Simulation-> configuration parameters
  2. Select Solver
    1. a.Set stop time to inf
    2. b.Set solver options type to fixed step
  3. Select Real time workshop
    1. a.System target file should be xpctarget.tlc
  4. Go back to model, ctrl b to build
  5. You should get no errors
  6. Save model, then you don’t have to do this again.

Web links

Personal tools