xPC Target    

Building and Downloading the Target Application

You use the xPC Target build process to generate C code, compile, link, and download your target application to the target PC.

After you enter your changes in the Simulation Parameters dialog box, you can build your target application. This procedure uses the Simulink model xpc_osc3.mdl as an example. To create this model, see, xPC Target Application.

  1. In the MATLAB Command Window, type
  1. MATLAB loads the oscillator model and displays the Simulink block diagram.

  1. In the Simulink window and from the Tools menu, point to Real-Time Workshop. From the Real-Time Workshop submenu, click Build Model.
  1. After the compiling, linking, and downloading process, a target object is created in your MATLAB workspace. The default name of the target object is tg. For more information about the target object, see Target Objects in the xPC Target User Guide documentation.

    On the host computer, MATLAB displays the following lines after a successful build process:

    The target PC displays the following information.

  1. In the MATLAB Command Window, type
  1. MATLAB displays a list of properties for the target object tg.

If you do not have a successful build, see Troubleshooting the Build Process.

Your next task is to run the target application in real time on the target PC. See Running the Target Application.


  Entering the Real-Time Workshop Parameters Troubleshooting the Build Process