Main Content

Simulink.sdi.setArchiveRunLimit

Specify a limit for the number of runs stored in the Simulation Data Inspector archive

Description

example

Simulink.sdi.setArchiveRunLimit(limit) sets the Simulation Data Inspector archive limit as specified by limit. When the number of runs in the archive reaches the limit, the Simulation Data Inspector starts to delete runs from the archive on a first-in, first-out basis. When another run enters the archive, the Simulation Data Inspector deletes the run that has been in the archive the longest. A limit of -1 indicates that the archive has no limit for the number of runs it stores. A limit of 0 means that the archive cannot contain any runs.

Tip

To retain data for only the current run, configure the Simulation Data Inspector to automatically archive runs and set the archive run limit to 0.

Examples

collapse all

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. You can save the parameters to restore your preferences after you finish designing or debugging.

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

Set the archive limit to 0 and configure the Simulation Data Inspector to automatically archive simulation runs.

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

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

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

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

Input Arguments

collapse all

Limit for the number of runs stored in the Simulation Data Inspector archive. When the number of runs in the archive reaches the limit, the Simulation Data Inspector starts to delete runs from the archive, on a first-in, first-out basis. A limit of -1 indicates that there is no limit on the runs stored in the archive. A limit of 0 indicates that the archive cannot contain any runs.

Example: -1

Example: 10

Introduced in R2018b