Upgrade Model Files to SLX and Preserve Revision History

Project Tools for Migrating Model Files to SLX

A project helps you upgrade model files from MDL format to SLX format. You can use the project integrity checks to automatically add the new SLX file to your project, remove the MDL file from the project, and preserve the revision history of your MDL file with the new SLX file. You can then commit your changes to source control and maintain the continuity of your model file history.

The following example shows how to use project checks to fix your project after manually saving a model as SLX.

Upgrade the Model and Commit the Changes

  1. Open a new copy of the airframe project.

    sldemo_slproject_airframe

  2. In the project Files view, right-click the model file AnalogControl.mdl, and select Open.

  3. Select File > Save As.

  4. Ensure that Save as type is SLX, and click Save. SLX is the default unless you change your preferences.

  5. To see the results, in the Files view, change the view from Project (number of files) to All. Expand the models folder.

    Simulink® saves the model in SLX format, and creates a backup file by renaming the MDL file to AnalogControl.mdl.releasename. The project also reports the original name of the MDL file as missing.

  6. To resolve these issues, on the Project tab, click Run Checks to run the project integrity checks. The checks look for MDL files converted to SLX, and offer automatic fixes if that check fails.

  7. Click the Fix button to view recommended actions and decide whether to make the changes.

    When you click Fix, the Missing Files dialog box offers to remove the missing MDL file from the project and add the new SLX file to the project.

  8. Click Yes to perform the fix.

    Project checks rerun after you click Yes to perform the fix. Close the Project Integrity Checks dialog box.

  9. Select the Modified files view. Expand the models folder and check the Modifications column to see that the newly created SLX file has been added to the project, and the original MDL file is scheduled for removal.

  10. On the Project tab, in the Source Control section, click Commit. Enter a comment for your submission in the dialog box, for example, Convert to SLX, and click Submit.

Verify Changes After Upgrade to SLX

  1. In the Files view, select the All view. Check that the backup file, for example, AnalogControl.mdl.r2018b is still present, along with the new SLX file. Click the Actions button to customize the columns to show, such as Date Modified.

  2. In the Files view, select the Project files view. Check that only the new SLX file is included in the project, and the backup file is not included in the project.

  3. Right-click the model file AnalogControl.slx and select Show Revisions.

  4. In the File Revisions dialog box, verify that the previous revision is AnalogControl.mdl. The revision history of the previous model file is preserved with the new SLX file.

For an example showing commands to find and upgrade all model files in the project to SLX, see Converting from MDL to SLX Model File Format in a Project.

Note

For an example showing how to programmatically upgrade a whole project using upgradeadvisor, see instead:

sldemo_slproject_upgrade

Related Topics