IntroductionInformation 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 fileYou 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
- 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.
- Specify export options in the Simulink Export Options dialog. Option descriptions >>
- Click OK.
The Simulink (.slx) file is generated and saved to your file directory.
Simulink Export OptionsEach 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.
Option | Description |
---|
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 libraries | Select whether to create or reuse existing port types. | Composite Signals | | Apply <<SimulinkBlock>> on export | Select to automatically apply the <<SimulinkBlock>> stereotype upon the export of the selected Block. | | Click to specify the location of generated Simulink file or rename the file. |
|