importLogData

Import buffered logging data to the active session of the Simulation Data Inspector

Description

example

importLogData(target_object) imports buffered logging data to the active session of the Simulation Data Inspector immediately. Without using this function, the Simulation Data Inspector imports the data when the stop time is reached for the run of the real-time application. A limitation is that a small gap in the logged data appears in the Simulation Data Inspector at the time that you use the importLogData function.

Examples

Import Buffered Log Data to the Simulation Data Inspector

To import buffered logging data into the active session of the Simulation Data Inspector immediately, use these steps.

  1. Open the xpcFileLogging model.

    open_system(fullfile(matlabroot,'toolbox','rtw','targets','xpc','xpcdemos','xpcFileLogging'));
  2. Mark a signal for logging.

  3. Set the logging properties to buffered

  4. Set the model stop time to 'Inf'

    set_param('xpcFileLogging','StopTime','Inf');
  5. Build and download the real-time application

  6. Create a target object for the default target computer with the command:

    tg = slrt;
  7. Run the real-time application.

    start(tg);
  8. Create a new Simulation Data Inspector run.

    Simulink.sdi.Run.create
  9. Import the buffered logged data into the Simulation Data Inspector

     importLogData(tg)

The status message indicates that the log data is being transferred.

Transferring logging data for model xpcFileLogging, please wait ...

Input Arguments

collapse all

Object that represents the target computer. Before calling this function, make sure that you start the target computer with the Simulink® Real-Time™ kernel and apply the required Ethernet link settings.

Example: tg

Introduced in R2018a