Main Content

Trace or Log Data with the Simulation Data Inspector

With the Simulation Data Inspector and Simulink Real-Time, you can trace signal data with data logging in immediate mode or log signal data with data logging in buffered mode. In immediate mode, you view the output in real time as the application produces it.

The application can produce more data than the target computer can transmit in real time to the development computer. Data accumulates in the network buffer, and, if the buffer fills up, the RTOS drops data points.

To avoid dropped data points caused by network buffer overruns, you can use buffered logging mode. In buffered mode, you connect signals to File Log blocks in the model. In the real-time application, these blocks store data for the buffered signals on the target computer. At the end of execution, the real-time application transmits the data to the development computer for display in the Simulation Data Inspector. You can then view the most important signals immediately and view the buffered signals afterward.

Buffered logging mode supports decimation and conditional block execution semantics. Some examples are logging buffered data by enabling data logging for a signal inside a for-iterator, function-call, or enabled/triggered subsystem. For more information, see Simulation Data Inspector and How Application is Run Affects Signals Logged.

Set Up Model for Logging

To set up the model for logging signal data:

Open slrt_ex_osc.

Select the MuxOut output signal, place your cursor over the signal, and select Enable Data Logging.

Double-click the File Log block. The Decimation value is 1.

Set Up Simulation Data Inspector

To set up the Simulation Data Inspector:

Open the Simulation Data Inspector ().

Click Layout ().

Select two horizontal displays.

View Simulation Data

To view the simulation data:

Build and download slrt_ex_osc.

Start real-time execution.

When the Simulation Data Inspector button glows , click the top display and select the Sum output signal.

Click in the bottom display and select the Mux output signals.

Image of the Simulation Data Inspector with immediate values

Stop real-time execution.

When the Sum output appears, click Fit to View ().

Image of the Simulation Data Inspector with deferred values

To zoom in on a time segment of interest, for example, 10.0–10.1 s, click Zoom in Time () and use the mouse and mouse wheel.

Image of the Simulation Data Inspector with zoom on deferred values

To save the Simulation Data Inspector session as an MLDATX file, click Save.

Related Topics