Main Content

Simulink.sdi.setArchiveRunLimit

Specify number of runs to retain in Simulation Data Inspector archive

Description

example

Simulink.sdi.setArchiveRunLimit(limit) sets the limit limit for the number of runs to retain in the Simulation Data Inspector archive. When the number of runs in the archive reaches the specified limit, the Simulation Data Inspector deletes runs from the archive on a first-in, first-out basis.

Tip

To automatically limit the number of runs, configure the Simulation Data Inspector to automatically move prior runs into the archive using the Simulink.sdi.setAutoArchiveMode function and specify the archive run limit.

For information about how to control the amount of data logged from simulation, see Limit the Size of Logged Data.

Examples

collapse all

Configure the Simulation Data Inspector to automatically move prior simulation runs into the archive.

Simulink.sdi.setAutoArchiveMode(true)

Specify the number of runs to retain in the Simulation Data Inspector by setting the archive run limit. For example, specify the archive run limit as 5 to only retain five prior runs in addition to the current run.

Simulink.sdi.setArchiveRunLimit(5)

The Simulation Data Inspector automatically moves prior runs into the archive. Once the archive contains five runs, the Simulation Data Inspector deletes run data from the archive on a first-in, first-out basis.

You can configure the Simulation Data Inspector to retain only the logged data for your current simulation. In iterative design and debugging workflows, this configuration helps prevent accumulation of unwanted logged data on disk.

First, check the configuration of the Simulation Data Inspector archive. Save the archive preference values to restore your preferences after you finish designing or debugging.

limit = Simulink.sdi.getArchiveRunLimit;
mode = Simulink.sdi.getAutoArchiveMode;

Configure the Simulation Data Inspector to automatically move runs into the archive. Then, set the archive run limit to 0.

Simulink.sdi.setAutoArchiveMode(true)
Simulink.sdi.setArchiveRunLimit(0)

When you simulate your model, the Simulation Data Inspector deletes the previous run and updates the view to show signals from the current simulation.

When you finish designing or debugging your model, you can restore the Simulation Data Inspector archive back to the previous configuration.

Simulink.sdi.setArchiveRunLimit(limit)
Simulink.sdi.setAutoArchiveMode(mode)

Input Arguments

collapse all

Maximum number of runs to store in Simulation Data Inspector archive, specified as a whole numeric scalar. To configure no limit, specify -1.

Tips

To retain simulation results for only the current run, configure the Simulation Data Inspector to automatically archive simulation runs, and specify the archive run limit as 0.

Simulink.sdi.setAutoArchiveMode(true)
Simulink.sdi.setArchiveRunLimit(0)

Version History

Introduced in R2018b