ITNG:XPCtarget
From SSEC
Setup for XPC target
How to set up and use XPC target
By Tom Smith
Software setup
- Install matlab R2008b
- Install visual studio 2008 pro or better (note express versions will not work)
- In matlab:
- a.Type “mbuild –setup” (must be typed not cut and pasted.)
- b.Select visual studio installed compiler
- (Type xpcobsoletelib)
- (a.This enables support for sensoray 626 in new versions)
- Type xpcexplr
- a.This is the main tool for setting up xpc
- In xpcexplr go to host pc root->Compiler configuration
- a.Set compiler path to: C:\Program Files\Microsoft Visual Studio 9.0
- you need to set up a system variable that lets the matlab compiler find variables
- a.Go to control panel, system or start menu and right click on my computer, left click properties.
- b.Go to advanced link on menu to the left of the screen, if applicable otherwise skip this, and advanced tag in resulting menu
- c.Click environment variables
- d.Click new in system variables section
- e.Set variable name MSSdk
- f.Set contents to c:\program files\Microsoft SDKs\[Latest version] ie C:\Program Files\Microsoft SDKs\Windows\v7.0A
- f.i.You need to replace [latest version] with the highest version directory in Microsoft sdks
- g.Reboot pc
- Network setup:
- a.You need to be connected to the uni network to get matlab licences (if you are not it will just hang)
- b.You need to be on a private network to talk to the target machine via TCPIP
- c.So you need a pc with two network cards!
- 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:
- You will need:
- a.CF to usb adaptor
- b.Compact Flash card
- Plug in cf adaptor and card, check it shows up as a drive in my computer
- Go to control panel, administrative tools
- Go to computer management
- Select Storage->Disk management
- Locate the volume that represents the CF card (will be marked as removable in list
- Right click on item, select change drive letter and paths
- Assign A: to the CF card (note may have to disable floppy drive in Device manager first)
- Load matlab, run command xpcexplr
- In xpcexplr select TargetPC1->Configuration->Communication
- a.Set Host target communication: TCP-IP
- b.Set TCPIP target driver: I82559 or for sweex cards r8139
- c.TCPIP target bus: PCI
- d.Set ip address to the ip you want, eg 192.168.1.80
- e.Set netmask to 255.255.255.0
- In xpcexplr select TargetPC1->Configuration
- a.Select bootfloppy as target mode
- b.Click create bootdisk
- Put CF in target machine
- a.WITH MACHINE OFF, don’t remove or add cards with the machine on, you will break things
- Boot target, matlab loader should show up on screen
- 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
- Simulation-> configuration parameters
- Select Solver
- a.Set stop time to inf
- b.Set solver options type to fixed step
- Select Real time workshop
- a.System target file should be xpctarget.tlc
- Go back to model, ctrl b to build
- You should get no errors
- Save model, then you don’t have to do this again.
Web links
- [xpctarget interactive guide http://www.mathworks.com/support/product/XP/productnews/interactive_guide/xPC_Target_Interactive_Guide.html]
- [Supported ethernet chips http://www.mathworks.com/products/xpctarget/xPC_Target_Supported_Ethernet_Chipsets.pdf]
- [The inevitable wikipedia page http://en.wikipedia.org/wiki/XPC_Target]
