Information about Simulink MDL and SLX formats?

Douglas B. Staple picture Douglas B. Staple · May 1, 2014 · Viewed 14.2k times · Source

What information is available about these file formats? What tools are available for parsing these files?

Answer

Douglas B. Staple picture Douglas B. Staple · May 1, 2014

Very little information is publicly available. Here's the little I've found:

MDL and SLX are MathWorks proprietary file formats for storing Simulink models. SLX was introduced in Simulink R2012a and made the default file format in R2012b. Besides the file structure, the content of SLX and MDL files are very similar. For example, key-value pairs appear to be the same between the two formats. People often say that parsing these files is a bad idea because they can change between Simulink versions (see e.g. am304 and my comments above), but I have not seen much evidence of this.

The MDL format seems to have been developed in-house at MathWorks. There seems to have been an MDL parser for python, but it was of limited functionality, and the website is down as of May 2014.

An SLX file is a zip file containing a collection of XML files, with most of the model specification stored in simulink/blockdiagram.xml. @am304 pointed out this information from the MathWorks website:

SLX is a compressed package that conforms to the Open Packaging Conventions (OPC) interoperability standard. SLX stores model information using Unicode® UTF-8 in XML and other international formats. Saving Simulink models in the SLX format:

  • Typically reduces file size compared to MDL. The file size reduction between MDL and SLX varies depending on the model.

  • Solves some problems in previous releases with loading and saving MDL files containing Korean and Chinese characters.

  • Enables incremental loading and saving. Simulink optimizes performance and memory usage by loading only required parts of the model and saving only modified parts of the model.

Here are a few more references besides the ones in the text above:
How convert simulink files to XML
http://www.scootersoftware.com/vbulletin/showthread.php?t=11568
http://blog.xogeny.com/blog/dont-zip/
http://blog.developpez.com/matlab/p11469/simulink-2/nouveau-format-slx-pour-les-modeles-simulink