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. InConnected IOmode or accelerator mode, Simulink®transfers the new values to the model that is being simulated. InRun in Kernelmode, 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 modelsldrtex_model. To open this model, in the MATLAB Command Window, type:

open_system(docpath(fullfile(docroot,'toolbox',...'sldrt','examples','sldrtex_model')))

This model opens inConnected IOmode.

First, install theSimulink Desktop Real-Time™kernel andcdto a working folder.

  1. Opensldrtex_model.

  2. Open theScopeblock.

  3. In Simulink Editor, on the桌面实时tab, selectMode>Run in Kernel.

  4. On the桌面实时tab, selectRun in Real Time>停止Timeand change the停止TimetoInf.

  5. On the桌面实时tab, clickRun in Real Time. Simulink builds the real-time application, connects to the real-time kernel, and starts running the real-time simulation.

    Image of scope displaying signal from simulation

  6. Open theTransfer Fcnblock parameters dialog box.

  7. ChangeDenominator coefficientsto[1 180 10000].

    Image of transfer function parameters window

  8. ClickApply.

    Image of scope plot ripple minimum

  9. On the桌面实时tab, click停止.

Related Topics