Real-Time Windows Target    

Creating a Simulink Model

This procedure explains how to create a simple Simulink model. You use this model as an example to learn other procedures in the Real-Time Windows Target.

You need to create a Simulink model before you can run a simulation, or create a real-time application:

  1. In the MATLAB command window, type
  1. The Simulink Library Browser window opens.

  1. From the toolbar, click the Create a new model button.

  1. An empty Simulink window opens.

  1. In the Simulink Library Browser window, double-click Simulink, and then double-click Sources. Click-and-drag Signal Generator to the Simulink window.
  1. Double-click Continuous. Click-and-drag Transfer Fcn to the Simulink window.

    Double-click Sinks. Click-and-drag Scope to the Simulink window.

  1. Connect the Signal Generator output to the Transfer Fcn input by clicking-and-dragging a line between the blocks. Likewise, connect the Transfer Fcn output to the Scope input.
  2. Double-click the Transfer Fcn block. The Block Parameters dialog box opens. In the Numerator text box, enter
  1. In the Denominator text box, enter

    Your Block Parameters dialog box will look similar to the figure shown below.

  1. Click OK.
  2. Double-click the Signal Generator block. The Block Parameters dialog box opens. From the Wave form list, select square.
  1. In the Amplitude text box, enter

    In the Frequency text box, enter

    From the Units list, select rad/sec.

    Your Block Parameters dialog box will look similar to the figure shown below.

  1. Click OK.
  1. The completed Simulink block diagram is shown below.

  1. From the File menu, click Save As. The Save As dialog box opens. In the File name text box, enter a filename for your Simulink model and click Save. For example, type
  1. Simulink saves your model in the file rtwin_model.mdl.


  Simulink Model Entering Simulation Parameters for Simulink