Main Content

Inspect Simulink® Desktop Real-Time™ Signals with Simulation Data Inspector

This example shows how to use the Simulation Data Inspector (SDI) to log signal data from the real-time application. Use Simulink®Run in Kernelmode to establish a communication channel between your Simulink® block diagram and your real-time application. Control which signals to display by selecting them in the model. You can log signal data from models referenced at arbitrary levels within a model hierarchy.

This example uses the modelsldrtex_model. To open this example, in the MATLAB Command Window, type:

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

  1. Opensldrtex_model.

  2. In the Simulink Editor, on theSimulationtab, set the simulation stop time to, for example,30seconds.

  3. In the model, select the signals信号发生器andTransfer Fcn.

  4. On the桌面实时tab, clickLog Signals. A faint Simulation Data Inspector icon appears next to each signal.

  5. To start the real-time execution inRun in Kernelmode, on the桌面实时tab, clickRun in Real Time. The Simulation Data Inspector button glows, indicating that Simulation Data Inspector has data available for viewing.

  6. On the桌面实时tab, clickData Inspector.

  7. In the Simulation Data Inspector, select the signalsSignalGenerator:1andTransfer Fcn:1. Simulation Data Inspector displays plotted data.

10. To stop the simulation, click the停止button.

11. After the simulation, use the toolbar buttons to explore the data. For example, to view the simulation between seconds 2 and 4, in Simulation Data Inspector, click theZoom in Timebutton. Drag the cursor over the range from2to4.

12. To save the Simulation Data Inspector session as a.matfile, clickSave.

See Also

Related Topics