Products & Services Solutions Academia Support User Community Company

Learn more about Real-Time Windows Target   

Tuning Parameters

About Parameter Tuning

Simulink external mode connects your Simulink model to your real-time application. The block diagram becomes a graphical user interface to the real-time application You can change parameter values while running the real-time application by changing the values in

Simulink external mode also supports side-effects functions. For example, given an expression in a Gain block of 2*a+b, the expression is evaluated and the resulting value is exported to the real-time application during execution.

When a parameter in a Simulink model is changed, the communication module rtwinext.mex* transfers the data to the external real-time application and changes the model parameters. Only the parameters that do not result in model structure modification can be changed. If the structure is modified, you must recompile the model. Model structure changes are detected automatically using model checksum and reported to the MATLAB Command Window to avoid conflicts.

Changing Model Parameters

You must use Simulink external mode to change model parameters. While external mode is running, you can open Simulink blocks and change parameter values. External mode will transfer the new value to the real-time application.

After you start running your real-time application, you can change parameters and observe the changes to the signals. To start a real-time application, see Running a Real-Time Application.

The following procedure uses the Simulink model rtwin_model.mdl as an example. It assumes you have created a real-time application and are executing it.

  1. From the Simulation menu, click Start Real-Time.

    The real-time execution starts running and signal data is displayed in the Scope window.

  2. From the Simulink block diagram, double-click the Transfer Function block.

    The Block Parameters: Transfer Fcn dialog box opens:

  3. In the Denominator field, change 70 to 30. Click OK.

    The effect of changing a block parameter is shown in the Scope window.

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS