Main Content

Set Run in Kernel Mode Data Archiving Parameters

You must select the Log data to workspace check box in the Scope parameters dialog box for the software to save data in the data logging MAT-files.

This procedure uses the model sldrtex_model. To open this model, in the MATLAB Command Window, type:

open_system(docpath(fullfile(docroot,'toolbox',...
    'sldrt','examples','sldrtex_model')))

The steps in this procedure assume that you have already loaded that model and have completed the steps in Set Scope Parameters for Logging to File and Set Run in Kernel Mode Properties for Logging to File.

After you create a Simulink® model, you can enter the Data Archiving Parameters for data logging to a file:

  1. In the Simulink Editor, on the Desktop Real-Time tab, click Prepare > Control Panel.

  2. In the External Mode Control Panel, click the Data Archiving button.

  3. Select the Enable archiving check box.

  4. In the Directory text box, enter the path to a folder on your disk. For example, if your MATLAB® working folder is named mwd, enter

    c:\mwd
    
  5. In the File text box, enter the file name prefix for the data files to be saved. For example, enter:

    data
    

    The MATLAB environment names the files data_0.mat, data_1.mat, and so on. The number of files equals the total sample points. For example, if you set Duration to Total sample points, then only one file is created.

  6. Select the Append file suffix to variable names check box.

    Image of enable data archiving window

  7. Click the OK button.

    In the External Signal & Triggering dialog box, click the OK button for the changes you made to take effect. You do not have to rebuild your real-time application.

Related Topics