Simulink.SimulationData.updateDatasetFormatLogging

Convert model and its referenced models to use Dataset format for signal logging

Syntax

Simulink.SimulationData.updateDatasetFormatLogging(top_model)
Simulink.SimulationData.updateDatasetFormatLogging(top_model, variants)

Description

Simulink.SimulationData.updateDatasetFormatLogging(top_model) converts the top-level model and all of its referenced models to use the Dataset format for signal logging instead of the ModelDataLogs format. If a Model block has the Generate preprocessor conditionals option selected, the function converts all the variants; otherwise, the function converts only the active variant.

Simulink.SimulationData.updateDatasetFormatLogging(top_model, variants) specifies which variant models to convert to use the Dataset signal logging format. For details about the variants argument, see Input Arguments

Input Arguments

top_model

String that specifies the name of the top-level model.

variants

String that specifies which variant models to update:

  • 'ActivePlusCodeVariants' — (Default) Search all variants if any generate preprocessor conditionals. Otherwise, search only the active variant.

  • 'ActiveVariants' — Convert only the active variant.

  • 'AllVariants' — Convert all variants.

More About

expand all

Dataset

The Dataset format causes Simulink® to use a Simulink.SimulationData.Dataset object to store the logged signal data. The Dataset format use MATLAB® timeseries objects to formatting the data.

ModelDataLogs

The ModelDataLogs format causes Simulink to use a Simulink.ModelDataLogs object to store the logged signal data.Simulink.Timeseries and Simulink.TsArray objects provide the format for the data.

Tips

  • Simulink checks signal logging data format consistency for certain model referencing configurations. For details, see Model Reference Signal Logging Format Consistency. You can use the Upgrade Advisor (with the upgradeadvisor function) to upgrade a model to use Dataset format.

  • An alternative approach for handling reported inconsistencies is to use the Simulink.SimulationData.updateDatasetFormatLogging function to update the models to use Dataset format. This approach sets the Model Configuration Parameters > Data Import/Export > Signal logging format parameter to Dataset for each referenced model and each variant.

  • The conversion function sets the SignalLoggingSaveFormat parameter value to Dataset for all the updated models.

  • If you want to save the format updates that the conversion function makes, then ensure that the top-level model, referenced models, and variant models are accessible and writable.

  • If a model has no other unsaved changes, the conversion function saves the format updates to the model. If the model has unsaved changes, the function updates the format, but does not save those changes.

  • If you use this function for a model that does not include any referenced models, the function converts the top-level model use the Dataset format.

  • For new models, use the Dataset format for signal logging. The ModelDataLogs format will be removed in a future release. For an existing model that uses the ModelDataLogs format, you should migrate the model to use Dataset format. For details, see Migrate from ModelDataLogs to Dataset Format.

    After conversion, to reset the format back to ModelDataLogs, you must set the Signal logging format parameter individually for each model. If you want to use the ModelDataLogs format for the model in the future, consider using one of these approaches:

    • Save a version of the model that uses the ModelDataLogs format.

    • Use the conversion function to convert the model to use Dataset format for signal logging and run the simulation in Normal mode. However, do not save the changes.

Was this topic helpful?