xPC Target    

Creating a Simple Simulink Model

This tutorial uses a simple Simulink model to explain the tasks you need to do with xPC Target. If you are an experienced Simulink user, you can skip creating this model.

The model includes a transfer function and a signal generator block. If you want to visualize signals while simulating your model, you need to add a standard Simulink Scope block:

  1. In the MATLAB Command Window, type
  1. The Simulink library window opens.

  1. From the File menu, point to New, and then click Model.
  1. A blank Simulink model window opens.

  1. In the left pane, double-click Simulink, and then click Continuous.
  1. In the right pane, the Simulink library shows a list of blocks.

  1. Click-and-drag the Transfer Fcn block to the Simulink model window.
  2. In the Simulink Library Browser window, click-and-drag the following blocks to your model.
  3. Connect the Signal Generator block to the Transfer Fun block, and connect the input and output signals to the scope block using the Mux block.
  1. Your model should look similar to the figure shown below.

  1. From the File menu, click Save as and enter a filename. For example, enter xpc_osc and then click OK.

Since xPC Target does not support data uploading with external mode, you cannot use the Simulink Scope block to visualize signals from an xPC Target application running in real time. Instead, use an xPC Target Scope block. See Adding an xPC Target Scope Block.

For information on creating a Simulink model and adding signal and scope blocks, see the Using Simulink documentation.


  Simulink Model Adding a Simulink Outport Block