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 by streaming signal data directly to the Simulation Data Inspector or by logging signal data by recording it through a File Log block. If streaming signal data directly, 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. Streaming signal data directly does not support decimation or limit data points.

To avoid dropped data points caused by network buffer overruns, you can use logging through a File Log block. When logging, 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.

Logging signal data through a File Log block supports decimation or limit data points and supports conditional block execution semantics. Some examples are logging signal 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:

  1. Open slrt_ex_osc.

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


    Consider whether to configure the Logging sample time in the Instrumentation Properties for the logged signal. Use this property to set a lower sample time for signals that go into the Simulation Data Inspector while the simulation is running. Configuring this property can help makes the Simulation Data Inspector more responsive and easier to use.

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

Set Up Simulation Data Inspector

To set up the Simulation Data Inspector:

  1. Open the Simulation Data Inspector ().

  2. Click Layout ().

  3. Select two horizontal displays.

View Simulation Data

To view the simulation data:

  1. Build and download slrt_ex_osc.

  2. Start real-time execution.

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

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

    Use the Simulation Data Inspector to view immediate values.

  5. Stop real-time execution.

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

    Use the Simulation Data Inspector to view deferred values.

  6. 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.

    Use the Simulation Data Inspector to zoom the view of deferred values.

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

Related Topics