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
for iterator subsystems, Simulink® Real-Time™ records only the last data point.
This example uses the model
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.
Make sure that you have started the target computer and established communication between the development and target computers.
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.
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.
To log task execution time (TET), open the Configuration Parameters dialog box. In the Simulink Real-Time Options tab, select Monitor Task Execution Time.
Build the model and download it to the target computer. On the Real-Time tab, click Run on Target.
Open Simulink Real-Time Explorer. On the Real-Time tab, pull down the Prepare section anc click SLRT Explorer.
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.
Click the Simulation Data Inspector button.
In the Simulation Data Inspector, select the signals
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.04, in Simulation Data Inspector, click the Zoom in Time button. Drag the cursor over the range from
To view the TET data, clear
3. To save the Simulation Data Inspector session as a
.mldatx file, click Save.