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

This example shows how to use Simulation Data Inspector (SDI) to log signal and task execution time (TET) data from the real-time application. You can select signals for display from models referenced at arbitrary levels within a model hierarchy.

  • Simulation Data Inspector (SDI) and the third-party calibration tools (Vector CANape® and ETAS® Inca) are mutually exclusive. If you use SDI to view signal data, you cannot use the calibration tools. If you use the calibration tools, you cannot use SDI to view signal data.

  • The real-time application sometimes generates data faster than the kernel can transmit it to the development computer, causing gaps in the output. If gaps occur, consider selecting buffered logging. You can also reduce the number of signals being inspected or increase the sample time.

  • Simulink® Real-Time™ records signals inside enabled subsystems even when they are not running. In while and for iterator subsystems, Simulink® Real-Time™ records only the last data point.

This example uses the model xpcosc (open_system(fullfile(matlabroot, 'toolbox', 'rtw', 'targets', 'xpc', 'xpcdemos', 'xpcosc'))).

In this example, you control the model from Simulink® Real-Time™ Explorer. You can also access Simulation Data Inspector by using external mode.

Setup the Simulation Data Inspector

Make sure that you have started the target computer and established communication between the development and target computers.

  1. Open model xpcosc.

  2. Increase the simulation stop time to, for example, 10 seconds. On the Real-Time tab, pull down Run on Target and type the value in the Stop Time box.

  3. To log signals with SDI, in the model, select and right-click the signals Signal Generator and Integrator1. Select Log Selected Signals. A faint Simulation Data Inspector icon appears next to each signal.

  4. To log task execution time (TET), open the Configuration Parameters dialog box. In the Simulink Real-Time Options tab, select Monitor Task Execution Time.

  5. Build the model and download it to the target computer. On the Real-Time tab, click Run on Target.

Inspect Signal Data

  1. Open Simulink Real-Time Explorer. On the Real-Time tab, pull down the Prepare section anc click SLRT Explorer.

  2. In Simulink Real-Time Explorer, start the real-time application. The Simulation Data Inspector button glows in Simulink Editor, indicating that Simulation Data Inspector has data available for viewing.

  3. Click the Simulation Data Inspector button.

  4. In the Simulation Data Inspector, select the signals Integrator1:1 and SignalGenerator:1. The Simulation Data Inspector displays plotted signal data.

5. Stop the real-time application. On the Real-Time tab, click Stop.

6. After the simulation, use the Simulation Data Inspector to explore the data. For example, to view the simulation between seconds 0.02 and 0.04, in Simulation Data Inspector, click the Zoom in Time button. Drag the cursor over the range from 0.02 to 0.04.

Inspect TET Data

  1. To view the TET data, clear Integrator1:1 and SignalGenerator:1.

  2. Select TET.BaseRate.minTET, TET.BaseRate.maxTET, and TET.BaseRate.TET.

3. To save the Simulation Data Inspector session as a .mldatx file, click Save.

See Also

Related Topics