Main Content

import

Import file log data from target computer

Description

example

import(target_object.FileLog,'app_name') imports file log signal data from available simulation runs for the selected real-time application. You can import file log data from the target computer when the real-time application is stopped or recording is stopped.

For information about the availability of file logging data, see list.

example

import(target_object.FileLog,run_info) imports file log signal data for the selected table of available simulation runs. To create the table, use the list function.

example

import(target_object.FileLog,run_ids) imports file log signal data for the selected simulation runs.

If a Simulink Real-Time model has File Log blocks, when you load the real-time application on the target computer, file logging is enabled. This default operation is the same as enabling file logging by using the command startRecording.

To control file logging with the Enable File Log block, when you load the real-time application on the target computer, disable or enable file logging by using the E (enable/disable) input signal to the block.

If you started the real-time application with the AutoImportFileLog option enabled, when the development computer is connected to the target computer and the real-time application stops, the file log data is uploaded to the Simulation Data Inspector. For a standalone target computer that does file logging when not connected, after connecting the development and target computers, upload the file logging data for the application by using the import function.

The AutoImportFileLog option has no effect when using the startRecording function or stopRecording function.

If a model includes an Enable File Log block, the AutoImportFileLog option has no effect. Use the import function to upload logging data for real-time applications that you build from these models.

For more information about the file logging workflow, see Signal Logging and Streaming Basics.

Note: The start function FileLogMaxRuns option determines how many runs of file log data are retained on the target computer. As you add a new log for a simulation run, the oldest log exceeding the maximum number of runs is removed. To avoid losing file log data, use the import function or AutoImportFileLog option to upload logging data. For more information, see FileLogMaxRuns.

Examples

collapse all

For target computer object tg with simulation run data available for real-time application my_app, import file log data to the Simulation Data Inspector for the application.

import(tg.FileLog,'app_name')

For target computer object tg with simulation run data available for real-time applications, get available simulation run information, and then import file log data.

Get table of available simulation run information. Import file log data from applications runs to the Simulation Data Inspector.

my_run_info = list(tg.FileLog);
import(tg.FileLog,my_run_info);

Alternatively, you can get the available file log information and import the file log data in one step.

import(tg.FileLog,tg.FileLog.list);

For target computer object tg with simulation run data available for real-time applications slrt_ex_osc_rt_t and slrt_ex_osc, import file log data to the Simulation Data Inspector for selected simulation runs. For more information, see list.

Get table of available simulation run information.

my_run_info = list(tg.FileLog)
my_run_info = 

  3×3 table 

             Application             StartDate          Size  
          __________________    ____________________    _____ 

    1.    "slrt_ex_osc_rt_t"    12-Dec-2019 21:59:31    94944 
    2.    "slrt_ex_osc_rt_t"    12-Dec-2019 21:59:45    84736 
    3.    "slrt_ex_osc"         12-Dec-2019 21:59:57    82176

Import file log data from application runs 1 and 2 in the available file logs table.

import(tg.FileLog,1:2);

Input Arguments

collapse all

Provides access to methods that manipulate the target computer properties.

Example: tg

Provides name of real-time application MLDATX file that you built from the model.

Example: 'slrt_ex_osc'

The run_info structure is a MATLAB table that is structured by Application and RowNames. For information about available log runs, see list.

Identifies the simulation runs to import from the target computer into the Simulation Data Inspector. The run_ids are rows in the available file logging data table. For information about available log runs, see list.

Version History

Introduced in R2020b

expand all