Main Content

Simulink.sdi.getDeleteRunsOnLowSpace

Get configured behavior when size of logged data approaches configured limits

Since R2021a

    Description

    example

    deleteRuns = Simulink.sdi.getDeleteRunsOnLowSpace returns the configured behavior for when the size of logged data approaches a configured size limit or free disk space requirement. When deleteRuns is true, logged data from prior simulations is deleted first to free space for continued logging in the current simulation. If deleting prior simulation data does not free enough disk space to continue logging through the end of the current simulation, recording data is disabled. When deleteRuns is false, recording data from the current simulation is disabled and no logged data from prior simulations is deleted.

    Examples

    collapse all

    You can limit the size of logged data by specifying a maximum size for the data or a minimum amount of disk space to leave empty. This example uses several functions to get the current configuration of logging size limits.

    Use the Simulink.sdi.getRequiredFreeSpace function to get the configured minimum free disk space requirement. The returned value uses units of GB.

    minDiskSpace = Simulink.sdi.getRequiredFreeSpace;

    Use the Simulink.sdi.getMaxDiskUsage function to get the configured maximum size for data logged to disk. The returned value uses units of GB.

    maxSize = Simulink.sdi.getMaxDiskUsage;

    Use the Simulink.sdi.getDeleteRunsOnLowSpace function to get the configured behavior when approaching the logging limits. When deleteRuns is true, data from prior simulations is deleted first to free disk space for continued logging in the current simulation. If deleting runs does not free up enough space, recording logged data is disabled for the current simulation. When deleteRuns is false, recording logged data is disabled for the current simulation and data from prior simulations is retained.

    deleteRuns = Simulink.sdi.getDeleteRunsOnLowSpace;

    Output Arguments

    collapse all

    Behavior when logged data size approaches configured limits, returned as 1 (true) or 0 (false).

    • true — First delete data logged from prior simulations. If deleting prior simulation data does not free enough space, disable recording data.

    • false — Disable recording data for current simulation. Do not delete prior simulation data.

    When recording is disabled due to configured disk space requirements or logged data size limits, you need to enable recording again to log data in subsequent simulations. You can configure the record mode in the Simulation Data Inspector preferences or by using the Simulink.sdi.setRecordData function.

    Version History

    Introduced in R2021a