Main Content

Tune Block Parameters by Using the Block Dialog Box

After running your real-time application, use the block mask dialog box or Property Inspector to change parameter values and observe the changes to the signals. In Connected IO mode or accelerator mode, Simulink® transfers the new values to the model that is being simulated. In Run in Kernel mode, Simulink transfers the new values to the real-time application that is running in the kernel mode process.

For this example, your goal is to minimize ringing in the transfer function.

This procedure begins with the square-wave transfer function model sldrtex_model. To open this model, in the MATLAB® Command Window, type:

openExample('sldrtex_model')

This model opens in Connected IO mode.

First, install the Simulink Desktop Real-Time™ kernel and cd to a working folder.

  1. Open sldrtex_model.

  2. Open the Scope block.

  3. In Simulink Editor, on the Desktop Real-Time tab, select Mode > Run in Kernel.

  4. On the Desktop Real-Time tab, select Run in Real Time > Stop Time and change the Stop Time to Inf.

  5. On the Desktop Real-Time tab, click Run in Real Time. Simulink builds the real-time application, connects to the real-time kernel, and starts running the real-time simulation.

    The scope window displays the signal from simulation.

  6. Open the Transfer Fcn block parameters dialog box.

  7. Change Denominator coefficients to [1 180 10000].

    Apply these settings for the transfer function in the block parameters dialog box.

  8. Click Apply.

    The scope window displays the ripple minimum signal from simulation.

  9. On the Desktop Real-Time tab, click Stop.

Related Topics