Embedded Target for Motorola MPC555 |
 |
Tutorial 3: Using the Demo Model In Simulation
In this section, we will continue to use the Configurable Subsystem in the demo model, using it first in a normal closed-loop simulation and then in a SIL simulation.
Closed-Loop Simulation
- Right-click on the Configurable Subsystem and select
fuel rate controller
from the Block choice submenu of the subsystem block's context menu. This selects the controller subsystem that was used in the original model.
- Open the Scope blocks and start the simulation. When the simulation completes (simulation time is set to 8 seconds), the signals displayed on the scopes should appear identical to those displayed during the previous cosimulation (see Figure 2-2).
SIL Simulation
- Right-click on the Configurable Subsystem and select
fuel rate controller (SIL)
from the Block choice submenu of the subsystem block's context menu.
- Selecting this option directs Simulink to call a generated wrapper S-function that implements the controller algorithm in highly efficient Real-Time Workshop Embedded Coder generated code. You can now run a SIL simulation.
- Start the simulation. You will notice that the simulation completes much more quickly, due to the efficiency of the generated code. Also, observe that the generated code displays results, on the scopes, that are identical to the previous simulation and cosimulation (see Figure 2-2).
| Rebuilding the Controller and Cosimulating | | PIL Target Summary |  |