On this page

Introduction

Information stored in SysML models can be reused in simulations performed by Simulink and existing Simulink models can be brought back into MBSE environment. Most often system engineers model the system down to a point of where executable models start in Simulink. The purpose is to keep these models consistent as the system design evolves.

 Export to Simulink Tool allows to generate the Simulink model from SysML model. The SLX or MDL file format is created that contains the block diagram and block properties of the simulation. The following figure illustrates the SysML Internal Block Diagram exported to Simulink Block diagram.

The SysML Internal Block Diagram exported to Simulink Block diagram.

Exporting model to the Simulink file

You can export to the Simulink file:

  • Block - exports the model (Read the procedure below).
  • Instance Specification - exports particular configuration with initial values and subtype instances as specified in the instance model. 

To export model to the Simulink file


  1. In the Model Browser, select the Block you want to export and do one of the following:
    • In the top-left corner of the modeling tool, click File > Export To > Simulink.
    • Right-click the selected Block and then click Tools > Export to Simulink.
  2. Specify export options in the Simulink Export Options dialog. Option descriptions >>
  3. Click OK.
    The Simulink (.slx) file is generated and saved to your file directory.

The Simulink export generates several files depending on the model. Make sure these files are present in the MATLAB work folder for model to open correctly.

Simulink Export Options

Each time you export your model to the Simulink file, the Simulink Export Options dialog opens with already selected options. The detailed descriptions are provided in the following table.


OptionDescription
Format

Select the file format to export:

  • Text (.mdl) - exports to legacy textual format
  • XML (.slx) - exports to compressed XML-based file format.
S-Function or Simscape

Select how to export SysML parametrics:

  • as Simscape - file type dedicated to use in the MATLAB® environment with an extension .ssc. Use ssc_build in Matlab to generate library and blocks from generated Simscape files. If blocks have bidirectional (inout) ports, Simscape should be selected as export option, as Simulink only supports unidirectional inports and outports. 
  • as S-Function version 1 - generate all constraints into separate files that contain functions.
  • as S-Function version 2 - generate all constraints into separate files that contain functions.
Simscape port librariesSelect whether to create or reuse existing port types.
Composite Signals

Select how to export Proxy Port/Interface Block with multiple Flow Properties (composite signals):

  • as bus Creators/Selectors.
    Bus Creator blocks create buses within a subsystem or model.

    Bus Selector blocks extract specified elements of the bus.

  • as bus In/Out ports.
    Out Bus Element blocks create a bus at a subsystem or model interface.

    In Bus Element blocks extract specified elements of a bus at a subsystem or model interface.

Apply <<SimulinkBlock>> on export

Select to automatically apply the <<SimulinkBlock>> stereotype upon the export of the selected Block. Once stereotype is applied, further Part usages of this Block get referenced to the exported Simulink model. Do not select the checkbox if you want to export this target again. For more information refer to Reusing and referencing Simulink models.

Click to specify the location of generated Simulink file or rename the file.