Embedded Target for Motorola MPC555    

Building PIL and Simulation Components

In this section, you will build a library of simulation, SIL, and PIL components from the fuel rate controller subsystem:

  1. Right-click on the fuel rate controller subsystem. A context menu appears. Select Build Subsystem from the Real-Time Workshop submenu of the context menu.
  2. The Build code for Subsystem window opens. This window displays information about each variable (or data object) that is referenced as a block parameter in the subsystem. The window lets you inline or set the storage class of individual parameters. We will not be concerned with these features in this exercise. Click the Build button to continue the code generation and build process.

  3. The build process displays status messages in the MATLAB command window. Intermediate Simulink windows are displayed as the build process creates various components.
  4. When the code generation process completes, the PIL target automates the process of compiling, downloading, and executing the generated PIL code that is to run on the target hardware. To accomplish this, the PIL target launches your cross-development system (Diab or CodeWarrior), compiles and makes the executable, and invokes the appropriate downloading and debugging utility (SingleStep or CodeWarrior debugger). You do not need to intervene in this process.
  5. At this point, the generated program is running on the target hardware and waiting for communication to be established with Simulink on the host PC.
  6. The build process has created and opened a library named fuel_lib, as shown in this figure.

The library contains

The Configurable Subsystem, when plugged into the model, lets you choose which of the three library components will perform the controller functions in the model. We will use the Configurable Subsystem in the following sections.

The library window also contains the following controls:

The library window documents the name of the original model/subsystem from which the library was generated,


  Setting Up the Model Using the Demo Model In a PIL Cosimulation